:root {
    --bg: #0f1222;
    --bg-2: #171b33;
    --card: rgba(255, 255, 255, 0.055);
    --stroke: rgba(255, 255, 255, 0.10);
    --stroke-soft: rgba(255, 255, 255, 0.06);
    --text: #f2f4fb;
    --muted: #9aa2c0;
    --accent: #6d5efc;
    --accent-2: #c04cfd;
    --ok: #2dd4a7;
    --warn: #f5a524;
    --radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding: 20px 16px 28px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

/* ---------- Фон ---------- */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 50% -10%, #1d2145 0%, transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
}

.blob-1 {
    width: 320px;
    height: 320px;
    top: -110px;
    left: -90px;
    background: var(--accent);
}

.blob-2 {
    width: 280px;
    height: 280px;
    top: 22%;
    right: -110px;
    background: var(--accent-2);
    opacity: 0.42;
}

.blob-3 {
    width: 340px;
    height: 340px;
    bottom: -140px;
    left: -60px;
    background: #1e6fd9;
    opacity: 0.35;
}

.grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(100% 65% at 50% 0%, #000 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(100% 65% at 50% 0%, #000 0%, transparent 80%);
}

/* ---------- Рамка контента ---------- */
.wrap {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---------- Шапка ---------- */
.head {
    text-align: center;
    padding: 4px 0 2px;
}

.title {
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.5px;
    line-height: 1.2;
    background: linear-gradient(180deg, #ffffff 30%, #b9bed8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 450;
    color: var(--muted);
}

/* ---------- Прогресс ---------- */
.progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.progress-track {
    flex: 1;
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-count {
    font-size: 12px;
    font-weight: 650;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    min-width: 34px;
    text-align: right;
}

/* ---------- Шаги ---------- */
.steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 15px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--stroke-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.25s ease, background 0.25s ease, opacity 0.25s ease, transform 0.18s ease;
}

.step:active {
    transform: scale(0.985);
}

.step.done {
    opacity: 0.55;
    border-color: rgba(45, 212, 167, 0.28);
}

.step-num {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    box-shadow: 0 4px 12px rgba(109, 94, 252, 0.35);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.step.done .step-num {
    background: var(--ok);
    box-shadow: 0 4px 12px rgba(45, 212, 167, 0.3);
}

.step-body {
    flex: 1;
    min-width: 0;
}

.step-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text);
}

.step-text {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
}

.step-check {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.step-check:hover {
    border-color: var(--accent);
    transform: scale(1.06);
}

.step-check svg {
    width: 15px;
    height: 15px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.step.done .step-check {
    background: var(--ok);
    border-color: var(--ok);
}

.step.done .step-check svg {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Предупреждение ---------- */
.notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 14px;
    background: rgba(245, 165, 36, 0.09);
    border: 1px solid rgba(245, 165, 36, 0.22);
}

.notice-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--warn);
}

.notice-text {
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
    color: #f0dcb8;
}

/* ---------- Тост ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(22px + env(safe-area-inset-bottom));
    transform: translate(-50%, 20px);
    background: rgba(28, 32, 54, 0.96);
    border: 1px solid var(--stroke);
    color: #fff;
    padding: 11px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 550;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: 86vw;
    text-align: center;
    z-index: 50;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Светлая тема Telegram ---------- */
body.tg-light {
    --bg: #f3f4f9;
    --bg-2: #e9ebf4;
    --card: rgba(255, 255, 255, 0.85);
    --stroke: rgba(16, 20, 40, 0.12);
    --stroke-soft: rgba(16, 20, 40, 0.07);
    --text: #14172b;
    --muted: #6a7090;
}

body.tg-light .title {
    background: linear-gradient(180deg, #14172b 30%, #4b5175 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.tg-light .blob {
    opacity: 0.3;
}

body.tg-light .grid {
    background-image:
        linear-gradient(rgba(16, 20, 40, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 20, 40, 0.04) 1px, transparent 1px);
}

body.tg-light .progress-track {
    background: rgba(16, 20, 40, 0.1);
}

body.tg-light .step-text {
    color: #5d6384;
}

body.tg-light .notice-text {
    color: #6d4c14;
}

body.tg-light .notice {
    background: rgba(245, 165, 36, 0.12);
}

body.tg-light .toast {
    background: rgba(255, 255, 255, 0.97);
    color: #14172b;
}
