:root {
    --primary: #1c1c3c;
    --accent: #6c44f4;
    --danger: #ef4444;
    --success: #16a34a;
    --warning: #f59e0b;
    --text: #171717;
    --muted: #6b7280;
    --background: #f6f7fb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-wrap--wide { align-items: flex-start; padding-top: 48px; }

.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    padding: 32px;
    width: 100%;
    max-width: 420px;
}
.auth-wrap--wide .auth-card { max-width: 640px; }

.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 12px;
    font-size: 18px;
}
.auth-brand h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
}
.auth-sub {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.form-row { margin-bottom: 16px; }
.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}
.form-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.form-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 68, 244, 0.15);
}
.form-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.4;
}
.password-strength {
    font-size: 12px;
    margin-top: 6px;
    min-height: 16px;
}

.btn-primary {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .12s ease, opacity .12s ease;
    margin-top: 4px;
}
.btn-primary:hover { background: #10102b; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #e5e7eb;
    color: #111827;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-left: 8px;
}
.btn-secondary:hover { background: #d1d5db; text-decoration: none; }

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    text-decoration: underline;
}

.auth-status {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.4;
}
.auth-status--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.auth-status--ok    { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.auth-status--info  { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}
.auth-links a { margin: 0 8px; }

.health-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 8px;
}
.health-table tr { border-bottom: 1px solid #f1f5f9; }
.health-table tr:last-child { border-bottom: none; }
.health-table td {
    padding: 10px 8px;
    vertical-align: middle;
}
.health-mark { width: 26px; font-weight: 700; }
.health-mark.ok  { color: var(--success); }
.health-mark.bad { color: var(--danger); }
.health-value {
    text-align: right;
    color: var(--muted);
    font-family: Menlo, Consolas, monospace;
    font-size: 12px;
    word-break: break-word;
}

@media (max-width: 480px) {
    .auth-card { padding: 24px 20px; }
    .auth-brand h1 { font-size: 20px; }
}
