/*
 * Sign-in and password pages (resources/views/layouts/auth.blade.php):
 * "Direction A" of the sign-in redesign, in the homepage's family
 * (Unbounded headings, Plus Jakarta Sans text, navy + saffron + warm paper,
 * the adire pattern, the treasurer photo).
 * Light and dark follow the app's theme script (html[data-bs-theme]).
 */

.au-body {
    --bg: #fbf6ee;
    --card: #ffffff;
    --ink: #0f2042;
    --ink2: #3c4a66;
    --muted: #5d6981;
    --line: #ecdfcc;
    --field: #ffffff;
    --field-line: #8f826d;
    --navy: #0f2042;
    --navy-ink: #ffffff;
    --navy-ink2: rgba(255, 255, 255, .86);
    --saffron: #f2a33a;
    --saffron-ink: #0f2042;
    --peach: #fde9d2;
    --adire: #24316a;
    --focus: #2b4bd1;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --ok: #0f6b4f;
    --ok-soft: #e5f4ee;
    --info: #1f4b8f;
    --info-soft: #e8eefa;
    --warn: #8a4b00;
    --warn-soft: #fdf2e0;
    --shadow: 0 24px 50px -24px rgba(15, 32, 66, .35);
    --font-head: 'Unbounded', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

[data-bs-theme="dark"] .au-body {
    --bg: #0b1428;
    --card: #121d36;
    --ink: #f4efe6;
    --ink2: #c8cfdd;
    --muted: #a3adc1;
    --line: #22304f;
    --field: #0e1830;
    --field-line: #5b6b92;
    --navy: #060d1d;
    --navy-ink: #f4efe6;
    --navy-ink2: rgba(244, 239, 230, .86);
    --saffron: #f5b04f;
    --saffron-ink: #0b1428;
    --peach: #1f2740;
    --adire: #2f4091;
    --focus: #9db0ff;
    --danger: #ff8a80;
    --danger-soft: #3a1716;
    --ok: #6fd3ae;
    --ok-soft: #12302a;
    --info: #9db0ff;
    --info-soft: #17233f;
    --warn: #f0bd6a;
    --warn-soft: #33270f;
    --shadow: 0 24px 50px -24px rgba(0, 0, 0, .8);
}

[data-bs-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

.au-body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.au-body a { color: inherit; text-decoration-color: var(--saffron); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.au-body a:focus-visible,
.au-body button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }

/* ---------- Layout: navy panel left, paper stage right ---------- */
.au {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
}

.au-left {
    position: relative;
    overflow: hidden;
    background: var(--navy);
    color: var(--navy-ink);
    padding: 56px clamp(28px, 4.5vw, 64px);
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* The adire pattern (indigo resist-dye motifs), faint over the navy. */
.au-left::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .07;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='76'%3E%3Cg fill='none' stroke='%23f6dcb8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='19' cy='19' r='11'/%3E%3Ccircle cx='19' cy='19' r='5'/%3E%3Ccircle cx='57' cy='57' r='11'/%3E%3Ccircle cx='57' cy='57' r='5'/%3E%3Cpath d='M46 10h22M46 19h22M46 28h22M8 48h22M8 57h22M8 66h22'/%3E%3C/g%3E%3Cg fill='%23f6dcb8'%3E%3Ccircle cx='57' cy='19' r='2.4'/%3E%3Ccircle cx='19' cy='57' r='2.4'/%3E%3C/g%3E%3C/svg%3E");
}

.au-intro, .au-more { position: relative; display: flex; flex-direction: column; gap: 22px; }
.au-more { flex: 1; }
.au-more:empty { display: none; }

.au-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.au-mark {
    width: 48px; height: 48px; flex: 0 0 auto;
    border-radius: 14px;
    background: var(--saffron); color: var(--saffron-ink);
    display: grid; place-items: center;
    font: 600 20px/1 var(--font-head);
}
.au-brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.au-name { font: 600 20px/1.2 var(--font-head); letter-spacing: -.01em; overflow-wrap: anywhere; }
.au-sub { font-size: 14px; color: var(--navy-ink2); }
.au-mini { display: none; }

.au-eyebrow {
    align-self: flex-start;
    padding: 7px 12px;
    border-radius: 999px;
    font: 700 12px/1 var(--font-body);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--saffron);
    border: 1px solid var(--saffron);
}

.au-intro h1 {
    margin: 0;
    max-width: 620px;
    font: 600 clamp(30px, 3.1vw, 40px)/1.12 var(--font-head);
    letter-spacing: -.03em;
    text-wrap: balance;
}

.au-lede { margin: 0; max-width: 560px; font-size: 17px; color: var(--navy-ink2); }

.au-ticks { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; max-width: 600px; }
.au-ticks li { display: flex; gap: 12px; }
.au-tick {
    flex: 0 0 24px; height: 24px; margin-top: 1px;
    border-radius: 50%;
    background: var(--saffron); color: var(--saffron-ink);
    display: grid; place-items: center;
}

.au-back {
    margin-top: auto;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .14);
}
.au-back a { font-weight: 700; color: var(--navy-ink); min-height: 44px; display: inline-flex; align-items: center; }

.au-main {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 260px clamp(20px, 3vw, 40px) 56px;
    background: var(--bg);
}

/* The treasurer in her arch, peeking out behind the card. */
.au-photo { position: absolute; top: 48px; right: clamp(24px, 4vw, 56px); width: 250px; height: 340px; }
.au-photo figure {
    position: absolute; inset: 0; margin: 0;
    border-radius: 116px 116px 26px 26px;
    overflow: hidden;
    border: 6px solid var(--navy-ink);
    background: var(--peach);
}
[data-bs-theme="dark"] .au-photo figure { border-color: #1b2744; }
.au-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.au-swatch {
    position: absolute; left: -26px; bottom: -22px;
    width: 150px; height: 130px;
    border-radius: 22px;
    background-color: var(--adire);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='38'%3E%3Cg fill='none' stroke='%23f6dcb8' stroke-width='1.4' stroke-linecap='round'%3E%3Ccircle cx='9.5' cy='9.5' r='5.5'/%3E%3Ccircle cx='28.5' cy='28.5' r='5.5'/%3E%3Cpath d='M23 5h11M23 9.5h11M23 14h11M4 24h11M4 28.5h11M4 33h11'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- The form card ---------- */
.au-card {
    position: relative;
    width: 100%;
    max-width: 470px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: clamp(28px, 3vw, 44px);
    box-shadow: var(--shadow);
}

.au-card h2 { margin: 0; font: 600 28px/1.15 var(--font-head); letter-spacing: -.02em; text-wrap: balance; }
.au-card .au-copy { margin: 10px 0 0; color: var(--ink2); }

.au-form { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
.au-field { display: flex; flex-direction: column; gap: 8px; }
.au-field label { font-weight: 700; font-size: 15px; }
.au-field input {
    height: 52px;
    width: 100%;
    border-radius: 14px;
    border: 1.5px solid var(--field-line);
    background: var(--field);
    color: var(--ink);
    font: 500 16px/1 var(--font-body);
    padding: 0 16px;
}
.au-field input::placeholder { color: var(--muted); opacity: 1; }
.au-field input:focus { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
.au-field input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.au-error { display: flex; align-items: flex-start; gap: 6px; font-size: 14px; font-weight: 700; color: var(--danger); }
.au-error svg { flex: 0 0 auto; margin-top: 3px; }

/* "Remember me" and "I forgot my password" on one line with room between them. */
.au-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px; }
.au-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--ink2); cursor: pointer; }
.au-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); }
[data-bs-theme="dark"] .au-check input { accent-color: var(--saffron); }
.au-link { font-size: 15px; font-weight: 700; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }

.au-btn {
    height: 56px;
    width: 100%;
    border: 0;
    border-radius: 16px;
    background: var(--saffron);
    color: var(--saffron-ink);
    font: 700 17px/1 var(--font-body);
    cursor: pointer;
}
.au-btn:hover { filter: brightness(.96); }

.au-details { margin: 18px 0 0; }
.au-details summary { cursor: pointer; }
.au-details .au-copy { margin-top: 6px; font-size: 15px; }
.au-foot { margin: 22px 0 0; font-size: 15px; }
.au-foot a { font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }

/* The password pages' message, set as the card's lead. */
.au-msg { margin: 0; font: 600 20px/1.35 var(--font-head); letter-spacing: -.01em; text-wrap: balance; }

/* For screen readers only. */
.au-vh {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* Messages (the shared flash partial and session status). */
.au-card .alert {
    position: relative;
    margin: 0 0 18px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-size: 15px;
}
.au-card .alert-success { background: var(--ok-soft); color: var(--ok); border-color: currentColor; }
.au-card .alert-danger { background: var(--danger-soft); color: var(--danger); border-color: currentColor; }
.au-card .alert-warning { background: var(--warn-soft); color: var(--warn); border-color: currentColor; }
.au-card .alert-info { background: var(--info-soft); color: var(--info); border-color: currentColor; }
.au-card .alert .btn-close { display: none; }
.au-card [data-flash-messages] { margin-bottom: 4px; }

/* ---------- Phone and narrow screens: header, form, then the reading text ---------- */
@media (max-width: 900px) {
    .au { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "main" "more"; }
    .au-left { display: contents; }
    .au-left::before { display: none; }

    .au-intro {
        grid-area: intro;
        position: relative;
        overflow: hidden;
        background-color: var(--navy);
        color: var(--navy-ink);
        padding: 24px 20px 92px;
        gap: 14px;
    }
    .au-intro::before {
        content: '';
        position: absolute;
        inset: 0;
        opacity: .07;
        pointer-events: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cg fill='none' stroke='%23f6dcb8' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='14' cy='14' r='8'/%3E%3Ccircle cx='14' cy='14' r='3.5'/%3E%3Ccircle cx='42' cy='42' r='8'/%3E%3Ccircle cx='42' cy='42' r='3.5'/%3E%3Cpath d='M34 7h16M34 14h16M34 21h16M6 35h16M6 42h16M6 49h16'/%3E%3C/g%3E%3C/svg%3E");
    }
    .au-intro > * { position: relative; }
    .au-brand { gap: 12px; margin-bottom: 4px; }
    .au-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; }
    .au-name { font-size: 16px; }
    .au-sub { font-size: 13px; }
    .au-mini {
        display: block;
        margin: 0 0 0 auto;
        width: 54px; height: 72px; flex: 0 0 auto;
        border-radius: 27px 27px 10px 10px;
        overflow: hidden;
        border: 3px solid var(--navy-ink);
    }
    .au-mini img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
    .au-eyebrow { font-size: 11px; padding: 6px 10px; }
    .au-intro h1 { font-size: 23px; line-height: 1.18; letter-spacing: -.02em; }

    .au-main { grid-area: main; padding: 0 16px; align-items: stretch; background: transparent; margin-top: -72px; }
    .au-photo { display: none; }
    .au-card { max-width: none; border-radius: 24px; padding: 26px 22px 28px; }
    .au-card h2 { font-size: 22px; line-height: 1.2; }
    .au-form { gap: 18px; margin-top: 22px; }
    .au-row { flex-direction: column; align-items: flex-start; gap: 2px; }

    .au-more { grid-area: more; padding: 32px 22px 36px; gap: 16px; font-size: 15px; color: var(--ink2); }
    .au-more .au-lede { font-size: 15px; color: var(--ink2); }
    .au-more .au-ticks { gap: 12px; margin: 0; }
    .au-back { border-top: 0; padding-top: 0; margin-top: 8px; }
    .au-back a { color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
