/* The small pages the server builds (aitoolkit/api/auth_pages.py): the SSO round trip, the hidden recovery
   sign-in, the support hand-over and the paused workspace. They load design-system.css first, for its tokens in
   the light and the dark theme, and keep their own few rules here (no style element or attribute: the
   Content-Security-Policy refuses inline styles). */
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    font: var(--fs-px-15) / 1.55 var(--font);
    padding: var(--sp-4);
}

.box {
    max-width: 460px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-7);
}

h1 {
    font-size: var(--fs-lg);
    margin: 0 0 var(--sp-2-5);
}

p {
    color: var(--muted);
    margin: 0 0 var(--sp-3);
}

a {
    color: var(--brand-text);
}

.auth-form {
    display: grid;
    gap: var(--sp-2-5);
    margin-top: var(--sp-2);
}

.auth-form input {
    padding: var(--sp-2-5);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-8);
    font: inherit;
}

.auth-form button {
    padding: var(--sp-2-5);
    border: 0;
    border-radius: var(--radius-8);
    background: var(--text);
    color: var(--surface);
    cursor: pointer;
}

.auth-error {
    color: var(--danger);
    margin: 0;
}

.auth-turn-on {
    padding: var(--sp-2-5) var(--sp-4);
    border: 0;
    border-radius: var(--radius-8);
    background: var(--text);
    color: var(--surface);
    font: var(--fw-semibold) var(--fs-px-15) var(--font);
    cursor: pointer;
}

.auth-msg {
    margin-top: var(--sp-3);
}

/* The support hand-over: one plain line while the workspace opens. */
.auth-plain {
    display: block;
    min-height: 0;
    padding: var(--sp-2);
    background: none;
    color: inherit;
    font: var(--fs-px-16) system-ui;
}

.auth-plain p {
    color: inherit;
    font: var(--fs-px-16) system-ui;
    margin: var(--sp-vh-10) auto;
    max-width: 520px;
}

/* The page a restore shows while the app is stopped (aitoolkit/entrypoint.py): a spinner and two lines, centred,
   with no card. */
.auth-wait .box {
    text-align: center;
    background: none;
    border: 0;
}

.auth-spin {
    width: var(--sp-9);
    height: var(--sp-9);
    margin: 0 auto var(--sp-4-5);
    border: 3px solid var(--border);
    border-top-color: currentcolor;
    border-radius: var(--radius-round);
    animation: auth-spin 1s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}
