/* Peshbar SSO — страницы входа и личного кабинета. Без сборки и без JS. */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-muted: #f8f9fb;
    --border: #e2e5ea;
    --text: #1b1f24;
    --text-muted: #5f6873;
    --accent: #2457d6;
    --accent-hover: #1c47b3;
    --accent-text: #ffffff;
    --danger: #c0352b;
    --danger-bg: #fdf0ef;
    --success: #1f7a4d;
    --success-bg: #ecf7f1;
    --focus: rgba(36, 87, 214, 0.35);
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1216;
        --surface: #171b21;
        --surface-muted: #1d222a;
        --border: #2a3039;
        --text: #e7eaee;
        --text-muted: #9aa3ad;
        --accent: #6b93ff;
        --accent-hover: #86a7ff;
        --accent-text: #0b0e13;
        --danger: #ff7b70;
        --danger-bg: #2b1715;
        --success: #5fd39a;
        --success-bg: #12261c;
        --focus: rgba(107, 147, 255, 0.4);
        --shadow: none;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 48px 16px 64px;
}

.shell.wide { max-width: 760px; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.01em;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #7c4dff);
    flex: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar .brand { margin-bottom: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.card + .card { margin-top: 16px; }

h1 { margin: 0 0 6px; font-size: 22px; line-height: 1.3; font-weight: 650; }
h2 { margin: 0 0 14px; font-size: 16px; font-weight: 650; }

.lead { margin: 0 0 22px; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

.field { margin-bottom: 16px; }

label { display: block; margin-bottom: 6px; font-weight: 550; font-size: 14px; }

input[type=text], input[type=password], input[type=email], input[type=tel] {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }

input.code { font-size: 20px; letter-spacing: 0.25em; text-align: center; font-variant-numeric: tabular-nums; }

.error-text { margin-top: 6px; color: var(--danger); font-size: 13px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 600;
    color: var(--accent-text);
    background: var(--accent);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.button:hover { background: var(--accent-hover); text-decoration: none; }
.button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.button.block { width: 100%; }

.button.secondary { color: var(--text); background: var(--surface); border-color: var(--border); }
.button.secondary:hover { background: var(--surface-muted); }

.button.danger { color: var(--danger); background: var(--surface); border-color: var(--border); }
.button.danger:hover { background: var(--danger-bg); }

.button.small { padding: 6px 10px; font-size: 13px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert.error { color: var(--danger); background: var(--danger-bg); }
.alert.success { color: var(--success); background: var(--success-bg); }

details { margin-top: 18px; color: var(--text-muted); font-size: 14px; }
summary { cursor: pointer; color: var(--accent); }
details p { margin: 8px 0 0; }

.qr { display: flex; justify-content: center; padding: 16px; margin: 4px 0 16px; background: #fff; border-radius: 8px; border: 1px solid var(--border); }
.qr svg { width: 200px; height: 200px; display: block; }

.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; word-break: break-all; padding: 10px 12px; background: var(--surface-muted); border-radius: 8px; }

.steps { margin: 0 0 18px; padding-left: 20px; color: var(--text-muted); }
.steps li + li { margin-top: 4px; }

.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.codes li { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; padding: 8px 10px; text-align: center; background: var(--surface-muted); border-radius: 6px; }

.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }

.app-tile {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface-muted);
    transition: border-color 0.15s;
}

a.app-tile:hover { border-color: var(--accent); text-decoration: none; }
.app-tile strong { display: block; margin-bottom: 2px; }
.app-tile span { display: block; font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .meta { min-width: 0; }
.list .meta strong { display: block; font-weight: 550; }
.list .meta span { display: block; font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }

.badge { display: inline-block; padding: 2px 8px; margin-left: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; color: var(--success); background: var(--success-bg); vertical-align: middle; }
.badge.off { color: var(--text-muted); background: var(--surface-muted); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.inline-form { display: inline; margin: 0; }

.footer { margin-top: 24px; text-align: center; font-size: 13px; color: var(--text-muted); }

@media (max-width: 560px) {
    .shell { padding-top: 24px; }
    .card { padding: 20px; }
    .grid-2 { grid-template-columns: 1fr; }
    .list li { flex-direction: column; align-items: flex-start; }
}

.topbar a.brand { color: inherit; text-decoration: none; }

.m-0 { margin: 0; }
.mb-4 { margin-bottom: 4px; }
details.mb-18 { margin: 0 0 18px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.list .meta span.badge { display: inline-block; }

.telegram-widget { display: flex; justify-content: center; min-height: 48px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
