/* Falcon Miners portal — matches main site theme (#c59f5f gold)
   Responsive + iPhone / iOS Safari (Bootstrap 3 grid) */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.portal-body {
    background: #f7f7f7;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    overflow-x: hidden;
    max-width: 100vw;
}
.portal-navbar {
    margin-bottom: 0;
}
.portal-nav-inner {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.portal-logo {
    max-height: 44px;
    width: auto;
}
.portal-nav-links li a {
    font-weight: 500;
    color: #373737 !important;
    padding-top: 18px;
    padding-bottom: 18px;
}
.portal-nav-links li a:hover {
    color: #c59f5f !important;
}
.portal-main {
    flex: 1;
    padding: 24px 0 48px;
    width: 100%;
    max-width: 100%;
}
@media (min-width: 768px) {
    .portal-main {
        padding: 40px 0 60px;
    }
}
.portal-footer {
    background: #2b2b2b;
    color: #aaa;
    padding: 24px 0;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    margin-top: auto;
}
.portal-footer p {
    margin: 0;
    color: #aaa;
    font-size: 13px;
}
.portal-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    padding: 16px;
    margin-bottom: 16px;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
@media (min-width: 768px) {
    .portal-card {
        padding: 24px;
        margin-bottom: 24px;
    }
}
.portal-card h2, .portal-card h3 {
    margin-top: 0;
    color: #373737;
}
.portal-section-title {
    text-align: center;
    margin-bottom: 32px;
}
.portal-section-title h2 {
    color: #373737;
    font-weight: 600;
}
.portal-package {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 20px;
    height: 100%;
    transition: border-color .2s, box-shadow .2s;
}
.portal-package:hover {
    border-color: #c59f5f;
    box-shadow: 0 4px 16px rgba(197,159,95,.15);
}
.portal-package .price-usd {
    font-size: 1.4em;
    font-weight: 600;
    color: #c59f5f;
}
.portal-package .price-bhd {
    color: #666;
}
.portal-progress-wrap {
    margin-top: 12px;
}
.portal-progress {
    height: 14px;
    background: #e9e9e9;
    border-radius: 8px;
    overflow: hidden;
}
.portal-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #c59f5f, #dfa501);
    border-radius: 8px;
    transition: width .4s ease;
}
.portal-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}
.portal-badge-pending { background: #fff3cd; color: #856404; }
.portal-badge-review { background: #cce5ff; color: #004085; }
.portal-badge-active { background: #d4edda; color: #155724; }
.portal-badge-rejected { background: #f8d7da; color: #721c24; }
.portal-badge-expired { background: #e2e3e5; color: #383d41; }
.portal-terms-box {
    max-height: 220px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #ddd;
    padding: 16px;
    background: #fafafa;
    border-radius: 4px;
    margin-bottom: 16px;
}

/* Checkout: checkbox before text; link opens terms modal */
.portal-checkout-terms-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
}
.portal-checkout-terms-check {
    flex-shrink: 0;
    margin: 4px 0 0 0 !important;
    width: auto;
    height: auto;
}
.portal-checkout-terms-intro {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    padding: 0;
}
.portal-terms-open {
    padding: 0 !important;
    border: none !important;
    vertical-align: baseline;
    font-size: inherit;
    line-height: inherit;
    color: #c59f5f !important;
    text-decoration: underline;
    white-space: nowrap;
}
.portal-terms-open:hover,
.portal-terms-open:focus {
    color: #b38a4f !important;
}
.portal-terms-modal-body {
    max-height: 65vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    text-align: left;
}

/* Touch-friendly navbar (iPhone) */
.portal-navbar .navbar-toggle {
    margin-top: 8px;
    margin-bottom: 8px;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    -webkit-tap-highlight-color: rgba(197, 159, 95, 0.2);
}
@media (max-width: 767px) {
    .portal-nav-links > li > a {
        min-height: 44px;
        line-height: 24px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
    border: 0;
}

/* iOS Safari: 16px+ inputs avoid zoom-on-focus */
@media (max-width: 767px) {
    .portal-body input.form-control,
    .portal-body select.form-control,
    .portal-body textarea.form-control {
        font-size: 16px !important;
    }
    .portal-login-main {
        padding-top: 24px;
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
    }
    .portal-login-logo {
        max-width: 100%;
        height: auto;
    }
    .portal-section-title {
        margin-bottom: 20px;
    }
}

/* —— Admin layout (phones / tablets) —— */
/* Avoid 100vw on admin: scrollbar width causes fake “gap” on the right in desktop browsers */
.portal-body.portal-admin-body {
    max-width: none;
    width: 100%;
    overflow-x: hidden;
}
.portal-admin-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
/* Do NOT zero .row margins — Bootstrap needs -15px to align columns with .container-fluid */

@media (min-width: 992px) {
    /*
     * Bootstrap .row uses ::before/::after (clearfix). If we set display:flex on .row,
     * those pseudo-elements become flex items and steal width — empty strip on the right.
     */
    .portal-admin-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
    }
    .portal-admin-row::before,
    .portal-admin-row::after {
        display: none !important;
        content: none !important;
    }
    .portal-admin-row > .admin-sidebar-desktop,
    .portal-admin-row > .admin-content {
        float: none;
    }
    .portal-admin-row > .admin-sidebar-desktop {
        flex: 0 0 16.66666667%;
        max-width: 16.66666667%;
        width: 16.66666667%;
    }
    .portal-admin-row > .admin-mobile-toolbar {
        display: none !important;
    }
    .portal-admin-row > .admin-content {
        flex: 1 1 0%;
        min-width: 0;
        width: auto !important;
        max-width: none !important;
    }
    /* Beat Bootstrap .col-md-10 { width: 83.33% } — that % is of full row, wrong with flex sidebar */
    .portal-admin-row > .admin-content.col-md-10 {
        width: auto !important;
        max-width: none !important;
    }
}
.admin-sidebar-brand {
    padding: 16px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    word-wrap: break-word;
}
.admin-sidebar-desktop {
    min-height: 100vh;
}
.admin-mobile-toolbar {
    background: #2b2b2b;
    padding: 8px max(8px, env(safe-area-inset-right, 0px)) 8px max(8px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid #444;
}
.admin-mobile-menu-btn {
    min-height: 44px;
    font-weight: 600;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.15);
}
.admin-mobile-collapse {
    border-bottom: 1px solid #444;
}
.admin-sidebar-mobile {
    margin: 0;
    padding-bottom: 8px;
}
.admin-sidebar-mobile a {
    padding: 14px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.admin-content-inner {
    padding: 16px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
}
@media (min-width: 992px) {
    .admin-content-inner {
        padding: 24px;
    }
}
.portal-admin-footer {
    margin-top: 0;
}
.admin-sidebar {
    background: #2b2b2b;
    min-height: 100vh;
    padding: 0;
}
.admin-sidebar a {
    display: block;
    padding: 12px 20px;
    color: #ccc;
    border-bottom: 1px solid #3d3d3d;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: #c59f5f;
    color: #fff;
    text-decoration: none;
}
.admin-content {
    padding: 24px;
    background: #f7f7f7;
    min-height: 100vh;
}
.table-admin {
    background: #fff;
}
.portal-alert { margin-bottom: 20px; }
.portal-pool-bar {
    margin-bottom: 28px;
}
.portal-pool-select {
    max-width: 100%;
    width: 100%;
}
.portal-pool-dash h3 {
    font-size: 18px;
}

/* Terms modal (checkout) + admin preview structure */
.portal-terms-modal-body .portal-terms-html .portal-terms-doc-title {
    font-size: 1.12em;
    margin: 0 0 1.25rem;
    line-height: 1.35;
}
.portal-terms-modal-body .portal-terms-html .portal-terms-block {
    margin-bottom: 1.35rem;
}
.portal-terms-modal-body .portal-terms-html .portal-terms-block:last-child {
    margin-bottom: 0;
}
.portal-terms-modal-body .portal-terms-html .portal-terms-heading {
    margin: 0 0 0.55rem;
    line-height: 1.35;
}
.portal-terms-modal-body .portal-terms-html .portal-terms-heading strong {
    font-weight: 600;
}
.portal-terms-modal-body .portal-terms-html .portal-terms-list {
    margin: 0 0 0.35rem;
    padding-left: 1.2em;
}
.portal-terms-modal-body .portal-terms-html .portal-terms-list li {
    margin-bottom: 0.35rem;
}
.portal-terms-modal-body .portal-terms-html p {
    margin: 0 0 0.5rem;
    line-height: 1.5;
}
.portal-terms-modal-body .portal-terms-html p:last-child {
    margin-bottom: 0;
}

/* Login page: no top navbar; dedicated button (do not use btn-primary — theme uses white-on-transparent for hero) */
.portal-login-main {
    padding-top: 48px;
}
.portal-login-heading .portal-login-logo {
    display: block;
    max-height: 56px;
    width: auto;
    margin: 0 auto 20px;
}
.portal-login-heading > p {
    margin-top: 8px;
    margin-bottom: 0;
    color: #7e7e7e;
    font-size: 15px;
}
/* Theme `style.css` + `theme.css` style .btn-primary for dark hero (white text, transparent bg) — invisible on white cards */
.portal-body .btn-primary,
a.btn-primary {
    background-color: #c59f5f !important;
    background-image: none !important;
    border: 2px solid #c59f5f !important;
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.portal-body .btn-primary:hover,
.portal-body .btn-primary:focus,
.portal-body .btn-primary:active,
a.btn-primary:hover,
a.btn-primary:focus,
a.btn-primary:active {
    background-color: #b38a4f !important;
    border-color: #b38a4f !important;
    color: #fff !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Anti-bot honeypot on register — hidden from users, often filled by bots */
.portal-reg-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
