/**
 * VideoGenAPI : auth pages (sign in, sign up, password reset).
 *
 * Self-contained on purpose: assets/css/tailwind.min.css is a purged build with
 * no arbitrary-value utilities, so the layout here does not depend on it.
 *
 * The brand is a four-stop gradient (purple > blue > pink > orange). It is kept
 * for the logo mark only; violet #8B5CF6 carries the rest as a flat accent.
 */

:root {
    --auth-ink:        #111827;
    --auth-ink-soft:   #374151;
    --auth-muted:      #6B7280;
    --auth-faint:      #9CA3AF;
    --auth-line:       #E5E7EB;
    --auth-line-soft:  #F3F4F6;
    --auth-accent:     #8B5CF6;
    --auth-accent-dk:  #7C3AED;
    --auth-panel:      #111827;
    --auth-panel-code: #0B1120;
    --auth-danger:     #DC2626;
    --auth-ok:         #059669;
    --auth-brand:      linear-gradient(135deg, #8B5CF6 0%, #3B82F6 25%, #EC4899 50%, #F97316 100%);
    --auth-mono:       ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ============================================================
   RESET / BASE
   ============================================================ */

.auth-body {
    margin: 0;
    background: #FFFFFF;
    color: var(--auth-ink);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ============================================================
   SHELL : form left, product panel right
   ============================================================ */

.auth-shell { min-height: 100vh; }

.auth-main {
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.5rem;
}

.auth-main__body {
    flex: 1;
    display: flex;
    align-items: center;
}

/* Column width is set per page via a modifier, defaulting to the sign-in size. */
.auth-card {
    width: 100%;
    max-width: 24rem;
    margin: 0 auto;
}
.auth-card--wide { max-width: 27rem; }

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.auth-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    margin-top: 3rem;
    font-size: 0.78rem;
    color: var(--auth-faint);
}

@media (min-width: 1024px) {
    .auth-shell {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .auth-main { padding: 3rem 3.5rem; }
    .auth-topbar { margin-bottom: 3.5rem; }
}

@media (min-width: 1280px) {
    .auth-main { padding: 3rem 5rem; }
}

/* ============================================================
   BRAND
   ============================================================ */

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}

.auth-logo__mark {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--auth-brand);
    color: #fff;
    flex: 0 0 auto;
}
.auth-logo__mark .material-symbols-outlined { font-size: 18px; }

.auth-logo__text {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--auth-ink);
}

/* ============================================================
   TYPE
   ============================================================ */

.auth-title {
    margin: 0 0 0.375rem;
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.2;
    color: var(--auth-ink);
}

.auth-sub {
    margin: 0 0 2rem;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-note {
    font-size: 0.85rem;
    color: var(--auth-muted);
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */

.auth-field + .auth-field { margin-top: 1.125rem; }

.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.auth-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-ink-soft);
}

.auth-label__opt {
    font-weight: 500;
    color: var(--auth-faint);
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}
.auth-label-row .auth-label { margin-bottom: 0; }

.auth-input {
    display: block;
    width: 100%;
    height: 2.75rem;
    padding: 0 0.8125rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--auth-ink);
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 0.5rem;
    transition: border-color 130ms ease, box-shadow 130ms ease;
}

.auth-input::placeholder { color: var(--auth-faint); }
.auth-input:hover:not(:focus) { border-color: #D1D5DB; }

.auth-input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.auth-input--pw { padding-right: 2.75rem; }

.auth-input.has-error { border-color: var(--auth-danger); }
.auth-input.has-error:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }

.auth-hint {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    color: var(--auth-faint);
}

.auth-err {
    display: none;
    margin: 0.375rem 0 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--auth-danger);
}
.auth-err.is-on { display: block; }

.auth-pw-wrap { position: relative; }

.auth-reveal {
    position: absolute;
    top: 50%;
    right: 0.4375rem;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 1.875rem;
    height: 1.875rem;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--auth-faint);
    cursor: pointer;
    transition: color 130ms ease, background-color 130ms ease;
}
.auth-reveal:hover { color: var(--auth-ink-soft); background: var(--auth-line-soft); }
.auth-reveal:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 1px; }
.auth-reveal .material-symbols-outlined { font-size: 19px; }

/* Checkbox */
.auth-check {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 1.0625rem;
    height: 1.0625rem;
    margin: 0;
    border: 1px solid #D1D5DB;
    border-radius: 0.3125rem;
    background: #fff;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}
.auth-check:checked {
    background: var(--auth-accent);
    border-color: var(--auth-accent);
}
.auth-check:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.auth-check:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 2px; }
.auth-check.has-error { border-color: var(--auth-danger); }

.auth-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}
.auth-consent__text {
    font-size: 0.83rem;
    line-height: 1.45;
    color: var(--auth-ink-soft);
}
.auth-consent .auth-check { margin-top: 0.125rem; }

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.auth-trap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4375rem;
    width: 100%;
    height: 2.75rem;
    padding: 0 1.125rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease;
}
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-btn .material-symbols-outlined { font-size: 18px; }

.auth-btn--primary { background: var(--auth-ink); color: #fff; }
.auth-btn--primary:hover:not(:disabled) { background: #1F2937; }
.auth-btn--primary:focus-visible { outline: 2px solid var(--auth-ink); outline-offset: 2px; }

.auth-btn--ghost {
    background: #fff;
    color: var(--auth-ink-soft);
    border-color: var(--auth-line);
}
.auth-btn--ghost:hover:not(:disabled) { background: #F9FAFB; color: var(--auth-ink); }

.auth-btn-pair {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.625rem;
}
.auth-btn-pair .auth-btn--ghost { padding: 0 0.875rem; }

.auth-actions { margin-top: 1.75rem; }

.auth-link {
    color: var(--auth-accent-dk);
    font-weight: 600;
    text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.auth-link--muted {
    color: var(--auth-muted);
    font-weight: 500;
    text-decoration: none;
}
.auth-link--muted:hover { color: var(--auth-ink); }

/* ============================================================
   ALERTS
   ============================================================ */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid;
    font-size: 0.83rem;
    line-height: 1.45;
}
.auth-alert .material-symbols-outlined { font-size: 18px; flex: 0 0 auto; }

.auth-alert--error   { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.auth-alert--success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.auth-alert--info    { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }

/* Client-side alert starts hidden. */
.auth-alert--js { display: none; }
.auth-alert--js.is-on { display: flex; }

/* ============================================================
   STEPPER (sign up)
   ============================================================ */

.auth-steps { margin-bottom: 1.75rem; }

.auth-steps__label {
    margin: 0 0 0.625rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--auth-faint);
}
.auth-steps__label b { color: var(--auth-muted); font-weight: 700; }

.auth-steps__track {
    display: flex;
    gap: 0.375rem;
}

.auth-steps__bar {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: var(--auth-line);
    transition: background-color 280ms ease;
}
.auth-steps__bar.is-on { background: var(--auth-ink); }

.auth-step[hidden] { display: none; }

/* ============================================================
   PASSWORD STRENGTH
   ============================================================ */

.auth-pw-meter {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.auth-pw-meter__seg {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: var(--auth-line);
    transition: background-color 160ms ease;
}
.auth-pw-meter__seg.is-weak   { background: #EF4444; }
.auth-pw-meter__seg.is-fair   { background: #F59E0B; }
.auth-pw-meter__seg.is-good   { background: #3B82F6; }
.auth-pw-meter__seg.is-strong { background: #10B981; }

.auth-pw-note {
    margin: 0.4375rem 0 0;
    font-size: 0.75rem;
    color: var(--auth-muted);
}

/* ============================================================
   PRODUCT PANEL
   ============================================================ */

.auth-aside { display: none; }

@media (min-width: 1024px) {
    .auth-aside {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 2.5rem;
        padding: 3rem;
        background: var(--auth-panel);
        position: relative;
        overflow: hidden;
    }
    .auth-aside > * { position: relative; z-index: 1; }
}

@media (min-width: 1280px) {
    .auth-aside { padding: 3.5rem; }
}

/* Hairline grid, same idea as the marketing pages. */
.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.auth-aside__body { max-width: 30rem; }

/* Keeps the figures on the baseline while the body stays vertically centred. */
.auth-aside__foot { margin-top: auto; }

.auth-aside__title {
    margin: 0 0 0.625rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.18;
    color: #fff;
}

.auth-aside__sub {
    margin: 0 0 1.75rem;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #9CA3AF;
}

/* Code sample */
.auth-code {
    border-radius: 0.625rem;
    background: var(--auth-panel-code);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 1.75rem;
}

.auth-code__bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.auth-code__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.auth-code__name {
    margin-left: auto;
    font-family: var(--auth-mono);
    font-size: 0.68rem;
    color: #6B7280;
}

.auth-code pre {
    margin: 0;
    padding: 0.875rem 1rem;
    overflow-x: auto;
    font-family: var(--auth-mono);
    font-size: 0.73rem;
    line-height: 1.7;
    color: #D1D5DB;
    tab-size: 2;
}

.auth-code .c-cmd { color: #A78BFA; }
.auth-code .c-str { color: #6EE7B7; }
.auth-code .c-key { color: #93C5FD; }
.auth-code .c-num { color: #FCD34D; }
.auth-code .c-dim { color: #6B7280; }

/* Model chips */
.auth-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1.75rem;
}

.auth-chip {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 500;
    color: #D1D5DB;
    white-space: nowrap;
}
.auth-chip--more { color: #6B7280; background: transparent; border-style: dashed; }

/* Facts */
.auth-facts { display: grid; gap: 0.75rem; }

.auth-fact {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}
.auth-fact__mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.18);
    color: #C4B5FD;
}
.auth-fact__mark .material-symbols-outlined { font-size: 13px; }
.auth-fact__text {
    margin: 0;
    font-size: 0.83rem;
    line-height: 1.55;
    color: #D1D5DB;
}
.auth-fact__text b { color: #fff; font-weight: 600; }

/* Stats */
.auth-stats {
    display: flex;
    gap: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-stat__num {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}
.auth-stat__cap {
    margin: 0.125rem 0 0;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6B7280;
}

/* ============================================================
   MOTION
   ============================================================ */

.auth-fade { animation: authFade 240ms cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes authFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.auth-spin { animation: authSpin 700ms linear infinite; }

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-fade, .auth-spin { animation: none; }
    .auth-input, .auth-btn, .auth-steps__bar, .auth-check { transition: none; }
}
