/* ==========================================================================
   NISH GOLD & BULLION - CLIENT ACCOUNT PAGES
   login.php / register.php / forgot-password.php / reset-password.php

   Linked from includes/header.php only for the pages above, so the public
   pages keep loading the single master stylesheet (assets/css/style.css).
   Everything here builds on the black + gold design system in style.css.
   ========================================================================== */

/* ==========================================================================
   1. PAGE SHELL
   ========================================================================== */
.auth-page {
    position: relative;
    padding: 64px 0 84px;
    min-height: 70vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 12%, rgb(244 177 4 / 14%) 0%, transparent 40%),
        radial-gradient(circle at 92% 88%, rgb(244 177 4 / 9%) 0%, transparent 44%),
        linear-gradient(135deg, #faf9f6 0%, #ffffff 62%, #fffaf0 100%);
}

/* A faint oversized wordmark behind the cards, echoing the hero sections. */
.auth-page::before {
    content: 'NISH GOLD';
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8.5rem;
    font-weight: 900;
    letter-spacing: 14px;
    line-height: 1;
    color: rgb(0 0 0 / 2.6%);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

.auth-page > .container {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   2. LAYOUT
   ========================================================================== */

/* One shared card: dark brand panel on the left, form panel on the right. */
.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 1010px;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.12);
}

/* Two independent cards, mirroring contact.php (.contact-page-grid). */
.auth-layout-split {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 34px;
    max-width: 1060px;
    background: none;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

.auth-layout-split .auth-aside {
    border-radius: 10px;
    border: 1px solid var(--border-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
    padding: 40px 32px;
}

.auth-layout-split .auth-main {
    position: relative;
    background: var(--white);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 30px 28px 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    justify-content: flex-start;
}

/* Thin gold accent along the top edge of the form card. */
.auth-layout-split .auth-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 26px;
    right: 26px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--gold) 22%, var(--gold-dark) 78%, transparent);
}

/* ==========================================================================
   3. BRAND PANEL (left)
   ========================================================================== */
.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 46px 38px;
    color: #ffffff;
    background: linear-gradient(160deg, #050505 0%, #141414 52%, #000000 100%);
}

/* Dotted gold grid - purely decorative. */
.auth-aside::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgb(244 177 4 / 20%) 1.2px, transparent 1.2px);
    background-size: 18px 18px;
    pointer-events: none;
}

/* Warm glow bleeding into the top right corner. */
.auth-aside::after {
    content: '';
    position: absolute;
    top: -130px;
    right: -110px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(244 177 4 / 20%) 0%, transparent 68%);
    pointer-events: none;
}

.auth-aside > * {
    position: relative;
    z-index: 1;
}

/* Brand lockup at the top of the panel. */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.auth-brand-mark {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgb(244 177 4 / 45%);
    background: rgb(244 177 4 / 12%);
    color: var(--gold);
    font-size: 1.05rem;
}

.auth-brand-text {
    display: block;
    line-height: 1.25;
}

.auth-brand-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #ffffff;
}

.auth-brand-sub {
    display: block;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--gold);
}

.auth-aside-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    background: rgb(244 177 4 / 12%);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 7px 14px;
    border-radius: 30px;
    margin-bottom: 20px;
}

.auth-aside-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.auth-aside-title .gold-text {
    color: var(--gold);
}

.auth-aside-text {
    font-size: 0.88rem;
    color: var(--text-light-muted);
    line-height: 1.7;
    margin-bottom: 26px;
}

/* ---- Benefit list: soft glass chips that light up on hover ---- */
.auth-benefits {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-benefit {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid rgb(255 255 255 / 7%);
    background: rgb(255 255 255 / 3%);
    font-size: 0.84rem;
    color: #e6e6e6;
    line-height: 1.5;
    transition: var(--transition);
}

.auth-benefit:hover {
    border-color: rgb(244 177 4 / 40%);
    background: rgb(244 177 4 / 8%);
    transform: translateX(3px);
}

.auth-benefit i {
    color: var(--gold);
    font-size: 0.95rem;
    margin-top: 3px;
    flex-shrink: 0;
}

/* ---- Trust strip along the bottom of the panel ---- */
.auth-aside-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid rgb(244 177 4 / 22%);
}

.auth-stat {
    text-align: center;
}

.auth-stat-value {
    display: block;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    color: var(--gold);
}

.auth-stat-label {
    display: block;
    margin-top: 3px;
    font-size: 0.62rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-light-muted);
}

/* ==========================================================================
   4. FORM PANEL (right)
   ========================================================================== */
.auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px 40px;
}

.auth-head {
    margin-bottom: 24px;
}

.auth-head h1 {
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-black);
    margin-bottom: 8px;
}

.auth-head p {
    font-size: 0.88rem;
    color: #6d6d6d;
    line-height: 1.6;
}

/* The contact/register heading block, reused so the auth pages match. */
.auth-main .quote-header-wrapper {
    margin-bottom: 10px;
}

.auth-main .quote-subtitle-new {
    margin-bottom: 22px;
}

/* Small "back" link sitting above the heading. */
.auth-top-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    align-self: flex-start;
    margin-bottom: 18px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}

.auth-top-back i {
    font-size: 0.72rem;
    transition: transform 0.25s ease;
}

.auth-top-back:hover {
    color: var(--gold-dark);
}

.auth-top-back:hover i {
    transform: translateX(-3px);
}

/* ---- Fields ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form .form-row-new {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-dark);
    margin-bottom: 6px;
}

/* Wrapper so a label can sit above an icon-prefixed input. */
.auth-field {
    width: 100%;
}

/* Red asterisk on required fields. */
.auth-label .req {
    color: #d9534f;
    margin-left: 2px;
    font-weight: 800;
}

/* Labels sit a little tighter inside the gold bordered cards. */
.auth-layout-split .auth-label {
    color: var(--text-body);
    margin-bottom: 5px;
}

/* Taller, softer fields inside the auth cards. */
.auth-form .form-input-new {
    padding-top: 13px;
    padding-bottom: 13px;
    border-color: #e4e0d6;
    background: #fdfcfa;
}

.auth-form .form-input-new:hover {
    border-color: #d9cfae;
}

.auth-form .form-input-new:focus {
    background: #ffffff;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(244, 177, 4, 0.16);
}

/* Password wrapper needs room for the show/hide button. */
.auth-pw-wrap .form-input-new {
    padding-right: 44px;
}

.auth-pw-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #9a9a9a;
    font-size: 0.92rem;
    cursor: pointer;
    padding: 7px 9px;
    z-index: 3;
    transition: var(--transition);
}

.auth-pw-toggle:hover {
    color: var(--gold);
}

/* ---- Inline alert above the submit button ---- */
.auth-alert {
    display: none;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    line-height: 1.5;
    padding: 11px 14px;
    border-radius: 5px;
    border: 1px solid;
}

.auth-alert.show {
    display: flex;
}

.auth-alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.auth-alert-error {
    background: #fdf2f2;
    border-color: #f0b4b4;
    color: #a32020;
}

.auth-alert-success {
    background: #f2fbf4;
    border-color: #a9dcb7;
    color: #1d6b33;
}

.auth-alert-info {
    background: var(--gold-bg-light);
    border-color: var(--border-gold);
    color: #7a5406;
}

.auth-alert a {
    text-decoration: underline;
    font-weight: 600;
}

/* ---- Row holding "Remember me" + "Forgot password" ---- */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-body);
    user-select: none;
}

.auth-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--gold);
    cursor: pointer;
    margin: 0;
}

.auth-link {
    color: var(--gold-dark);
    font-weight: 600;
    transition: var(--transition);
}

.auth-link:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* ---- Submit button: black pill with a gold sweep on hover ---- */
.auth-submit {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: linear-gradient(135deg, #000000 0%, #1c1c1c 100%);
    color: var(--gold);
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 14px 22px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.auth-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgb(244 177 4 / 24%), transparent);
    transform: skewX(-18deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

.auth-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gold) 0%, #e2a006 100%);
    color: #000000;
    box-shadow: 0 6px 20px rgba(229, 136, 14, 0.3);
}

.auth-submit:hover:not(:disabled)::after {
    left: 125%;
}

.auth-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-submit .auth-btn-label,
.auth-submit .auth-spinner {
    position: relative;
    z-index: 1;
}

.auth-submit .auth-spinner {
    display: none;
}

.auth-submit.is-loading .auth-spinner {
    display: inline-block;
}

.auth-submit.is-loading .auth-btn-label {
    opacity: 0.7;
}

.auth-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* Terms agreement checkbox on the register form. */
.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.78rem;
    color: #6d6d6d;
    line-height: 1.5;
    cursor: pointer;
}

.auth-terms input {
    width: 15px;
    height: 15px;
    accent-color: var(--gold);
    cursor: pointer;
    margin: 2px 0 0;
    flex-shrink: 0;
}

.auth-terms a {
    color: var(--gold-dark);
    font-weight: 600;
}

.auth-terms a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   5. VALIDATION STATE
   ========================================================================== */

/* A failing field turns its own border red. */
.auth-form .form-input-new.is-invalid,
.auth-form .form-select-new.is-invalid {
    border-color: #d9534f;
    box-shadow: 0 0 6px rgba(217, 83, 79, 0.18);
}

/* Per field validation message. */
.auth-field-error {
    display: none;
    margin-top: 6px;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #d9534f;
}

.auth-field-error.show {
    display: block;
}

/* The whole step is highlighted when it is the one that failed. */
.auth-step {
    width: 100%;
}

.auth-step.is-invalid {
    position: relative;
}

.auth-step.is-invalid::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 3px;
    background: #d9534f;
}

@media (max-width: 768px) {
    .auth-step.is-invalid::before {
        display: none;
    }
}

/* ==========================================================================
   6. CARD FOOTER: divider, secondary CTA, security note
   ========================================================================== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: #a0a0a0;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.9px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-gray);
}

.auth-foot {
    text-align: center;
    font-size: 0.85rem;
    color: #6d6d6d;
}

/* Secondary action, e.g. "Create a client account" on the login page. */
.auth-alt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 12px 20px;
    border: 1.5px solid var(--border-gold);
    border-radius: 4px;
    background: #ffffff;
    color: var(--gold-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: var(--transition);
}

.auth-alt-btn:hover {
    background: var(--gold-bg-light);
    border-color: var(--gold);
    color: #8a5a04;
}

.auth-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
}

.auth-secure-note i {
    color: #2e7d32;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold-dark);
    transition: var(--transition);
}

.auth-back:hover {
    color: var(--gold);
}

/* ==========================================================================
   7. OTP VERIFICATION (verify-account.php)
   ========================================================================== */
.otp-panel {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 18px 18px 16px;
    margin-bottom: 16px;
    background: #ffffff;
    transition: var(--transition);
}

.otp-panel:focus-within {
    border-color: var(--gold);
    box-shadow: 0 6px 22px rgba(217, 148, 25, 0.16);
}

.otp-panel.is-verified {
    border-color: #a9dcb7;
    background: #f6fcf8;
}

.otp-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.otp-panel-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-dark);
}

.otp-panel-title i {
    color: var(--gold);
    font-size: 1rem;
}

.otp-status-badge {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.9px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #fdf2f2;
    border: 1px solid #f0b4b4;
    color: #a32020;
    white-space: nowrap;
}

.otp-panel.is-verified .otp-status-badge {
    background: #eaf7ee;
    border-color: #a9dcb7;
    color: #1d6b33;
}

.otp-panel-target {
    font-size: 0.8rem;
    color: #6d6d6d;
    margin-bottom: 12px;
    word-break: break-all;
}

/* Six digit boxes. */
.otp-code-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.otp-box {
    flex: 1;
    min-width: 0;
    height: 52px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    font-family: var(--font-body);
    color: var(--text-black);
    background: var(--gold-bg-light);
    border: 1.5px solid var(--border-gold);
    border-radius: 7px;
    transition: var(--transition);
    -moz-appearance: textfield;
}

.otp-box::-webkit-outer-spin-button,
.otp-box::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.otp-box:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--gold-dark);
    box-shadow: 0 0 0 3px rgba(244, 177, 4, 0.22);
}

.otp-box.is-filled {
    background: #ffffff;
    border-color: var(--gold);
}

.otp-box.is-error {
    border-color: #c0392b;
    background: #fdf2f2;
    animation: otpShake 0.4s ease-in-out;
}

@keyframes otpShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.otp-panel-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.otp-verify-btn {
    flex: 1;
    min-width: 150px;
    background: #000000;
    color: var(--gold);
    border: none;
    font-family: var(--font-body);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    padding: 11px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.otp-verify-btn:hover:not(:disabled) {
    background: var(--gold);
    color: #000000;
}

.otp-verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #e8e8e8;
    color: #9a9a9a;
}

.otp-resend-btn {
    background: transparent;
    border: 1.5px solid var(--border-gold);
    color: var(--gold-dark);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: var(--transition);
}

.otp-resend-btn:hover:not(:disabled) {
    background: var(--gold-bg-light);
}

.otp-resend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.otp-spinner {
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .auth-page {
        padding: 48px 0 64px;
    }

    .auth-page::before {
        font-size: 5.5rem;
        letter-spacing: 8px;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        max-width: 560px;
    }

    .auth-aside {
        padding: 34px 28px;
    }

    .auth-aside-title {
        font-size: 1.5rem;
    }

    .auth-main {
        padding: 32px 26px;
    }

    /* The split layout stacks like .contact-page-grid. */
    .auth-layout-split {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: 560px;
    }

    .auth-layout-split .auth-aside,
    .auth-layout-split .auth-main {
        padding: 32px 26px;
    }

    .auth-aside-stats {
        margin-top: 22px;
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 32px 0 48px;
    }

    .auth-page::before {
        display: none;
    }

    /* The form card carries everything on small screens. */
    .auth-aside {
        display: none;
    }

    .auth-main {
        padding: 26px 20px;
    }

    .auth-layout-split .auth-main {
        padding: 26px 20px;
    }

    .auth-form .form-row-new {
        grid-template-columns: 1fr;
    }

    .auth-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .otp-code-row {
        gap: 5px;
    }

    .otp-box {
        height: 46px;
        font-size: 1.1rem;
    }

    .otp-panel-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .otp-verify-btn,
    .otp-resend-btn {
        width: 100%;
    }
}
