:root {
    --bg: #0f1621;
    --bg-2: #16202e;
    --card: #1c2836;
    --card-2: #223145;
    --line: #2b3b50;
    --fg: #eaf0f7;
    --muted: #9fb0c3;
    --accent: #3b82f6;
    --accent-2: #2563eb;
    --danger: #f87171;
    --ok: #34d399;
    --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
}

.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

/* --- Экран входа --- */
.brand { text-align: center; margin: 24px 0 20px; }
.brand__logo { font-size: 44px; line-height: 1; }
.brand__title { margin: 12px 0 4px; font-size: 24px; font-weight: 700; }
.brand__sub { margin: 0; color: var(--muted); font-size: 14px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; color: var(--muted); }

input[type="tel"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 17px;
    color: var(--fg);
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color .15s;
}
input[type="tel"]:focus { border-color: var(--accent); }

/* --- Кнопки --- */
.btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .05s, background .15s, border-color .15s;
    color: var(--fg);
    background: var(--card-2);
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--accent); border-color: var(--accent-2); color: #fff; }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn--ghost:hover { color: var(--fg); border-color: var(--muted); }
.btn--store { background: var(--card-2); border-color: var(--line); margin-bottom: 10px; }
.btn--store:last-child { margin-bottom: 0; }
.btn--sm { width: auto; padding: 8px 14px; font-size: 14px; }
.btn + .btn { margin-top: 10px; }
.btn--bitrix {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: #2fc6f6; border-color: #16a3d0; color: #04222e; font-size: 17px; padding: 15px 16px;
}
.btn--bitrix:hover { background: #22b4e4; }
.btn-ico {
    font-weight: 800; font-size: 13px; letter-spacing: .5px;
    background: rgba(255,255,255,.35); color: #04222e;
    padding: 3px 7px; border-radius: 7px;
}

/* --- Сообщения / подсказки --- */
.msg { font-size: 14px; margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; }
.msg--error { color: var(--danger); background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.25); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; line-height: 1.45; }
.note { color: var(--muted); text-align: center; }

/* --- Топбар кабинета --- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding: 4px 2px;
}
.topbar__hello { font-size: 13px; color: var(--muted); }
.topbar__name { font-size: 20px; font-weight: 700; }

/* --- Карточки кабинета --- */
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card__head h2 { font-size: 17px; margin: 0; font-weight: 700; }
.step {
    flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent); color: #fff; font-size: 14px; font-weight: 700;
}
.card__text { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 16px; }

.qr-wrap { display: grid; place-items: center; margin: 4px 0 16px; }
.qr {
    width: 200px; height: 200px; border-radius: 12px;
    background: #fff; padding: 10px; image-rendering: pixelated;
}

.url {
    display: block; margin-top: 12px; padding: 10px 12px;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
    font-size: 12px; color: var(--muted); word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.applinks { display: flex; flex-direction: column; }

.steps { margin: 0; padding-left: 20px; color: var(--fg); font-size: 14px; line-height: 1.6; }
.steps li { margin-bottom: 8px; }
.steps b { color: #fff; }

[hidden] { display: none !important; }
