:root {
    --ui-bg: #ffffff;
    --ui-surface: #ffffff;
    --ui-text: #171717;
    --ui-muted: #737373;
    --ui-line: #e7e7e4;
    --ui-line-strong: #cfcfca;
    --ui-accent: #111111;
    --ui-danger: #b42318;
    --ui-radius-control: 11px;
    --ui-radius-surface: 16px;
    --ui-focus: 0 0 0 3px rgba(17, 17, 17, 0.12);
    --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body.auth-shell {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    display: grid;
    place-items: center;
    background: var(--ui-bg);
    color: var(--ui-text);
    font-family: var(--ui-font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.auth-panel {
    width: min(100%, 392px);
    padding: 32px;
}

.auth-panel h1 {
    margin: 0 0 36px;
    text-align: center;
    font-size: 24px;
    font-weight: 560;
    letter-spacing: -0.04em;
}

.auth-panel p {
    color: var(--ui-muted);
    font-size: 14px;
    line-height: 1.6;
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin: 0 0 8px;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-panel input:not([type="hidden"]) {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-control);
    outline: none;
    background: var(--ui-surface);
    color: var(--ui-text);
    font: inherit;
    font-size: 15px;
    transition: border-color .16s ease, box-shadow .16s ease;
    -webkit-appearance: none;
}

.auth-panel input:not([type="hidden"]):hover { border-color: var(--ui-line-strong); }
.auth-panel input:not([type="hidden"]):focus { border-color: var(--ui-accent); box-shadow: var(--ui-focus); }

.btn {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--ui-accent);
    border-radius: var(--ui-radius-control);
    background: var(--ui-accent);
    color: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.btn:hover { background: #2b2b2b; border-color: #2b2b2b; }
.btn:focus-visible { outline: none; box-shadow: var(--ui-focus); }
.btn:active { transform: translateY(1px); }

.btn-secondary {
    border-color: var(--ui-line);
    background: var(--ui-surface);
    color: var(--ui-text);
}

.btn-secondary:hover { border-color: var(--ui-line-strong); background: #f7f7f5; }

.divider {
    height: 1px;
    margin: 30px 0;
    background: var(--ui-line);
}

.flash {
    margin: 0 0 24px;
    padding: 12px 14px;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-control);
    background: #f7f7f5;
    color: var(--ui-text);
    font-size: 13px;
    text-align: center;
}

.flash-error { border-color: #f0c7c2; background: #fff5f4; color: var(--ui-danger); }

.links { margin-top: 28px; text-align: center; font-size: 12px; }
.links a { color: var(--ui-muted); text-decoration: none; }
.links a:hover { color: var(--ui-text); }

.error-panel { text-align: center; }
.error-panel h1 { margin-bottom: 16px; }
.error-panel .btn { margin-top: 28px; }

@media (max-width: 480px) {
    .auth-panel { padding: 24px; }
}
