/* ================================================================
   Circle Ledger — auth.css
   Auth page layouts: login, signup, forgot-password, reset-password.
   Uses Supabase Auth JWT flow (OTP for reset, no password_hash).
================================================================ */

/* ── Auth split layout (desktop branded panel — login, signup) ── */
.auth_split {
    display: flex;
    width: 100%;
    max-width: 58rem;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    min-height: 540px;
}
.auth_brand_panel {
    background: linear-gradient(160deg, var(--teal-950) 0%, var(--teal-800) 100%);
    width: 44%;
    flex-shrink: 0;
    padding: var(--space-12) var(--space-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth_brand_panel::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 30% 60%, rgba(245,158,11,.08) 0%, transparent 70%);
    pointer-events: none;
}
.auth_brand_logo {
    height: 1.75rem;
    margin-bottom: var(--space-10);
    position: relative;
}
.auth_brand_tagline {
    font-family: var(--font-display);
    font-size: clamp(var(--text-3xl), 2.5vw, var(--text-4xl));
    font-weight: 700; color: #fff; line-height: 1.2;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-7);
    position: relative;
}
.auth_brand_tagline .accent { color: var(--amber-300); }
.auth_brand_bullets {
    list-style: none;
    display: flex; flex-direction: column;
    gap: var(--space-3);
    position: relative;
}
.auth_brand_bullets li {
    display: flex; align-items: center; gap: var(--space-3);
    font-size: var(--text-md); color: var(--teal-200); line-height: 1.4;
}
.auth_brand_bullets li i { color: var(--amber-400); flex-shrink: 0; }
.auth_card_col {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    padding: var(--space-10) var(--space-8);
    overflow-y: auto;
}
.auth_split .auth_card {
    max-width: 100%; width: 100%;
    box-shadow: none; border: none;
    background: transparent; padding: 0; border-radius: 0;
}
@media (max-width: 768px) {
    .auth_split {
        flex-direction: column;
        max-width: var(--auth-max-w);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-md);
        min-height: auto;
    }
    .auth_brand_panel { display: none; }
    .auth_card_col { padding: var(--auth-py) var(--auth-px); }
    .auth_split .auth_card { padding: 0; }
}
@media (max-width: 480px) {
    .auth_split {
        border-radius: var(--radius-lg);
        box-shadow: none;
        border: none;
        background: transparent;
    }
    .auth_card_col { padding: var(--auth-sm-py) var(--auth-sm-px); }
}

/* ── Auth shell ── */
.auth_shell {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-4);
}

/* ── Auth card ── */
.auth_card {
    background: var(--surface);
    border: var(--border-thin) solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: var(--auth-max-w);
    padding: var(--auth-py) var(--auth-px);
    position: relative;
}
@media (max-width: 480px) {
    .auth_card {
        padding: var(--auth-sm-py) var(--auth-sm-px);
        border-radius: var(--radius-lg);
        box-shadow: none;
        border: none;
        background: transparent;
    }
}

/* ── Logo block ── */
.auth_logo {
    display: flex;
    align-items: center;
    gap: var(--auth-logo-gap);
    margin-bottom: var(--auth-logo-mb);
    justify-content: center;
}
.auth_logo img {
    height: var(--auth-logo-h);
}
.auth_logo_name {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--teal-900);
    letter-spacing: -0.03em;
}

/* ── Heading ── */
.auth_title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--teal-900);
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: var(--space-1-5);
    text-align: center;
}
.auth_subtitle {
    font-size: var(--text-md);
    color: var(--slate-500);
    text-align: center;
    line-height: 1.6;
    margin-bottom: var(--space-6);
}

/* ── Back link (top-left) ── */
.auth_back {
    position: absolute;
    top: var(--auth-back-top);
    left: var(--auth-back-left);
    display: flex;
    align-items: center;
    gap: var(--auth-back-gap);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--slate-500);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    padding: 0;
    transition: color var(--t);
    text-decoration: none;
}
.auth_back:hover { color: var(--teal-600); }
.auth_back i     { font-size: var(--icon-sm); }

/* ── Form ── */
.auth_form {}
.auth_form .form_group { margin-bottom: var(--space-5); }
.auth_form .btn_primary { margin-top: var(--space-2); }

/* ── Terms footer ── */
.auth_terms {
    font-size: var(--text-sm);
    color: var(--slate-400);
    text-align: center;
    margin-top: var(--auth-terms-mt);
    line-height: 1.6;
}
.auth_terms a {
    color: var(--teal-600);
    font-weight: 500;
    transition: color var(--t);
}
.auth_terms a:hover { color: var(--teal-800); text-decoration: underline; }

/* ── Switch link (login ↔ signup) ── */
.auth_switch {
    text-align: center;
    margin-top: var(--space-5);
    font-size: var(--text-md);
    color: var(--slate-500);
}
.auth_switch a,
.auth_switch button {
    color: var(--teal-600);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--text-md);
    padding: 0;
    transition: color var(--t);
}
.auth_switch a:hover,
.auth_switch button:hover { color: var(--teal-800); text-decoration: underline; }

/* ── Forgot password link ── */
.auth_forgot {
    font-size: var(--text-xl);
    color: var(--teal-600);
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    padding: 0;
    transition: color var(--t);
    text-align: right;
    display: block;
    margin-top: calc(-1 * var(--space-2));
    margin-bottom: var(--space-4);
}
.auth_forgot:hover { color: var(--teal-800); text-decoration: underline; }

/* ── OTP step ── */
.auth_otp_hint {
    font-size: var(--text-md);
    color: var(--slate-500);
    text-align: center;
    margin-bottom: var(--space-5);
    line-height: 1.6;
}
.auth_otp_hint strong { color: var(--slate-700); }
.auth_resend {
    text-align: center;
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    color: var(--slate-400);
}
.auth_resend button {
    color: var(--teal-600);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    padding: 0;
    transition: color var(--t);
}
.auth_resend button:hover { color: var(--teal-800); text-decoration: underline; }
.auth_resend button:disabled { color: var(--slate-400); cursor: not-allowed; pointer-events: none; }

/* ── Success confirmation block ── */
.auth_success {
    text-align: center;
    padding: var(--space-6) 0;
    font-size: var(--text-2xl);
}
.auth_success_icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--icon-3xl);
    margin: 0 auto var(--space-4);
}
.auth_success_title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--teal-900);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
}
.auth_success_text {
    font-size: var(--text-md);
    color: var(--slate-500);
    line-height: 1.6;
    margin-bottom: var(--space-6);
}

/* ── Join / pending approval page ── */
.join_status {
    text-align: center;
    padding: var(--space-8) 0;
}
.join_status_icon {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto var(--space-5);
}
.join_status_icon.pending  { background: var(--amber-100); color: var(--amber-600); }
.join_status_icon.approved { background: var(--green-100); color: var(--green-700); }
.join_status_icon.rejected { background: var(--red-100);   color: var(--red-700);   }

.join_status_title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--teal-900);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
}
.join_status_text {
    font-size: var(--text-md);
    color: var(--slate-500);
    line-height: 1.7;
    margin-bottom: var(--space-6);
    max-width: 24rem;
    margin-left: auto;
    margin-right: auto;
}

/* ── Signup step indicators ── */
.auth_steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}
.auth_step_dot {
    width: var(--space-2);
    height: var(--space-2);
    border-radius: 50%;
    background: var(--slate-200);
    transition: background var(--t), transform var(--t);
}
.auth_step_dot.active   { background: var(--teal-600); transform: scale(1.25); }
.auth_step_dot.complete { background: var(--green-600); }

/* Step visibility on mobile */
@media (max-width: 480px) {
    .auth_steps { margin-bottom: var(--space-8); }
    #step1, #step2, #step3 {
        animation: cl-fade-in .15s ease;
    }
}
/* ================================================================
   JOIN PAGE — code input and panel controls
   (moved from shared.css; join/index.html loads auth.css directly)
================================================================ */
.join_panel_actions { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-top: var(--space-5); }
.join_anon_buttons  { display: flex; flex-direction: column; gap: var(--space-3); }
.join_code_input    { letter-spacing: 0.12em; font-family: monospace; font-size: var(--text-xl); text-align: center; }
.join_code_display  { font-family: monospace; letter-spacing: 0.1em; }
.join_switch_mt     { margin-top: var(--space-5); }
.join_switch_mt_4   { margin-top: var(--space-4); }

/* ── Auth extras (reset flow, logo spacing) ── */
.auth_logo_mt        { margin-top: var(--space-8); }
.reset_code_display  { letter-spacing: 0.2em; font-size: var(--text-2xl); text-align: center; font-family: var(--font-display); }
.auth_resend_mt      { margin-top: var(--space-5); }
.reset_success_actions { display: flex; align-items: center; justify-content: center; gap: var(--space-2); }

/* ================================================================
   AUTH SCROLL-PAGE LAYOUT
   Used by login/index.html and signup/index.html.
   Full-page scroll: hero → value cards → form → footer.
   JS auto-scrolls to #authFormSection on load for UX;
   all content above stays in the DOM for SEO crawlers.
================================================================ */

/* ── Body modifier (no centering — the page scrolls) ── */
.auth_scroll_page {
    background: var(--teal-950);
    margin: 0; padding: 0;
}

/* ══════════════════════════════════════════════
   HERO SECTION
   Dark teal gradient, centered, text-heavy.
   Mirrors the brand panel aesthetic from the SVGs:
   dark teal bg (#0f3535 → #1a5454) + amber accent.
══════════════════════════════════════════════ */
.auth_hero {
    background: linear-gradient(160deg, var(--teal-950) 0%, var(--teal-800) 100%);
    position: relative;
    overflow: hidden;
    padding: var(--space-16) var(--space-6) var(--space-20);
    text-align: center;
}
.auth_hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 80%, rgba(245,158,11,.09) 0%, transparent 65%);
    pointer-events: none;
}
.auth_hero::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 4rem;
    background: linear-gradient(to bottom, transparent, var(--teal-50));
    pointer-events: none;
}
.auth_hero_inner {
    position: relative;
    max-width: 44rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
}
.auth_hero_logo {
    height: 2.25rem;
    width: auto;
}
.auth_hero_tagline {
    font-family: var(--font-display);
    font-size: clamp(var(--text-4xl), 5vw, 3rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.18;
    letter-spacing: -0.03em;
    margin: 0;
}
.auth_hero_accent {
    color: var(--amber-300);
}
.auth_hero_prose {
    font-size: clamp(var(--text-lg), 2vw, var(--text-xl));
    color: var(--teal-200);
    line-height: 1.7;
    max-width: 36rem;
    margin: 0;
}
.auth_hero_cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.875rem 2rem;
    border-radius: var(--radius-pill);
    background: var(--amber-400);
    color: var(--teal-900);
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: 700;
    text-decoration: none;
    transition: background .2s, transform .2s, box-shadow .2s;
    box-shadow: 0 var(--space-1) var(--space-4) rgba(245,158,11,.35);
    margin-top: var(--space-2);
}
.auth_hero_cta:hover {
    background: var(--amber-300);
    transform: translateY(-0.125rem);
    box-shadow: 0 var(--space-2) var(--space-6) rgba(245,158,11,.45);
}

/* ══════════════════════════════════════════════
   VALUE CARDS SECTION
   Light teal tint; 3-column card grid.
   Icon: rounded square matching favicon SVG aesthetic —
   dark teal gradient bg, white icon inside.
══════════════════════════════════════════════ */
.auth_value_section {
    background: var(--teal-50);
    padding: var(--space-16) var(--space-6) var(--space-12);
}
.auth_value_inner {
    max-width: 62rem;
    margin: 0 auto;
}
.auth_value_section_label {
    text-align: center;
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--teal-600);
    margin-bottom: var(--space-8);
}
.auth_value_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}
@media (max-width: 860px) {
    .auth_value_grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .auth_value_grid { grid-template-columns: 1fr; }
}
.auth_value_card {
    background: var(--surface);
    border: var(--border-thin) solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-7) var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.auth_value_card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-0.125rem);
}

/* Icon: rounded square mirroring the brand favicon SVG —
   dark teal gradient (#0f3535 → #1a5454) + white icon */
.auth_value_icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--teal-800) 0%, var(--teal-600) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    margin-bottom: var(--space-5);
    flex-shrink: 0;
    /* Subtle inner amber ring to echo the SVG amber accent circle */
    box-shadow: inset 0 0 0 0.125rem rgba(245,158,11,.25);
}
.auth_value_title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--teal-900);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-3);
    line-height: 1.25;
}
.auth_value_text {
    font-size: var(--text-md);
    color: var(--slate-500);
    line-height: 1.7;
    margin: 0;
}

/* ══════════════════════════════════════════════
   FORM SECTION
   Light background; horizontally centered form card.
   #authFormSection is the auto-scroll target.
══════════════════════════════════════════════ */
.auth_form_section {
    background: var(--bg);
    padding: var(--space-12) var(--space-4) var(--space-16);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth_form_inner {
    width: 100%;
    max-width: var(--auth-max-w);
}
.auth_form_section .auth_card {
    width: 100%;
    max-width: 100%;
}
@media (max-width: 480px) {
    .auth_form_section { padding: var(--space-8) var(--space-4) var(--space-12); }
}

/* ══════════════════════════════════════════════
   PAGE FOOTER
══════════════════════════════════════════════ */
.auth_page_footer {
    background: var(--bg);
    border-top: var(--border-thin) solid var(--border);
    padding: var(--space-6) var(--space-4);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--slate-400);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.auth_page_footer a {
    color: var(--teal-600);
    font-weight: 500;
    text-decoration: none;
    transition: color .2s;
}
.auth_page_footer a:hover { color: var(--teal-800); text-decoration: underline; }
.auth_page_footer_sep { color: var(--slate-300); }

/* ── Join page — group preview card (replaces renderGroupPreview inline styles) ── */
.group_preview_body { display: flex; align-items: flex-start; gap: var(--space-3); }
.group_preview_icon {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    background: var(--teal-600);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--icon-lg);
}
.group_preview_name { font-weight: 700; color: var(--teal-900); margin-bottom: var(--space-0-5); }
.group_preview_meta { font-size: var(--text-sm); color: var(--slate-500); }
.password_toggle {
    padding: var(--space-1); color: var(--teal-600);
    border-radius: var(--radius-sm); border: var(--border-thin) solid var(--surface);
    background: none; cursor: pointer; font-size: var(--icon-md); transition: color var(--t);
}
.password_toggle:hover { color: var(--teal-800); }

.password_toggle.visible {
    color: var(--teal-800);
    background: var(--teal-50);
}
