/*
 * Login screen styling.
 *
 * Mirrors the design system introduced with the redesigned API documentation
 * page (static/css/api-docs.css): warm stone palette, TensorFive purple primary,
 * mint accent, Satoshi typography, bold 900-weight headings and 16px rounded
 * surface cards. Kept as a standalone stylesheet because the login page does
 * not extend base.html.
 */

:root {
    --primary: #842CC3;
    --primary-hover: #6b23a0;
    --primary-soft: rgba(132, 44, 195, 0.09);
    --secondary: #87F3A4;
    --secondary-ink: #14532d;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg: #fafaf9;
    --bg-secondary: #f5f5f4;
    --bg-tertiary: #e7e5e4;
    --surface: #ffffff;
    --text: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #78716c;
    --border: #d6d3d1;
    --border-light: #e7e5e4;
    --shadow: 0 16px 40px rgba(28, 25, 23, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* ---------------------------------------------------------------- shell --- */

.auth-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* subtle, on-brand corner accents — kept faint to match the flat docs look */
    background:
        radial-gradient(900px 420px at 100% -10%, var(--primary-soft), transparent 60%),
        radial-gradient(700px 360px at -10% 110%, rgba(135, 243, 164, 0.16), transparent 55%),
        var(--bg);
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 40px;
    border-bottom: 1px solid var(--border-light);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(132, 44, 195, 0.22);
}

.brand-name,
.brand-subline {
    display: block;
}

.brand-name {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
}

.brand-subline {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.topbar-link:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* ----------------------------------------------------------------- main --- */

.auth-main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 470px);
    align-items: center;
    gap: 64px;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 56px 40px 72px;
}

/* ----------------------------------------------------------------- hero --- */

.eyebrow {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-hero h1 {
    max-width: 620px;
    margin: 0 0 18px;
    color: var(--text);
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.07;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.hero-subtitle {
    max-width: 540px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 40px;
}

.feature-card {
    display: flex;
    gap: 14px;
    min-width: 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(132, 44, 195, 0.08);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-text {
    min-width: 0;
}

.feature-text h3 {
    margin: 2px 0 4px;
    font-size: 0.98rem;
    font-weight: 850;
    line-height: 1.3;
}

.feature-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.55;
}

/* ------------------------------------------------------------ login card --- */

.login-card {
    min-width: 0;
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.card-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-card h2 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.2;
}

.login-intro {
    margin: 0 0 26px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-actions {
    display: grid;
    gap: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 22px rgba(132, 44, 195, 0.22);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(132, 44, 195, 0.28);
}

.btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn .btn-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
}

.btn .btn-icon svg {
    width: 100%;
    height: 100%;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.login-footnote {
    margin: 24px 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

/* -------------------------------------------------------------- flashes --- */

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.flash {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.5;
}

.flash-error {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
    color: #991b1b;
}

.flash-warning {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.flash-success {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.1);
    color: var(--secondary-ink);
}

/* ----------------------------------------------------------- responsive --- */

@media (max-width: 900px) {
    .auth-topbar {
        padding: 18px 22px;
    }

    .auth-main {
        grid-template-columns: 1fr;
        gap: 36px;
        max-width: 540px;
        padding: 36px 22px 56px;
    }

    .auth-hero h1 {
        font-size: 2.25rem;
    }

    .login-card {
        order: -1;
    }
}

@media (max-width: 560px) {
    .auth-topbar {
        padding: 16px;
    }

    .auth-main {
        padding: 28px 16px 48px;
    }

    .auth-hero h1 {
        font-size: 1.95rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 26px 22px;
    }
}
