/* ════════════════════════════════════════
   AUTH PAGES — full-page photo with twinkling stars, landing-page colors
   Login/register/forgot/reset/verify all use auth/_layout.html.
   50/50 split: form column on the left, headline + trust copy on the right.

   Clear look, no theme: auth pages ignore light/dark (html[data-theme]) and
   always render the same. The form column is fully transparent over the photo
   with white text; only a faint dark shade and text shadow keep it readable.
════════════════════════════════════════ */

.au-page {
    /* Fixed colors: set here so theme.css light/dark values do not apply. */
    --ink: #ffffff;
    --muted: rgba(241, 245, 249, 0.9);
    --line: rgba(255, 255, 255, 0.35);
    --brand-soft: rgba(147, 197, 253, 0.15);
    --au-panel: 7, 13, 26;
    --au-placeholder: rgba(226, 232, 240, 0.75);
    --au-input-bg: rgba(255, 255, 255, 0.06);
    --au-input-focus: rgba(255, 255, 255, 0.12);
    /* Brand blue is too dark on the photo; use its lighter tint for links and icons. */
    --au-accent: #93c5fd;
    --au-menu-bg: rgba(15, 23, 42, 0.97);
    --au-error-bg: rgba(239, 68, 68, 0.2);
    --au-error-line: rgba(248, 113, 113, 0.55);
    --au-error-ink: #fecaca;
    --au-success-bg: rgba(34, 197, 94, 0.2);
    --au-success-line: rgba(74, 222, 128, 0.55);
    --au-success-ink: #bbf7d0;
    --auth-ink: var(--ink);
    --auth-muted: var(--muted);
    --auth-line: rgba(255, 255, 255, 0.6);
    --auth-primary: var(--au-accent);
    --auth-input: var(--au-input-bg);
    --auth-surface: var(--au-menu-bg);
    --au-shade: 7, 13, 26;
    --au-photo-ink: #ffffff;
    --au-photo-muted: #ffffff;
    /* No panel behind the right-side copy; a soft shadow keeps it readable on the photo. */
    --au-copy-shadow: 0 1px 3px rgba(2, 6, 23, 0.8), 0 0 16px rgba(2, 6, 23, 0.6);
    --au-text-shadow: 0 1px 2px rgba(2, 6, 23, 0.7), 0 0 12px rgba(2, 6, 23, 0.5);
    --au-star: #ffffff;
    --au-star-glow: rgba(191, 219, 254, 0.85);
    --au-heading: "Roboto Slab", var(--font-heading);
    /* Key phrase in headings: landing-page brand blue, one step lighter so it reads on the dark photo. */
    --au-heading-accent: #3b82f6;
    background: #070d1a;
    color: var(--ink);
    color-scheme: dark;
    font-family: var(--font-body);
    min-height: 100vh;
}

/* ── Background photo + star field ───────── */
.au-bg {
    /* Bottom shade sits under the right-hand headline; side shade darkens the copy column. */
    background:
        linear-gradient(180deg, rgba(var(--au-shade), 0.45) 0%, rgba(var(--au-shade), 0) 20%, rgba(var(--au-shade), 0) 45%, rgba(var(--au-shade), 0.55) 75%, rgba(var(--au-shade), 0.85) 100%),
        linear-gradient(270deg, rgba(var(--au-shade), 0.35) 0%, rgba(var(--au-shade), 0.08) 45%, rgba(var(--au-shade), 0) 60%),
        url("/static/img/auth/auth-bg.jpg") center / cover no-repeat;
    inset: 0;
    position: fixed;
    z-index: 0;
}

.au-starfield {
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    z-index: 0;
}

/* Four-point sparkle; glints are small round dots. Each twinkles on a 1s cycle. */
.au-star {
    animation: au-twinkle 1s ease-in-out infinite;
    animation-delay: var(--d, 0s);
    background: var(--au-star);
    clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
    height: var(--s, 10px);
    opacity: 0.15;
    position: absolute;
    width: var(--s, 10px);
}

.au-star--glint {
    border-radius: 50%;
    box-shadow: 0 0 6px 1px var(--au-star-glow);
    clip-path: none;
}

@keyframes au-twinkle {
    0%,
    100% {
        opacity: 0.15;
        transform: scale(0.55) rotate(0deg);
    }

    50% {
        opacity: 0.95;
        transform: scale(1) rotate(45deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .au-star {
        animation: none;
        opacity: 0.5;
    }
}

/* ── Layout ──────────────────────────────── */
.au-layout {
    display: grid;
    /* 40% form, 60% photo. */
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    /* The page itself scrolls when a form is taller than the screen (never an inner
       scrollbar, which showed as a line down the middle of the page). */
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    z-index: 1;
}

.au-main {
    display: flex;
    flex-direction: column;
    padding: 2rem clamp(1.5rem, 5vw, 4rem);
    /* Above the right column's shade, which reaches into this column to blend the seam. */
    position: relative;
    z-index: 1;
}

.au-top {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    margin-bottom: auto;
    min-height: 2.5rem;
}

/* Right: headline + trust copy on the photo, anchored bottom-right and pinned while the page scrolls. */
.au-copy {
    align-items: flex-end;
    align-self: start;
    color: var(--au-photo-ink);
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    justify-content: space-between;
    padding: 2rem clamp(1.5rem, 4vw, 3.5rem) clamp(1.5rem, 6vh, 3.5rem);
    position: sticky;
    text-shadow: var(--au-copy-shadow);
    top: 0;
}

.au-copy__text {
    max-width: 28rem;
}

.au-copy__text h2 {
    font-family: var(--au-heading);
    font-size: clamp(1.8rem, 2.6vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

.au-copy__text p {
    color: var(--au-photo-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.au-trust {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.au-trust li {
    align-items: center;
    display: flex;
    font-size: 0.92rem;
    font-weight: 500;
    gap: 0.65rem;
}

.au-trust li::before {
    background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E") center / 0.7rem no-repeat;
    border-radius: 50%;
    content: "";
    flex: none;
    height: 1.25rem;
    width: 1.25rem;
}

/* ── Back link ───────────────────────────── */
.au-back {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.au-back:hover {
    color: var(--brand);
}

.au-copy .au-back {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(2, 6, 23, 0.6);
}

.au-copy .au-back:hover {
    color: #bfdbfe;
}

.au-back--mobile {
    display: none;
}

/* ── Form (landing-page type and buttons) ── */
.au-form {
    margin: 0 auto auto;
    max-width: 24rem;
    padding: clamp(1rem, 5vh, 3rem) 0;
    width: 100%;
}

.au-form--wide {
    max-width: 28rem;
}

.au-form__head {
    margin-bottom: clamp(1rem, 3vh, 1.75rem);
    text-align: center;
}

.au-logo {
    color: var(--ink);
    display: inline-block;
    font-family: var(--au-heading);
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.45rem;
    text-decoration: none;
}

/* Landing-page heading style: Roboto Slab, ink text, key phrase in brand blue. */
.au-title {
    color: var(--ink);
    font-family: var(--au-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0;
}

.au-subtitle {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
    margin: 0.4rem 0 0;
}

.au-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.au-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.au-link {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

.au-link:hover {
    text-decoration: underline;
}

/* Same as the landing page's primary button ("Get started"). */
.au-btn {
    background: var(--brand);
    border: 0;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
    align-items: center;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-family: var(--au-heading);
    gap: 0.55rem;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 0.4rem;
    padding: 0.85rem 1rem;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    transition: background 0.2s ease, transform 0.1s ease;
    width: 100%;
}

.au-btn:hover {
    background: var(--brand-dark);
}

.au-btn__icon {
    flex: none;
    height: 1.05rem;
    width: 1.05rem;
}

.au-btn:active {
    transform: translateY(1px);
}

.au-btn:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.au-btn:disabled {
    cursor: wait;
    opacity: 0.75;
}

.au-foot {
    color: var(--muted);
    font-size: 0.88rem;
    margin: 0;
    text-align: center;
}

/* ── Reference-format pieces ─────────────── */
.au-sr {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* Input with a leading icon; the placeholder carries the label text. */
.au-input {
    position: relative;
}

.au-input__icon {
    color: var(--brand);
    height: 1.1rem;
    left: 0.9rem;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    z-index: 1;
}

.au-page .au-main .au-input .form-input {
    padding-left: 2.7rem;
}

.au-note {
    color: var(--muted);
    font-size: 0.8rem;
    margin: -0.2rem 0 0;
    text-align: center;
}

.au-center {
    align-self: center;
    font-size: 0.88rem;
}

/* "or" divider line between the forgot link and the register prompt. */
.au-divider {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.78rem;
    gap: 0.9rem;
    margin: -0.2rem 0;
}

.au-divider::before,
.au-divider::after {
    border-top: 1px solid currentColor;
    content: "";
    flex: 1;
    opacity: 0.35;
}

.au-check {
    align-items: center;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    font-size: 0.84rem;
    gap: 0.6rem;
}

.au-check input {
    accent-color: var(--brand);
    cursor: pointer;
    flex: none;
    height: 1.05rem;
    margin: 0;
    width: 1.05rem;
}

.au-copyright {
    color: var(--muted);
    font-size: 0.75rem;
    margin: 1.25rem 0 0;
    text-align: center;
}

.au-main .form-input,
.au-main .phone-fields {
    border-radius: var(--radius);
    font-size: 0.92rem;
}

.au-main .form-input {
    padding: 0.8rem 1rem;
}

.au-main .hidden {
    display: none;
}

/* ── Form column: fully transparent over the photo ──
   No tint or blur; a faint shade toward the left edge keeps white text readable on bright spots. */
.au-main {
    /* Fades to fully transparent before the column edge, so there is no seam at 40%. */
    background: linear-gradient(90deg, rgba(var(--au-panel), 0.35) 0%, rgba(var(--au-panel), 0.15) 60%, rgba(var(--au-panel), 0) 100%);
    text-shadow: var(--au-text-shadow);
}

.au-main .form-input,
.au-main .phone-fields,
.au-main .au-btn,
.au-main .alert,
.au-main .country-picker-menu {
    text-shadow: none;
}

.au-main .form-input,
.au-main .phone-fields {
    background: var(--au-input-bg);
    border: 1px solid var(--auth-line);
    color: var(--ink);
}

.au-main .form-input::placeholder,
.au-main .phone-number-input::placeholder {
    color: var(--au-placeholder);
}

.au-main .form-input:focus,
.au-main .phone-fields:focus-within {
    background: var(--au-input-focus);
    border-color: var(--au-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.au-main .phone-number-input,
.au-main .country-picker-code {
    color: var(--ink);
}

.au-main .au-input__icon,
.au-main .au-link {
    color: var(--au-accent);
}

.au-main .country-picker-menu {
    background: var(--au-menu-bg);
    border-color: var(--line);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.au-main .country-option {
    color: var(--ink);
}

.au-main .country-option:hover,
.au-main .country-option:focus-visible {
    background: var(--brand-soft);
}

.au-main .alert {
    border-radius: var(--radius);
}

.au-main .alert--error {
    background: var(--au-error-bg);
    border-color: var(--au-error-line);
    color: var(--au-error-ink);
}

.au-main .alert--success {
    background: var(--au-success-bg);
    border-color: var(--au-success-line);
    color: var(--au-success-ink);
}

/* ── Register: compact so the whole form fits on laptop screens (~620px tall) ── */
.au-form--wide {
    padding: clamp(0.25rem, 2vh, 1.5rem) 0;
}

.au-form--wide .au-form__head {
    margin-bottom: clamp(0.75rem, 2vh, 1.25rem);
}

.au-form--wide .au-logo {
    font-size: 1.9rem;
    margin-bottom: 0.3rem;
}

.au-form--wide .au-fields {
    gap: 0.7rem;
}

.au-main .au-form--wide .form-input,
.au-main .au-form--wide .phone-number-input {
    padding: 0.6rem 0.9rem;
}

.au-form--wide .country-picker-toggle {
    padding-bottom: 0.6rem;
    padding-top: 0.6rem;
}

.au-form--wide .au-btn {
    margin-top: 0.2rem;
    padding: 0.75rem 1rem;
}

.au-form--wide .au-foot {
    margin-top: 0;
}

/* Short screens: pull the top bar in so the form starts higher. */
@media (max-height: 720px) and (min-width: 901px) {
    .au-main {
        padding-bottom: 1rem;
        padding-top: 1.25rem;
    }

    .au-form--wide .au-subtitle {
        font-size: 0.85rem;
    }
}

/* ── Phones and small tablets ────────────── */
@media (max-width: 900px) {
    .au-layout {
        grid-template-columns: 1fr;
    }

    .au-copy {
        display: none;
    }

    .au-main {
        min-height: 100vh;
    }

    .au-main {
        border-right: 0;
    }

    .au-back--mobile {
        display: inline;
        margin-right: auto;
    }

    .au-form {
        padding: 2.5rem 0 3rem;
    }
}

@media (max-width: 480px) {
    .au-title {
        font-size: 1.6rem;
    }

    .au-row {
        grid-template-columns: 1fr;
    }
}

/* Two-tone headings, same pattern as the landing page ("Expertise that <span>works for you</span>"). */
.au-title span,
.au-copy__text h2 span {
    color: var(--au-heading-accent);
}
