/* RadMail — static pages (login, TOTP, errors). No MudBlazor here: these pages are plain HTML forms. */
:root {
    --bg1: #0b5cad;
    --bg2: #083a6e;
    --card: #ffffff;
    --text: #1d2939;
    --muted: #5b6b80;
    --line: #d5dce6;
    --primary: #0b5cad;
    --primary-hover: #094c8f;
    --accent: #00a389;
    --error-bg: #fdecec;
    --error-text: #a12020;
    --info-bg: #e8f1fd;
    --info-text: #0b4a8f;
    --warn-bg: #fff6e0;
    --warn-text: #7a5300;
    --input-bg: #f8fafc;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg1: #0d1b2e;
        --bg2: #050b14;
        --card: #142236;
        --text: #e6edf6;
        --muted: #9fb0c6;
        --line: #2a3d57;
        --primary: #3d8fe6;
        --primary-hover: #5aa9ff;
        --error-bg: #3a1717;
        --error-text: #ffb4b4;
        --info-bg: #13304f;
        --info-text: #bcd8ff;
        --warn-bg: #3a2e10;
        --warn-text: #ffd98a;
        --input-bg: #0f1b2c;
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(160deg, var(--bg1), var(--bg2)) fixed;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    gap: 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    padding: 28px 28px 22px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.auth-brand h1 { margin: 0; font-size: 1.5rem; letter-spacing: .3px; }
.auth-brand p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }

.auth-footer { color: rgba(255, 255, 255, .82); font-size: .85rem; }

.auth-form { display: flex; flex-direction: column; gap: 6px; }

.auth-form label { font-size: .9rem; font-weight: 600; margin-top: 8px; }

.auth-form input[type=text],
.auth-form input[type=password],
.auth-form input:not([type]) {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    text-align: left;
}

.auth-form input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }

.code-input { font-size: 1.4rem !important; letter-spacing: 6px; text-align: center !important; }

button, .button {
    display: inline-block;
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

button:hover:not(:disabled), .button:hover { background: var(--primary-hover); }
button:disabled { opacity: .55; cursor: wait; }

.alert { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: .92rem; line-height: 1.7; }
.alert.error { background: var(--error-bg); color: var(--error-text); }
.alert.info { background: var(--info-bg); color: var(--info-text); }
.alert.warn { background: var(--warn-bg); color: var(--warn-text); }

.captcha-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.captcha-row img { border-radius: 8px; border: 1px solid var(--line); background: #f4f6fa; max-width: 100%; height: auto; }

.pow-status { margin-top: 12px; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pow-status.ok { color: var(--accent); }
.pow-status.bad { color: var(--error-text); }

.spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--line); border-top-color: var(--primary);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hint { color: var(--muted); font-size: .85rem; line-height: 1.8; margin: 14px 0 0; }
.link { color: var(--primary); text-decoration: none; font-size: .9rem; }
.link:hover { text-decoration: underline; }

.step-title { margin: 0 0 6px; font-size: 1.2rem; }
.step-text { margin: 0 0 14px; color: var(--muted); line-height: 1.8; }
.steps { padding-inline-start: 20px; line-height: 1.9; margin: 8px 0; }

.qr { display: flex; justify-content: center; margin: 8px 0 12px; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 10px; }

.manual-key { font-size: .9rem; margin-bottom: 8px; }
.manual-key summary { cursor: pointer; color: var(--primary); }
.manual-key code, .recovery-codes code { font-family: Consolas, "Courier New", monospace; }
.secret { font-size: 1rem; letter-spacing: 1px; word-break: break-all; }

.recovery-codes {
    columns: 2;
    padding: 14px 32px;
    margin: 12px 0;
    background: var(--input-bg);
    border: 1px dashed var(--line);
    border-radius: 10px;
    font-size: 1.05rem;
    line-height: 2;
    text-align: left;
}

@media (max-width: 420px) {
    .auth-card { padding: 22px 18px 18px; }
    .recovery-codes { columns: 1; }
}
