/* Admin auth pages — temple branding (maroon + gold), matching the
   public/devotee site's design language (Poppins body, Cinzel display).

   The login page is a full free-flowing page (dark hero band + curved
   white card with a two-column intro/form panel), mirroring the devotee
   portal's Login.tsx. The other auth pages (forgot / reset / setup) keep
   the simpler centered-card layout. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
    --clr-maroon:    #7B1F1F;
    --clr-maroon-dk: #5a1515;
    --clr-gold:      #c8922a;
    --clr-gold-lt:   #f5e6c8;
    --clr-text:      #2d2d2d;
    --clr-muted:     #6b6b6b;
    --font-body:     'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display:  'Cinzel', 'Georgia', serif;
}

body {
    font-family: var(--font-body);
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--clr-text);
    background: #F0E8DF;
}

/* ============================================================
   LOGIN PAGE — free-flowing layout (body.login-page)
   ============================================================ */

/* ── Dark hero band (mirrors the devotee portal's .page-hero) ── */
.login-page { background: #F0E8DF; }
.page-hero {
    position: relative;
    background: linear-gradient(165deg, #2a0c0b 0%, var(--clr-maroon-dk) 45%, #3d1110 100%);
    padding: calc(clamp(56px, 7vw, 88px) + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 32px) clamp(72px, 8vw, 110px);
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .05;
    background-image: radial-gradient(circle, #fff 1px, transparent 1.6px);
    background-size: 22px 22px;
    pointer-events: none;
}
.page-hero__inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}
.page-hero__kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #f0cf8e;
    margin: 0 0 10px;
}
.page-hero__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(28px, 4.4vw, 42px);
    line-height: 1.15;
    color: #fff;
    margin: 0;
}
.page-hero__desc {
    font-size: clamp(13.5px, 1.6vw, 15px);
    color: rgba(255, 255, 255, .75);
    max-width: 560px;
    margin: 12px auto 0;
    line-height: 1.6;
}
.page-hero__status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin: 18px 0 0;
}
.page-hero__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.page-hero__dot.is-open { background: #6ee08c; box-shadow: 0 0 0 4px rgba(110, 224, 140, .2); }

/* ── White content card riding up over the hero's bottom edge ── */
.page-card {
    background: #fff;
    position: relative;
    margin-top: clamp(-70px, -6vw, -44px);
    border-radius: clamp(28px, 5vw, 56px) 0 0 0;
    box-shadow: 0 -22px 44px rgba(30, 10, 6, .12);
    min-height: calc(100vh - 140px);
    padding-bottom: 24px;
}

/* ── Two-column free-flowing panel: intro + form card ── */
.auth-panel {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(30px, 5vw, 60px) clamp(20px, 4vw, 36px) clamp(40px, 6vw, 64px);
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(34px, 6vw, 84px);
    align-items: center;
    overflow: hidden;
}
@media (max-width: 900px) {
    .auth-panel { grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: stretch; }
    /* Stacked on a phone, the form is what the admin came for. */
    .auth-panel .auth-form-col { order: -1; }
}
@media (max-height: 760px) and (min-width: 901px) {
    .auth-panel { padding-top: 32px; align-items: start; }
}

/* Soft blurred color washes behind the two columns */
.auth-panel::before,
.auth-panel::after {
    content: '';
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}
.auth-panel::before {
    width: clamp(260px, 32vw, 420px);
    height: clamp(260px, 32vw, 420px);
    left: clamp(-140px, -8vw, -60px);
    top: -10%;
    background: radial-gradient(circle, rgba(123, 31, 31, .10), rgba(123, 31, 31, 0) 70%);
}
.auth-panel::after {
    width: clamp(220px, 26vw, 360px);
    height: clamp(220px, 26vw, 360px);
    right: clamp(-120px, -6vw, -40px);
    bottom: -8%;
    background: radial-gradient(circle, rgba(200, 146, 42, .14), rgba(200, 146, 42, 0) 70%);
}
.auth-intro, .auth-form-col { position: relative; z-index: 1; }

/* Left column — free-flowing intro */
.auth-intro__logo {
    width: 64px; height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 2px solid var(--clr-gold);
    box-shadow: 0 6px 18px rgba(123, 31, 31, .18);
    margin-bottom: 16px;
    display: block;
}
.auth-intro__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(22px, 3vw, 30px);
    color: var(--clr-maroon);
    margin: 0 0 12px;
    line-height: 1.25;
}
.auth-intro__text {
    font-size: 14.5px;
    color: #3a3a3a;
    line-height: 1.8;
    margin: 0 0 22px;
}
.auth-intro__features {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.auth-intro__features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.auth-intro__feat-icon {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: 16px 6px 16px 6px;
    background: linear-gradient(135deg, #fdf0ec, #fbe3d8);
    color: var(--clr-maroon);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}
.auth-intro__features strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 2px;
}
.auth-intro__features li div span {
    display: block;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.6;
}
.auth-intro__note {
    font-size: 13px;
    color: #6b6b6b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.6;
}
.auth-intro__note i { color: var(--clr-gold); flex-shrink: 0; }

/* Right column — the form floats as its own soft, elevated card */
.auth-form-col { min-width: 0; }
.auth-form-col .auth-form-body {
    padding: clamp(28px, 4vw, 40px);
    background: #fffdfb;
    border-radius: 24px;
    border: 1px solid rgba(200, 146, 42, .14);
    box-shadow: 0 22px 50px rgba(123, 31, 31, .10), 0 2px 10px rgba(123, 31, 31, .05);
    animation: card-in 0.45s ease-out;
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-form-heading {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--clr-maroon);
    margin: 0 0 4px;
}
.auth-form-heading::after {
    content: '';
    display: block;
    width: 44px; height: 4px;
    background: linear-gradient(90deg, var(--clr-gold), var(--clr-maroon));
    border-radius: 999px;
    margin-top: 10px;
}
.auth-form-sub {
    font-size: 12.5px;
    color: #888;
    line-height: 1.6;
    margin: 14px 0 22px;
}
.auth-inline-link {
    color: var(--clr-maroon);
    text-decoration: none;
    font-weight: 600;
}
.auth-inline-link:hover { text-decoration: underline; }

.auth-field { margin-bottom: 18px; }
.auth-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    margin-bottom: 6px;
}
.auth-label span { color: #dc3545; margin-left: 2px; }
.auth-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font-size: 15px;
    font-family: inherit;
    color: #212529;
    background: #faf8f5;
    border: 1px solid #ece2d6;
    border-radius: 12px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-input:focus {
    background: #fff;
    border-color: var(--clr-gold);
    box-shadow: 0 0 0 4px rgba(200, 146, 42, .14);
}
.auth-input::placeholder { color: #adb5bd; }
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-input:-webkit-autofill:active {
    -webkit-text-fill-color: #212529;
    caret-color: #212529;
    -webkit-box-shadow: 0 0 0 1000px #faf8f5 inset;
    box-shadow: 0 0 0 1000px #faf8f5 inset;
    transition: background-color 600000s ease-in-out 0s;
}

.pw-wrap { position: relative; }
.pw-wrap .auth-input { padding-right: 48px; }
.pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #4A4036;
    cursor: pointer;
    padding: 9px 11px;
    font-size: 18px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.pw-toggle:hover { color: var(--clr-maroon); background: rgba(123, 31, 31, 0.06); }

.auth-btn-primary {
    display: block;
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #7B1F1F 0%, #9B3030 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: .3px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(123, 31, 31, .22);
    transition: background .15s, box-shadow .15s, transform .1s;
    margin-top: 6px;
}
.auth-btn-primary:hover {
    background: linear-gradient(135deg, #5a1515 0%, #7B1F1F 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(123, 31, 31, .3);
}
.auth-btn-primary:active { transform: translateY(0); }
.auth-btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.forgot-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--clr-maroon);
    text-decoration: none;
    transition: color 0.15s;
}
.forgot-link:hover { color: var(--clr-gold); text-decoration: underline; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 22px;
    color: #a3978c;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ece4dc;
}

.auth-google-btn {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Flash messages inside the form card */
.flash {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
}
.flash-info    { background: #FBF3E7; border-color: #EAD9B5; color: #7B1F1F; }
.flash-success { background: #F0FDF4; border-color: #BBF7D0; color: #166534; }
.flash-danger, .flash-error { background: #FEF2F2; border-color: #FCA5A5; color: #991B1B; }
.flash-warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }

/* Small helper line under a field (setup page's username hint) */
.auth-field-help {
    margin-top: 6px;
    font-size: 12px;
    color: #8a8275;
}

/* "Remembered it? Back to Sign In" line under the form */
.auth-new-account {
    font-size: 13.5px;
    color: #555;
    margin: 20px 0 0;
    text-align: center;
}

/* Centered heading + icon badge (the "check your email" sent state) */
.auth-form-heading--center { text-align: center; }
.auth-form-heading--center::after { margin-left: auto; margin-right: auto; }
.auth-form-icon-badge {
    width: 56px; height: 56px;
    margin: 0 auto 18px;
    border-radius: 20px 8px 20px 8px;
    background: linear-gradient(135deg, #fdf0ec, #fbe3d8);
    color: var(--clr-maroon);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.auth-form-icon-badge--sent {
    background: linear-gradient(135deg, #eafbf0, #d9f5e3);
    color: #1e8a4c;
}
.auth-sent { text-align: center; }
.auth-sent__msg {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    margin: 18px 0 0;
}
.auth-sent__msg--muted { color: #8a8275; font-size: 13px; margin-top: 8px; margin-bottom: 20px; }
.auth-sent__msg strong { color: var(--clr-maroon); }

/* Numbered "how recovery works" steps — connecting rule so the three read
   as one sequence (mirrors the devotee portal's auth-steps). */
.auth-steps {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.auth-steps li {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.auth-steps li:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: -18px;
    width: 2px;
    background: linear-gradient(#f0d9c8, rgba(240, 217, 200, 0));
}
.auth-steps__num {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--clr-maroon), #a33232);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-steps strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 2px;
}
.auth-steps li div span {
    display: block;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.6;
}

/* Help note with contact info (forgot-password left column) */
.auth-help-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #FBF3E7;
    border: 1px solid #EAD9B5;
    border-radius: 8px 16px 8px 8px;
    padding: 14px 16px;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.7;
}
.auth-help-note > i { color: var(--clr-maroon); font-size: 17px; margin-top: 2px; flex-shrink: 0; }
.auth-help-note strong { display: block; color: var(--clr-maroon); font-weight: 600; margin-bottom: 2px; }
.auth-help-note a { color: var(--clr-maroon); font-weight: 600; text-decoration: none; }
.auth-help-note a:hover { text-decoration: underline; }

/* Page footer under the panel */
.page-foot {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 36px) 26px;
    text-align: center;
}
.page-foot p {
    margin: 0;
    font-size: 12px;
    color: #8a8275;
    line-height: 1.7;
}
.page-foot i { color: var(--clr-gold); margin-right: 4px; }
.page-foot a { color: var(--clr-maroon); font-weight: 600; text-decoration: none; }
.page-foot a:hover { text-decoration: underline; }

/* Short laptop screens: tighten the hero so the form is above the fold */
@media (max-height: 760px) and (min-width: 769px) {
    .page-hero { padding-top: calc(48px + env(safe-area-inset-top, 0px)); padding-bottom: 84px; }
    .page-hero__title { font-size: clamp(26px, 3.2vw, 34px); }
}

/* ============================================================
   SIMPLE AUTH PAGES (forgot / reset / setup) — centered card
   on the warm maroon backdrop, same branding as login.
   ============================================================ */
body.auth-simple {
    background:
        radial-gradient(circle at 12% 20%, rgba(200, 146, 42, 0.16) 0%, transparent 42%),
        radial-gradient(circle at 88% 82%, rgba(155, 48, 48, 0.28) 0%, transparent 46%),
        linear-gradient(135deg, #4a0f0f 0%, #5a1515 45%, #7B1F1F 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
    position: relative;
}
body.auth-simple::before, body.auth-simple::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}
body.auth-simple::before { width: 340px; height: 340px; top: -90px; right: -90px; }
body.auth-simple::after  { width: 240px; height: 240px; bottom: -70px; left: -70px; }

.login-shell {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}
.login-card {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: card-in 0.45s ease-out;
}
.login-header {
    background:
        linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.05)),
        linear-gradient(135deg, #5a1515 0%, #7B1F1F 60%, #9B3030 100%);
    color: #fff;
    padding: 36px 36px 32px;
    text-align: center;
    position: relative;
}
.login-header::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 16px;
    transform: translateX(-50%);
    width: 64px; height: 4px;
    background: var(--clr-gold);
    border-radius: 2px;
}
.temple-mark {
    display: block;
    width: 84px;
    height: 84px;
    margin: 0 auto 14px;
    background: #fff;
    border: 3px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    /* emoji fallback (div.temple-mark with an emoji) */
    font-size: 40px;
    line-height: 78px;
    text-align: center;
}
.login-header h1 {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.login-header .subtitle {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    opacity: 0.92;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}
.login-body { padding: 30px 32px 28px; }

/* Legacy form classes used by forgot/reset/setup templates */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--clr-maroon);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 7px;
}
.form-input {
    width: 100%;
    font-family: inherit;
    font-size: 16px;
    color: #1A1A1A;
    background: #FAF6F1;
    border: 2px solid #EEE4DA;
    border-radius: 12px;
    padding: 14px 16px;
    outline: none;
    transition: all 0.15s;
}
.form-input:focus {
    background: #fff;
    border-color: var(--clr-maroon);
    box-shadow: 0 0 0 4px rgba(123, 31, 31, 0.15);
}
.form-input::placeholder { color: #8A8275; }
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #1A1A1A;
    -webkit-box-shadow: 0 0 0 1000px #FAF6F1 inset;
    box-shadow: 0 0 0 1000px #FAF6F1 inset;
    transition: background-color 600000s 0s, color 600000s 0s;
}
.btn-signin {
    width: 100%;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #fff;
    background: linear-gradient(135deg, #7B1F1F 0%, #9B3030 100%);
    border: none;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(123, 31, 31, 0.35);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    margin-top: 6px;
}
.btn-signin:hover {
    background: linear-gradient(135deg, #5a1515 0%, #7B1F1F 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(123, 31, 31, 0.45);
}
.btn-signin:active { transform: translateY(0); }

.login-footer {
    background: #FAF6F1;
    border-top: 1px solid #F0E8E0;
    padding: 16px 32px;
    text-align: center;
}
.login-footer p {
    margin: 0;
    font-size: 12px;
    color: #4A4036;
    line-height: 1.6;
}
.login-footer i { color: var(--clr-gold); margin-right: 4px; }

/* Lead/hint/back-link used by simple auth pages */
.lead-text {
    font-size: 13.5px;
    color: #555;
    line-height: 1.65;
    margin: 0 0 20px;
}
.hint-text {
    font-size: 12px;
    color: #4A4036;
    line-height: 1.6;
    text-align: center;
    margin: 16px 0 0;
}
.hint-text strong { color: var(--clr-maroon); font-weight: 700; }
.back-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--clr-maroon);
    text-decoration: none;
    transition: color 0.15s;
}
.back-link:hover { color: var(--clr-gold); text-decoration: underline; }

/* Password policy list (reset/setup pages) */
.policy-list {
    list-style: none;
    padding: 12px 14px;
    margin: 0 0 16px;
    background: #FAF6F1;
    border: 1px solid #F0E8E0;
    border-radius: 10px;
    font-size: 12px;
    color: #4A4036;
    line-height: 1.7;
}
.policy-list li::before {
    content: '✓';
    color: var(--clr-gold);
    font-weight: 700;
    margin-right: 8px;
}

/* Password strength bar */
.strength-track {
    margin-top: 8px;
    height: 4px;
    background: #EEE4DA;
    border-radius: 2px;
    overflow: hidden;
}
.strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.25s, background 0.25s;
}
.strength-label {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    min-height: 14px;
}

/* ── Simple pages: scroll instead of clipping on small/short screens ── */
@media (max-height: 720px), (max-width: 480px) {
    body.auth-simple { align-items: flex-start; }
    .login-header { padding: 28px 24px 22px; }
    .temple-mark { width: 68px; height: 68px; line-height: 62px; font-size: 34px; margin-bottom: 12px; }
    .login-header h1 { font-size: 20px; }
    .login-body { padding: 24px 22px 20px; }
    .login-footer { padding: 14px 22px; }
}
@media (max-width: 400px) {
    .login-body { padding: 22px 18px 20px; }
    .login-header { padding: 26px 18px 22px; }
    .login-footer { padding: 14px 18px; }
}
