/* static/css/auth.css
 * Branded account sign-up screen ("Cream" treatment).
 * Scoped under .auth-page so it never leaks into the app shell.
 * Tokens map to the canonical --bs-* palette in colors.css; the cream
 * surface values are hardcoded (they are not design tokens).
 */

/* ===== Escape the base.html .container / gradient-bg wrapper ===== */
body.auth-page {
    background: linear-gradient(180deg, #fbf7f2 0%, #eef0f3 100%);
    min-height: 100vh;
}
body.auth-page main { padding: 0; margin: 0; }
body.auth-page main > .container {
    max-width: none;
    width: 100%;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Card shell ============================================= */
.auth-card {
    width: 100%;
    max-width: 960px;
    margin: 32px;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(124, 69, 28, 0.16), 0 6px 16px rgba(124, 69, 28, 0.08);
    border: 1px solid var(--bs-gray-100);
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
}

/* ===== Brand panel (left, desktop) — Cream ==================== */
.brand-panel {
    position: relative;
    padding: 44px 42px;
    background: linear-gradient(160deg, #fff4ec 0%, #ffe9da 100%);
    border-right: 1px solid #f4ddcb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.brand-panel::after {
    content: "";
    position: absolute; right: -90px; bottom: -90px;
    width: 320px; height: 320px; border-radius: 50%;
    background: rgba(254, 98, 17, 0.05);
}
.brand-panel::before {
    content: "";
    position: absolute; right: 40px; top: -70px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(254, 98, 17, 0.05);
}

.bp-brand {
    display: flex; align-items: center; gap: 11px;
    position: relative; z-index: 1;
}
.bp-brand .mark {
    width: 40px; height: 40px; flex: none; border-radius: 11px; background: #fff;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}
.bp-brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.bp-brand .wordmark {
    font-family: 'Black Ops One', system-ui, sans-serif;
    font-size: 22px; letter-spacing: 0.04em; color: var(--bs-primary-600);
}

.bp-head { margin-top: 40px; position: relative; z-index: 1; }
.bp-head h2 {
    margin: 0; font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em;
    color: #2a1206; text-wrap: balance;
}
.bp-head p {
    margin: 12px 0 0; font-size: 14.5px; line-height: 1.55; color: #8a5638;
    max-width: 30ch;
}

.bp-perks {
    margin: auto 0 0; padding: 34px 0 0;
    list-style: none; display: flex; flex-direction: column; gap: 15px;
    position: relative; z-index: 1;
}
.bp-perks li { display: flex; align-items: center; gap: 13px; font-size: 14.5px; font-weight: 600; color: #3a1d0d; }
.bp-perks .pico {
    width: 30px; height: 30px; flex: none; border-radius: 9px;
    background: var(--bs-primary-500); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.bp-perks .ptext { line-height: 1.3; }
.bp-perks .ptext small { display: block; font-weight: 500; font-size: 12px; color: #9c6b4a; margin-top: 1px; }

/* ===== Form panel (right) ==================================== */
.form-panel {
    padding: 48px 46px;
    display: flex; flex-direction: column; justify-content: center;
}
.form-panel .fp-inner { width: 100%; max-width: 380px; margin: 0 auto; }

/* Mobile-only compact brand header (hidden on desktop) */
.mobile-brand { display: none; }

.fp-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--bs-gray-800); }
.fp-sub { margin: 7px 0 0; font-size: 14px; color: var(--bs-gray-600); line-height: 1.5; }

.auth-card form { margin-top: 26px; }
.auth-card .field { margin-bottom: 18px; }
.auth-card .field label {
    display: block; font-size: 12.5px; font-weight: 700; color: var(--bs-gray-600);
    margin-bottom: 7px; letter-spacing: 0.01em;
}
.auth-card .field label .req { color: var(--bs-primary-500); }

.auth-card .input-wrap { position: relative; }
.auth-card .input-wrap .lead-ico {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: var(--bs-gray-400); font-size: 14px; pointer-events: none;
}
.auth-card .field input {
    width: 100%; height: 50px;
    border: 1.5px solid var(--bs-gray-200); border-radius: 13px;
    background: var(--bs-gray-50);
    padding: 0 44px 0 42px;
    font-family: inherit; font-size: 15px; color: var(--bs-gray-800);
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.auth-card .field input::placeholder { color: var(--bs-gray-400); }
.auth-card .field input:focus {
    outline: none; background: #fff;
    border-color: var(--bs-primary-400);
    box-shadow: 0 0 0 4px rgba(254, 98, 17, 0.12);
}
.auth-card .field input.valid { border-color: #1f8a4c; }
.auth-card .field input.has-error { border-color: var(--color-red, #dc3545); }

.pw-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border: none; background: transparent; cursor: pointer;
    color: var(--bs-gray-500); font-size: 14px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.pw-toggle:hover { color: var(--bs-gray-800); background: var(--bs-gray-100); }

/* Inline server-side errors (allauth renders <ul class="errorlist">) */
.auth-card .errorlist {
    list-style: none; margin: 7px 0 0; padding: 0;
    font-size: 12.5px; line-height: 1.4; color: var(--color-red, #dc3545);
}
.auth-card .errorlist li { display: flex; align-items: flex-start; gap: 6px; }
.auth-card .nonfield-errors { margin: 0 0 18px; }

/* Password requirement checklist */
.pw-rules { margin: 12px 2px 0; list-style: none; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.pw-rules li {
    display: flex; align-items: flex-start; gap: 9px;
    font-size: 12.5px; line-height: 1.4; color: var(--bs-gray-500);
    transition: color 150ms ease;
}
.pw-rules li .check {
    width: 17px; height: 17px; flex: none; margin-top: 1px; border-radius: 999px;
    border: 1.5px solid var(--bs-gray-300); background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; color: transparent;
    transition: all 150ms ease;
}
.pw-rules li.met { color: var(--bs-gray-800); }
.pw-rules li.met .check { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }

.submit-btn {
    width: 100%; height: 52px; margin-top: 24px;
    border: none; border-radius: 13px; cursor: pointer;
    background: var(--bs-primary-500); color: #fff;
    font-family: inherit; font-size: 15.5px; font-weight: 700; letter-spacing: 0.01em;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    box-shadow: 0 2px 6px rgba(17, 24, 39, 0.10), 0 1px 2px rgba(17, 24, 39, 0.06);
    transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.submit-btn:hover { background: var(--bs-primary-600); box-shadow: 0 4px 10px rgba(17, 24, 39, 0.12), 0 1px 3px rgba(17, 24, 39, 0.07); }
.submit-btn:active { transform: translateY(1px); }

/* Remember-me + forgot-password row (login) */
.remember-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 16px; font-size: 13px;
}
.remember-row .remember {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--bs-gray-600); font-weight: 600; cursor: pointer;
}
.remember-row .remember input[type="checkbox"] {
    width: 16px; height: 16px; flex: none; accent-color: var(--bs-primary-500); cursor: pointer;
}
.remember-row a { color: var(--bs-secondary-600); font-weight: 700; text-decoration: none; }
.remember-row a:hover { text-decoration: underline; }

.legal { margin: 16px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--bs-gray-400); text-align: center; }
.legal a { color: var(--bs-secondary-600); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

.login-row {
    margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--bs-gray-100);
    text-align: center; font-size: 13.5px; color: var(--bs-gray-600);
}
.login-row a { color: var(--bs-secondary-600); font-weight: 700; text-decoration: none; }
.login-row a:hover { text-decoration: underline; }

/* ===== Brand-panel decorative glyph (reset / set-password) ==== */
/* Replaces the perks list on the forgot/set-password screens. Cream-panel
 * variant of the design's white-on-orange glyph: orange tint on cream. */
.bp-figure {
    margin: auto 0; position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center;
}
.bp-figure .glyph {
    width: 122px; height: 122px; border-radius: 32px;
    background: rgba(254, 98, 17, 0.10); color: var(--bs-primary-500);
    display: flex; align-items: center; justify-content: center;
    font-size: 50px; box-shadow: inset 0 0 0 1px rgba(254, 98, 17, 0.16);
}

/* ===== "Back to log in" link above the form title ============= */
.back-link {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: var(--bs-gray-600);
    text-decoration: none; margin-bottom: 22px;
}
.back-link:hover { color: var(--bs-primary-600); }
.back-link i { font-size: 11px; }

/* ===== Confirm-password match hint (set new password) ========= */
.match-hint {
    margin: 9px 2px 0; font-size: 12.5px; line-height: 1.4;
    display: none; align-items: center; gap: 7px;
}
.match-hint.show { display: flex; }
.match-hint.ok { color: #1f8a4c; }
.match-hint.bad { color: var(--bs-primary-600); }
.match-hint i { font-size: 12px; }

/* ===== Alt link row under the form (Remembered it? / Log in) == */
.alt-row {
    margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--bs-gray-100);
    text-align: center; font-size: 13.5px; color: var(--bs-gray-600);
}
.alt-row a { color: var(--bs-secondary-600); font-weight: 700; text-decoration: none; }
.alt-row a:hover { text-decoration: underline; }
.alt-row i { font-size: 11px; }

/* ===== Success / confirmation states ========================= */
/* (Check-your-inbox, Password updated.) In Django these are their own pages,
 * so — unlike the prototype's JS state-swap — they render directly. */
.success-state { text-align: center; }
.success-state .ok-badge {
    width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 20px;
    background: rgba(31, 138, 76, 0.12); color: #1f8a4c;
    display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.success-state h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--bs-gray-800); }
.success-state > p { margin: 11px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--bs-gray-600); }
.success-state .sent-to { font-weight: 700; color: var(--bs-gray-800); word-break: break-word; }
.success-state .resend { margin-top: 22px; font-size: 13px; color: var(--bs-gray-500); }
.success-state .resend a { color: var(--bs-secondary-600); font-weight: 700; text-decoration: none; }
.success-state .resend a:hover { text-decoration: underline; }

/* ===== Token-fail notice (expired/invalid reset link) ======== */
.auth-note {
    margin: 18px 0 0; padding: 14px 16px; border-radius: 12px;
    background: rgba(254, 98, 17, 0.07); border: 1px solid rgba(254, 98, 17, 0.18);
    font-size: 13.5px; line-height: 1.55; color: #7a3b14;
}

/* ===== Confirm-email page: email callout + escape link ======= */
.email-callout {
    display: flex; align-items: center; gap: 12px;
    margin-top: 22px; padding: 16px 18px;
    background: var(--bs-gray-50); border: 1.5px solid var(--bs-gray-100); border-radius: 14px;
}
.email-callout .ec-ico {
    width: 40px; height: 40px; flex: none; border-radius: 11px;
    background: rgba(254, 98, 17, 0.10); color: var(--bs-primary-500);
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.email-callout .ec-meta { min-width: 0; }
.email-callout .ec-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bs-gray-500); }
.email-callout .ec-addr { font-size: 15.5px; font-weight: 700; color: var(--bs-gray-800); margin-top: 2px; word-break: break-all; }
.deny-link { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--bs-gray-500); text-decoration: none; }
.deny-link:hover { color: var(--bs-primary-600); text-decoration: underline; }

/* ===== Email-verified page: badge + next-steps + ghost button = */
.verified-badge {
    width: 60px; height: 60px; border-radius: 50%; margin: 0 0 18px;
    background: rgba(31, 138, 76, 0.12); color: #1f8a4c;
    display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.next-steps { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.next-steps li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--bs-gray-600); }
.next-steps li .ns-ico {
    width: 34px; height: 34px; flex: none; border-radius: 10px;
    background: rgba(254, 98, 17, 0.10); color: var(--bs-primary-500);
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.verified-email { font-weight: 700; color: var(--bs-gray-800); word-break: break-all; }
/* ===== Responsive: mobile single column ====================== */
@media (max-width: 720px) {
    body.auth-page { background: #fff; }
    body.auth-page main > .container { align-items: stretch; }

    .auth-card {
        grid-template-columns: 1fr;
        max-width: 460px;
        min-height: 100vh;
        margin: 0 auto;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    .brand-panel { display: none; }

    .form-panel { padding: 0; justify-content: flex-start; }
    .form-panel .fp-inner { max-width: 100%; padding: 0 22px 40px; }

    /* compact branded header on top (Cream) */
    .mobile-brand {
        display: block;
        position: relative; overflow: hidden;
        padding: 48px 22px 26px;
        margin-bottom: 26px;
        border-bottom: 1px solid #f4ddcb;
        background: linear-gradient(160deg, #fff4ec 0%, #ffe9da 100%);
    }
    .mobile-brand::after {
        content: ""; position: absolute; right: -80px; top: -80px;
        width: 230px; height: 230px; border-radius: 50%; background: rgba(254, 98, 17, 0.05);
    }
    .mobile-brand::before {
        content: ""; position: absolute; right: 30px; bottom: -60px;
        width: 130px; height: 130px; border-radius: 50%; background: rgba(254, 98, 17, 0.05);
    }
    .mb-back {
        width: 36px; height: 36px; border-radius: 999px; margin: 0 0 14px -2px;
        border: none; background: rgba(254, 98, 17, 0.10); color: var(--bs-primary-600);
        font-size: 14px; cursor: pointer; position: relative; z-index: 2;
        display: flex; align-items: center; justify-content: center; text-decoration: none;
    }
    .mb-back:active { background: rgba(254, 98, 17, 0.18); }
    .mobile-brand .mb-brand { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
    .mobile-brand .mb-brand .mark {
        width: 38px; height: 38px; border-radius: 10px; background: #fff; overflow: hidden;
        display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
    }
    .mobile-brand .mb-brand .mark img { width: 100%; height: 100%; object-fit: contain; }
    .mobile-brand .mb-brand .wordmark {
        font-family: 'Black Ops One', system-ui, sans-serif;
        font-size: 19px; letter-spacing: 0.04em; color: var(--bs-primary-600);
    }
    .mobile-brand h2 {
        margin: 18px 0 0; font-size: 23px; font-weight: 800; line-height: 1.18; letter-spacing: -0.02em;
        color: #2a1206; position: relative; z-index: 1; text-wrap: balance; max-width: 18ch;
    }
    /* Corner glyph in the mobile header (key/shield/envelope per page),
       matching the mobile auth design's .ma-brand-glyph. */
    .mobile-brand .mb-figure {
        position: absolute; right: 22px; bottom: 18px; z-index: 1;
        width: 56px; height: 56px; border-radius: 16px;
        background: rgba(254, 98, 17, 0.12); color: var(--bs-primary-500);
        display: flex; align-items: center; justify-content: center; font-size: 24px;
    }
    .mobile-brand .mb-perks {
        margin: 15px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 7px;
        position: relative; z-index: 1;
    }
    .mobile-brand .mb-perks li {
        display: inline-flex; align-items: center; gap: 6px;
        background: rgba(254, 98, 17, 0.10); color: #5a3015; border-radius: 999px;
        padding: 5px 11px; font-size: 11.5px; font-weight: 600;
    }
    .mobile-brand .mb-perks li i { font-size: 9px; color: var(--bs-primary-500); }

    .auth-card .field input { font-size: 16px; }
    .fp-title { font-size: 22px; }
}
