/* Sign-in and code verification.
   Shared by index.php and otp_verify.php. These two pages carry no framework:
   the CSRF token travels in a hidden field, so nothing here needs JavaScript,
   and a login screen should not be waiting on a chart library to load. */

:root {
    --au-ink: #233c38;
    --au-ink-soft: #3d5349;
    --au-muted: #74817d;
    --au-faint: #97a29c;
    --au-brand: #245b4e;
    --au-brand-dark: #194639;
    --au-brand-deep: #14352c;
    --au-sage: #7f9c86;
    --au-sand: #eee8dc;
    --au-page: #f6f7f4;
    --au-surface: #fff;
    --au-line: #e4e8e2;
    --au-line-strong: #cddccf;
    --au-danger: #a8564d;
    --au-danger-tint: #f8eceb;
    --au-focus: #9ec8b9;
    --au-focus-ring: rgba(36, 91, 78, .12);
    --au-scroll-thumb: #ccd7cb;
    --au-scroll-thumb-hover: #adbeac;
}

/* Dark theme. Same neutral slate scale as the application shell, driven by the
   same se-theme choice, so moving between sign-in and the workspace does not
   change temperature. The brand panel keeps its deep green: it is the one
   accent surface on the page and reads as intended against near-black. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --au-ink: #dfe3e8;
    --au-ink-soft: #adb5bd;
    --au-muted: #99a1aa;
    --au-faint: #838b94;
    --au-brand: #2f8069;
    --au-brand-dark: #389880;
    --au-brand-deep: #12291f;
    --au-sage: #8fb39d;
    --au-sand: #e0c688;
    --au-page: #0e1116;
    --au-surface: #161b22;
    --au-line: #2a3038;
    --au-line-strong: #3d444d;
    --au-danger: #ef968d;
    --au-danger-tint: #2e1e1d;
    --au-focus: #4e9d84;
    --au-focus-ring: rgba(78, 157, 132, .2);
    --au-scroll-thumb: #3d444d;
    --au-scroll-thumb-hover: #4c5661;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--au-page);
    color: var(--au-ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ── Split shell: brand on the left, the form on the right ────────────── */
.au-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

.au-aside {
    position: relative;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 44px;
    background: var(--au-brand-deep);
    color: #fff;
    overflow: hidden;
}
/* A soft wash so the panel is not a flat rectangle of colour. */
.au-aside::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(60% 50% at 18% 8%, rgba(127, 156, 134, .30), transparent 70%),
        radial-gradient(50% 45% at 92% 96%, rgba(192, 160, 90, .18), transparent 70%);
}
.au-aside > * { position: relative; }

.au-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.au-brand-mark {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 48px; border-radius: 13px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
    font-family: Georgia, serif; font-size: 31px; color: #fff;
}
.au-brand-mark span { position: absolute; top: 2px; right: 4px; font-size: 14px; color: var(--au-sand); }
.au-brand strong { display: block; font-size: 19px; font-weight: 750; letter-spacing: -.6px; }
.au-brand small { display: block; margin-top: 3px; font-size: 8px; letter-spacing: 1.7px; font-weight: 600; color: rgba(255, 255, 255, .55); }

.au-pitch { max-width: 24ch; }
.au-pitch h2 { margin: 0; font-size: 34px; line-height: 1.14; font-weight: 650; letter-spacing: -1.2px; }
.au-pitch p { margin: 14px 0 0; max-width: 34ch; font-size: 13.5px; color: rgba(255, 255, 255, .68); }

.au-points { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.au-points li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.au-points svg { flex-shrink: 0; color: var(--au-sage); }

/* ── Form side ────────────────────────────────────────────────────────── */
.au-main { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }

/* Theme switch. Pinned to the panel corner rather than placed in the flow, so
   the sign-in card stays optically centred. Both icons and every colour come
   from this page's own tokens; auth-1.css is self-contained and never loads
   theme.css, where the workspace copy of these rules lives. */
.au-main .se-theme-toggle {
    position: absolute; top: 22px; right: 24px; z-index: 2;
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0;
    border: 1px solid var(--au-line); border-radius: 9px;
    background: var(--au-surface); color: var(--au-muted);
    cursor: pointer; transition: color .15s, border-color .15s;
}
.au-main .se-theme-toggle:hover { color: var(--au-brand-dark); border-color: var(--au-line-strong); }
.au-main .se-theme-toggle:focus-visible { outline: 2px solid var(--au-focus); outline-offset: 2px; }
.se-theme-toggle .se-theme-dark-icon { display: none; }
:root[data-theme="dark"] .se-theme-toggle .se-theme-dark-icon { display: inline-block; }
:root[data-theme="dark"] .se-theme-toggle .se-theme-light-icon { display: none; }
.au-card { width: 100%; max-width: 388px; }

.au-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.au-mobile-brand .au-brand-mark { width: 38px; height: 42px; border-radius: 11px; background: var(--au-brand); border-color: transparent; font-size: 27px; }
.au-mobile-brand strong { font-size: 17px; font-weight: 750; letter-spacing: -.5px; color: var(--au-ink); }

.au-head { margin-bottom: 26px; }
.au-eyebrow {
    margin: 0 0 9px; font-size: 10px; font-weight: 700; letter-spacing: 2.4px;
    text-transform: uppercase; color: var(--au-sage);
}
.au-head h1 { margin: 0; font-size: 30px; font-weight: 650; letter-spacing: -1px; color: var(--au-ink); }
.au-head p { margin: 9px 0 0; font-size: 13.5px; color: var(--au-muted); }

.au-alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 13px 15px; margin-bottom: 20px;
    border: 1px solid var(--au-line); border-left: 3px solid var(--au-danger); border-radius: 10px;
    background: var(--au-danger-tint); font-size: 13px; color: var(--au-ink);
}
.au-alert-mark {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--au-danger); color: #fff; font-size: 11px; font-weight: 700;
}

.au-field { margin-bottom: 16px; }
.au-label {
    display: block; margin-bottom: 7px;
    font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--au-muted);
}
.au-input {
    width: 100%; min-height: 48px; padding: 13px 15px;
    background: var(--au-surface); color: var(--au-ink);
    border: 1px solid var(--au-line); border-radius: 10px;
    font-family: inherit; font-size: 15px;
}
.au-input:focus {
    outline: none; border-color: var(--au-brand); box-shadow: 0 0 0 3px var(--au-focus-ring);
}
.au-input::placeholder { color: var(--au-faint); }

/* The code is six digits and nothing else, so it gets room to breathe. */
.au-input-code {
    text-align: center; font-size: 26px; font-weight: 650;
    letter-spacing: 10px; text-indent: 10px; padding: 14px;
    font-variant-numeric: tabular-nums;
}

.au-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 50px; padding: 14px 24px; margin-top: 6px;
    border: 1px solid transparent; border-radius: 10px;
    background: var(--au-brand); color: #fff;
    font-family: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer;
    transition: background .18s ease;
}
.au-btn:hover { background: var(--au-brand-dark); }
.au-btn:focus-visible { outline: 3px solid var(--au-focus); outline-offset: 3px; }

.au-note { margin: 18px 0 0; font-size: 12px; color: var(--au-muted); text-align: center; }
.au-back { display: inline-block; margin-top: 14px; font-size: 12.5px; color: var(--au-brand); font-weight: 600; text-decoration: none; }
.au-back:hover { text-decoration: underline; }

.au-footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--au-line); text-align: center; font-size: 12px; color: var(--au-muted); }
.au-footer a { color: var(--au-ink); font-weight: 650; text-decoration: none; }
.au-footer a:hover { color: var(--au-brand); text-decoration: underline; }

/* ── Scrollbars ───────────────────────────────────────────────────────── */
html, body { scrollbar-width: thin; scrollbar-color: var(--au-scroll-thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--au-scroll-thumb); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--au-scroll-thumb-hover); background-clip: content-box; }

@media (max-width: 860px) {
    /* The brand panel is decoration; on a phone the form gets the whole screen
       and a compact wordmark stands in for it. */
    .au-shell { grid-template-columns: 1fr; min-height: 100dvh; }
    .au-aside { display: none; }
    .au-main { align-items: flex-start; padding: 34px 20px 40px; }
    .au-mobile-brand { display: flex; }
    /* Sits on the same line as the stacked brand rather than above it: the
       aside is hidden at this width, so the card starts at the top of the page. */
    .au-main .se-theme-toggle { top: 38px; right: 20px; }
    .au-head h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .au-btn { transition: none; }
}
