/* ============================================================
   Atlas auth page — shared styles for login + signup.
   Loaded by templates/account/auth.html (rendered for both
   /login and /signup). Mode-conditional layout via .auth-split--login
   vs .auth-split--signup on the split container; Alpine flips that
   class when the user toggles between login and signup inline.

   Built on 2026-05-04 by merging the original split inline
   <style> blocks of the (now-deleted) login.html / signup.html
   templates. Login chrome was the canonical base; signup-specific
   additions (.auth-checkbox*) appended.
   ============================================================ */

@font-face {
    font-family: "Druk Wide";
    src: url("/static/assets/fonts/Akzidenz-Grotesk Pro/DrukWideBold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --accent: #00b0f1;
    --accent-hover: #009ad3;
    --bg: #ffffff;
    --bg-tint: #f4f6f9;
    --bg-soft: #fafafa;
    --bg-hover: #ebecef;
    --border-light: #eef0f3;
    --border: #e5e7eb;
    --border-strong: #d4d4d8;
    --border-dark: #71717a;
    --text: #111827;
    --text-2: #525866;
    --text-muted: #9ca3af;
    --red: #dc2626;
    --green: #22c55e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    height: 100dvh;
    overflow: hidden;             /* lock both axes — auth page is a fixed viewport, no scroll */
    overscroll-behavior: none;
}
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text);
    background-color: var(--bg-tint);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul { list-style: none; }
h1, h2, h3, h4 { font-family: "Mona Sans", Inter, system-ui, sans-serif; font-feature-settings: "ss02", "ss03"; }
[x-cloak] { display: none !important; }

/* ---------- Shell ---------- */
.auth-shell {
    min-height: 100dvh;          /* keep split centered IN the viewport; footer falls below */
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    justify-items: center;
    padding: 2rem 1.25rem;
    box-sizing: border-box;
}

/* App icon centered in the space between the top of the screen
   and the top of the auth card. Lives in row 1 of the grid; the
   matching 1fr below the card keeps the card visually centered.
   Wrapped in a button so it acts as a "back to start" affordance. */
.auth-icon-btn {
    align-self: center;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    border-radius: 18px;
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.auth-icon-btn:hover { transform: scale(1.04); }
.auth-icon-btn:active { transform: scale(0.97); }
.auth-icon-btn:focus-visible {
    outline: 2px solid var(--accent, #0a0a0a);
    outline-offset: 4px;
}
.auth-icon {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}
@media (max-width: 899px) {
    .auth-icon-btn { border-radius: 16px; }
    .auth-icon { width: 64px; height: 64px; border-radius: 16px; }
}
/* Mobile: card sits centered in the viewport (no longer a bottom sheet). */

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 2.25rem;
}
.auth-logo img { width: 36px; height: 36px; }
.auth-logo-text {
    font-family: "Druk Wide", "Mona Sans", Inter, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
}
/* Hide the logo above the split on desktop — let the split stand alone */
@media (min-width: 900px) {
    .auth-shell > .auth-logo { display: none; }
}

/* ---------- Mode-switch transition (View Transitions API) ----------
   When .auth-split's modifier class flips between --login and --signup,
   the panes and their content morph smoothly. Browsers without View
   Transitions support fall back to an instant swap. */
::view-transition-old(auth-image),
::view-transition-new(auth-image),
::view-transition-old(auth-form),
::view-transition-new(auth-form),
::view-transition-old(auth-split),
::view-transition-new(auth-split) {
    animation-duration: 0.45s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Card — single column on all viewports ---------- */
.auth-split {
    view-transition-name: auth-split;
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    box-shadow:
        0 12px 28px -16px rgba(15, 23, 42, 0.10),
        0 2px 6px -3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}
@media (max-width: 899px) {
    .auth-split { max-width: 420px; }
    .auth-form-pane { padding: 3rem 1.5rem 1.75rem; }
}

.auth-form-pane {
    view-transition-name: auth-form;
    padding: 3.25rem 2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (min-width: 900px) {
    .auth-form-pane { padding: 3.75rem 2.5rem 2.25rem; }
}

/* ---------- Card / form ---------- */
.auth-card {
    position: relative;       /* anchors the absolutely-positioned .auth-step-head */
    width: 100%;
    max-width: 420px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* Back arrow — hidden across all steps. The locked email field with its
   edit pencil now handles "go back / change" for the steps that need it. */
.auth-step-head { display: none; }
.auth-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.18s;
    flex-shrink: 0;
}
.auth-back:hover { color: var(--text-2); }
/* When the heading follows an absolutely-positioned step-head, give it a
   little top breathing room so it doesn't crash into the back button. */
.auth-step-head + .auth-mobile-header { margin-top: 0.5rem; }
.auth-back svg { width: 18px; height: 18px; }
.auth-step-head h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 0;
}
.auth-step-head p { font-size: 0.85rem; color: var(--text-2); margin-top: 0.15rem; }

/* The .auth-title / .auth-subtitle classes are kept for the password / verify /
   register / forgot / reset step headers. The email-entry step intentionally
   does NOT use them (per design — no "Welcome back." / "Create your account."). */
.auth-title {
    font-family: "Mona Sans", Inter, sans-serif;
    font-size: 2.2rem;
    font-weight: 600;
    text-align: center;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 0.45rem;
}
/* Mobile-only header above the providers — desktop hides it because the
   image pane already carries the contextual headline. */
/* Heading/subheading container — sits at the top of the card on mobile,
   above the input. Hidden on desktop (image pane carries the contextual headline). */
.auth-mobile-header {
    text-align: center;
    margin-bottom: 2.25rem;
}
.auth-subtitle--mobile { text-align: center; margin: 0; }
.auth-title--mobile { margin: 0; font-size: 1.9rem; }

/* `.auth-title__char`, `.auth-title__char--sub`, `.auth-appear`, and the
   `auth-title-char-in` / `auth-title-char-in-sub` / `auth-appear-in`
   keyframes are defined in `static/css/marketing.css`, which every
   consumer of these classes loads before this file. Don't redeclare. */

.auth-subtitle {
    font-size: 0.95rem;
    text-align: center;
    color: var(--text-2);
}

/* Mode-toggle row above the Google button on the email step. Replaces the
   removed .auth-title / .auth-subtitle pair on that step. */
/* Mode-toggle — single muted-grey clickable line below the legal helper.
   Matches the .auth-helper text color and weight; whole text is the toggle. */
.auth-mode-toggle {
    display: block;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    margin-top: 0.85rem;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.55;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.18s;
}
.auth-mode-toggle:hover { color: var(--text-2); }

.auth-link {
    color: var(--accent);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: currentColor;
}
.auth-link:hover { color: var(--accent-hover); }

/* OAuth provider buttons — column by default; .--row puts them side-by-side
   (icon-only) for the email-step layout where they sit below the divider. */
.auth-providers {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;        /* matches the email-field → continue-button gap */
    margin-top: 0.6rem; /* matches the email-field → continue-button gap */
}
.auth-providers--row {
    flex-direction: row;
    gap: 0.6rem;
}
.auth-providers--row .auth-apple,
.auth-providers--row .auth-google {
    flex: 1;
    padding: 1.05rem 0;
}
.auth-providers--row .auth-apple svg,
.auth-providers--row .auth-google svg { margin: 0; }
.auth-google,
.auth-apple {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    border-radius: 0.75rem;
    padding: 1.05rem 1.25rem;
    font-family: "Mona Sans", Inter, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.18s, border-color 0.18s, opacity 0.18s;
}
.auth-google {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.auth-google:hover { background: var(--bg-soft); border-color: var(--border-dark); }

.auth-apple {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    color: #000000;
}
.auth-apple:hover { background: var(--bg-soft); border-color: var(--border-dark); }
.auth-apple--placeholder { opacity: 0.85; }   /* signals not-yet-wired */
.auth-apple--placeholder:hover { opacity: 1; }

.auth-google svg { width: 22px; height: 22px; flex-shrink: 0; }
.auth-apple  svg { width: 22px; height: 22px; flex-shrink: 0; transform: translateY(-1px); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.25rem 0;
}
.auth-divider span:first-child,
.auth-divider span:last-child {
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-divider span:nth-child(2) {
    font-family: "Mona Sans", Inter, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-field { margin-bottom: 0.85rem; position: relative; }
/* Tight email-entry field on the email step — Continue button sits closer below */
.auth-field--tight { margin-bottom: 0.35rem; }
/* Anchors the eye toggle relative to the INPUT (not the field) so it doesn't
   shift when an error message appears below */
.auth-input-wrap { position: relative; }
.auth-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    font-family: Inter, sans-serif;
    font-size: 0.98rem;
    color: var(--text);
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    outline: none;
}
.auth-input--pill {
    border-radius: 0.75rem;
    padding: 1.05rem 1.25rem;
}
.auth-input::placeholder { color: var(--text-muted); }
.auth-input:focus {
    border-color: var(--border-dark);
    box-shadow: none;
}
.auth-input:disabled {
    background: var(--bg-soft);
    color: var(--text-2);
    cursor: not-allowed;
}
.auth-input.has-action { padding-right: 3rem; }
.auth-input-action {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.18s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 0.45rem;
}
.auth-input-action:hover { color: var(--text); background: var(--bg-soft); }
.auth-input-action svg { width: 18px; height: 18px; }

.auth-error { color: var(--red); font-size: 0.78rem; margin-top: 0.35rem; }
.auth-success { color: var(--green); font-size: 0.78rem; margin-top: 0.35rem; }

/* Valid input — green border (live as user types) */
.auth-input.is-valid,
.auth-input.is-valid:focus { border-color: var(--green); }

/* Password requirements checklist — items light up green as each rule is met.
   Animates open/closed via max-height + opacity when the user starts/stops
   typing in the password field. The card height follows because the list
   itself is what grows. */
.auth-pwd-reqs {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: max-height 0.32s ease, opacity 0.25s ease, margin-top 0.32s ease;
}
.auth-pwd-reqs.is-shown {
    max-height: 200px;
    opacity: 1;
    margin-top: 0.55rem;
}
.auth-pwd-reqs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
    transition: color 0.18s;
}
.auth-pwd-reqs li::before {
    content: '';
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    flex-shrink: 0;
    background: transparent;
    transition: background 0.18s, border-color 0.18s;
}
.auth-pwd-reqs li.is-met { color: var(--green); }
.auth-pwd-reqs li.is-met::before {
    background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/9px no-repeat;
    border-color: var(--green);
}

.auth-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}
.auth-row .auth-input { flex: 1; }
/* Inline "Change" link — matches the muted-grey style of the bottom mode-toggle */
.auth-row-link {
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 0.4rem 0.55rem;
    border-radius: 0.45rem;
    cursor: pointer;
    transition: color 0.18s, background 0.18s;
}
.auth-row-link:hover { color: var(--text-2); background: var(--bg-soft); }

/* Legal-agreement checkbox (signup register step) — larger, rounded, page-tone colors. */
.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin: 1rem 0 0.85rem;
}
.auth-checkbox input {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin: 0.05rem 0 0;
    background: #ffffff;
    border: 1.5px solid var(--border-strong);
    border-radius: 0.45rem;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: background 0.18s, border-color 0.18s;
}
.auth-checkbox input:hover { border-color: var(--border-dark); }
.auth-checkbox input:checked {
    background: var(--text);
    border-color: var(--text);
}
.auth-checkbox input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 11px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}
.auth-checkbox input:focus-visible { outline: 2px solid var(--border-dark); outline-offset: 2px; }
.auth-checkbox label {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    cursor: pointer;
}
.auth-checkbox label a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: currentColor;
}
.auth-checkbox label a:hover { color: var(--text-2); }

.auth-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #1a1a1a 0%, #050505 100%);
    color: #ffffff;
    font-family: "Mona Sans", Inter, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 1.05rem 1.25rem;
    border-radius: 0.75rem;
    transition: background 0.2s, opacity 0.2s;
    margin-top: 0.25rem;
}
.auth-btn:hover:not(:disabled) { background: linear-gradient(180deg, #2a2a2a 0%, #0a0a0a 100%); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-helper {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1.25rem;
    line-height: 1.55;
}
.auth-helper a {
    color: inherit;                              /* match the surrounding muted grey */
    text-decoration: underline;
    text-decoration-color: currentColor;
}
.auth-helper a:hover { color: inherit; }

.auth-meta {
    font-size: 0.85rem;
    color: var(--text-2);
    text-align: center;
    margin-top: 1.1rem;
}
.auth-meta a:hover { text-decoration: underline; }

.auth-step-info {
    font-size: 0.9rem;
    color: var(--text-2);
    margin-bottom: 1.1rem;
}
.auth-step-info--center { text-align: center; }

/* 6-digit verification code grid (verify-email standalone page) */
.auth-code-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.auth-code-input {
    width: 100%;
    height: 56px;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 0.75rem;
    color: var(--text);
    font-family: "Mona Sans", Inter, sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.18s, background 0.18s;
    outline: none;
}
.auth-code-input:focus {
    border-color: var(--border-dark);
    background: var(--bg-soft);
}
.auth-code-input:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Footer (matches download/careers) ---------- */
.footer {
    background: #ffffff;
    border-top: 1px solid var(--border-light);
    margin-top: 0;
}
.footer-inner {
    max-width: 1110px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
}
@media (min-width: 768px) { .footer-inner { padding: 4rem 2rem; } }
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
@media (min-width: 768px) {
    .footer-grid { grid-template-columns: repeat(5, 1fr); gap: 2rem; }
}
.footer-brand { grid-column: span 2; }
.footer-logo { display: inline-flex; align-items: center; gap: 0.5rem; }
.footer-logo-icon { height: 26px; width: 26px; }
.footer-logo-text {
    font-family: "Druk Wide", "Mona Sans", Inter, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0;
    text-transform: uppercase;
}
.footer-brand p {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-2);
    line-height: 1.6;
    max-width: 320px;
}
.footer-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    background: linear-gradient(180deg, #1a1a1a 0%, #050505 100%);
    color: #fff;
    font-family: "Mona Sans", Inter, system-ui, sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.72rem 1.35rem;
    border-radius: 0.75rem;
    transition: background 0.2s;
}
.footer-cta:hover { background: linear-gradient(180deg, #2a2a2a 0%, #0a0a0a 100%); }
.footer-cta svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.25s ease; }
.footer-cta:hover svg { transform: translate(2px, -2px); }
.footer-col { display: flex; flex-direction: column; gap: 0.625rem; }
.footer-col h4 {
    font-family: "Mona Sans", Inter, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.footer-col a {
    font-size: 0.875rem;
    color: var(--text-2);
    transition: color 0.18s;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}
@media (min-width: 720px) {
    .footer-bottom { flex-direction: row; text-align: left; }
}

.loading-dots::after {
    content: '';
    display: inline-block;
    margin-left: 4px;
    animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}
