/* Каркас сайта (фон, шапка, подвал) и простые страницы: вход, покупка, заказ, админка. */

/* ---- фон: цветные поля + лёгкое «зерно» ---- */
.site { position: relative; isolation: isolate; min-height: 100vh; display: flow-root;
  background:
    radial-gradient(1100px 760px at 0% 0%, var(--m1), transparent 62%),
    radial-gradient(1000px 700px at 100% 8%, var(--m2), transparent 60%),
    radial-gradient(900px 800px at 40% 55%, var(--m3), transparent 62%),
    radial-gradient(1200px 900px at 100% 100%, var(--m4), transparent 60%),
    radial-gradient(900px 700px at 0% 85%, var(--m2), transparent 60%),
    var(--bg);
  background-attachment: fixed; }
.site::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

.testbar { text-align: center; font: 500 12px/1 var(--mono); letter-spacing: .04em; padding: 10px 12px 0; color: color-mix(in srgb, var(--amber) 70%, var(--ink)); }

/* ---- шапка ---- */
.topbar { position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; padding: 10px 10px 10px 18px; border-radius: 999px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--rule); }
.nav a.strong { color: var(--ink); font-weight: 600; }
@media (max-width: 860px) { .nav .nav-opt { display: none; } }

/* ---- подвал ---- */
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 32px 48px; font-size: 14px; color: var(--muted); }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ================= компоненты страниц (общие для сайта и кабинета) ================= */

/* колонка страницы и её заголовок */
.page { padding-block: clamp(28px, 5vw, 56px) 24px; display: grid; gap: 16px; }
.stack { display: grid; gap: 16px; }
.narrow { max-width: 760px; }
.full { flex-basis: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.page-head h1 { font: 600 clamp(28px, 3.4vw, 40px)/1 var(--display); letter-spacing: -0.045em; }
.page-head p { color: var(--muted); margin-top: 8px; }

/* текст-пояснение и подсказки */
.note { font-size: 14px; color: var(--muted); }
.note.sm { font-size: 13px; }
.hint { padding: 10px 14px; border-radius: 14px; font-size: 14px; background: var(--bg); }
.hint.warn { background: var(--amber-soft); }
.msg { padding: 14px 16px; border-radius: 16px; font-size: 15px; background: var(--amber-soft); }
.msg.err { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }

/* панель: белая карточка с тенью; заголовок панели с действиями справа */
.panel { display: grid; gap: 14px; padding: 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-h h2, .panel-h h3 { font: 600 16px var(--text); }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 7px; font: 600 12px/1 var(--mono); background: var(--bg); color: var(--muted); vertical-align: 1px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* поле ввода */
.field, select { font: 500 15px var(--text); color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 12px; padding: 0 14px; min-height: 44px; }
.field:focus, select:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 18%, transparent); }

/* выбор варианта (страна, срок): карточка с невидимой радиокнопкой */
.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.choice { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; cursor: pointer; background: var(--surface); box-shadow: 0 0 0 1px var(--rule); transition: box-shadow .15s ease; }
.choice:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { box-shadow: 0 0 0 2px var(--signal), 0 10px 24px -14px rgba(18,183,106,.7); }
.choice:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.choice .emoji { font-size: 22px; line-height: 1; }
.choice .t { font-weight: 600; }
.choice .s { display: block; font-size: 13px; color: var(--muted); }
.choices.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .choices.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.choice.period { flex-direction: column; align-items: flex-start; gap: 4px; }
.choice.period .sum { font: 600 22px/1 var(--display); letter-spacing: -0.03em; }
.choice .badge { position: absolute; top: 10px; right: 10px; }

/* итог и оплата внизу формы */
.checkout { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.checkout .total { font: 600 28px/1 var(--display); letter-spacing: -0.04em; }

/* карточка по центру: вход, статус заказа, возврат в приложение */
.auth { width: min(440px, 100%); margin: clamp(16px, 6vh, 64px) auto 0; display: grid; gap: 16px; justify-items: stretch; padding: clamp(22px, 4vw, 32px); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.auth h1 { font: 600 28px/1.1 var(--display); letter-spacing: -0.04em; }
.auth .lead { color: var(--muted); }
.auth .badge + h1 { margin-top: 12px; }
.auth .icon-hero { justify-self: center; }
.auth .btn { width: 100%; }
.auth form { display: grid; gap: 10px; }
.auth .inline { display: flex; gap: 8px; }
.auth .inline .field { flex: 1; min-width: 0; }
.auth .inline .btn { width: auto; }

.auth.wide-auth { width: min(560px, 100%); }
.steps-list { display: grid; gap: 10px; text-align: left; }
.steps-list h2 { font: 600 17px var(--text); }
.steps-list ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 15px; }
.auth .hint { text-align: left; }

/* кнопки входа через сервисы */
.provider { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.provider:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); background: var(--bg); }
.provider .ic { width: 20px; height: 20px; }
.divider { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* большой значок состояния (заказ, оплата, приложение) */
.icon-hero { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; color: #fff; background: linear-gradient(150deg, #3FE08F, #12B76A); box-shadow: 0 14px 28px -12px rgba(18,183,106,.75), inset 0 1px 0 rgba(255,255,255,.35); }
.icon-hero .ic { width: 30px; height: 30px; }
.icon-hero.warn { background: linear-gradient(150deg, #FFB547, #F08C0C); box-shadow: 0 14px 28px -12px rgba(240,140,12,.75), inset 0 1px 0 rgba(255,255,255,.35); }
.icon-hero.bad { background: linear-gradient(150deg, #FF7A7E, var(--danger)); box-shadow: 0 14px 28px -12px rgba(229,72,77,.7), inset 0 1px 0 rgba(255,255,255,.35); }
.icon-hero.wait { background: linear-gradient(150deg, #6FB0FF, #3478F6); box-shadow: 0 14px 28px -12px rgba(52,120,246,.7), inset 0 1px 0 rgba(255,255,255,.35); }
.icon-hero.wait .ic { animation: spin 1.2s linear infinite; }
.icon-hero.brand { background: none; box-shadow: none; color: var(--ink); }
.icon-hero.brand .mark { width: 64px; height: 64px; }

/* таблицы */
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
td, th { padding: 10px 8px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }

/* старые классы — только для админки, уйдут при её переделке */
.card { background: var(--surface); box-shadow: var(--shadow); border-radius: 24px; padding: 24px; margin: 12px 0; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
input[type=number] { font: 500 15px var(--text); color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 12px; padding: 0 14px; min-height: 40px; }

/* ================= страница скачивания ================= */
.dl-page { display: grid; gap: 28px; }
.dl-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: clamp(20px, 3vw, 32px); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.dl-hero > div { flex: 1; min-width: 240px; }
.dl-hero h1 { font: 600 clamp(28px, 3.4vw, 40px)/1.05 var(--display); letter-spacing: -0.045em; }
.dl-hero .lead { color: var(--muted); margin-top: 6px; }
.dl-h { font: 600 22px/1.2 var(--display); letter-spacing: -0.03em; margin-bottom: 14px; }
.dl-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); counter-reset: dl; }
.dl-step { counter-increment: dl; display: grid; gap: 8px; align-content: start; padding: 16px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.dl-step > b::before { content: counter(dl) ". "; color: var(--muted); }
.dl-step .btn { justify-self: start; }
.dl-step .btn.wide { justify-self: stretch; margin-top: 4px; }
.dl-terminal .cmd { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 14px; background: #0C0D10; color: #EDEFF2; }
.dl-terminal code { flex: 1; font: 400 14px/1.4 var(--mono); overflow-wrap: anywhere; }
.dl-terminal .btn-icon { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: #C9CDD3; }

/* иллюстрации шагов — упрощённые окна macOS */
.ill { position: relative; height: 176px; border-radius: 16px; padding: 14px; overflow: hidden; display: grid; place-content: center; gap: 6px; font-size: 12px;
  background: linear-gradient(160deg, var(--m4), var(--m2)); box-shadow: inset 0 0 0 1px var(--rule); }
.ill-app { width: 46px; height: 46px; color: var(--ink); justify-self: center; }
.ill-app .mark { width: 100%; height: 100%; }
.ill-app.sm { width: 34px; height: 34px; }
.ill-app.xs { width: 20px; height: 20px; }
.ill-dmg { grid-template-columns: auto auto auto; align-items: center; column-gap: 14px; }
.ill-arrow { color: var(--muted); } .ill-arrow .ic { width: 22px; height: 22px; }
.ill-folder { position: relative; width: 52px; height: 40px; border-radius: 8px; background: linear-gradient(180deg, #6FB7F5, #3D8EE6); }
.ill-folder::before { content: ""; position: absolute; left: 4px; top: -6px; width: 20px; height: 9px; border-radius: 4px 4px 0 0; background: #5AA5EF; }
.ill-cap { text-align: center; color: var(--muted); font-size: 11px; }
.ill-alert { width: 82%; justify-self: center; margin: auto; padding: 10px 12px; gap: 4px; border-radius: 14px; background: var(--surface); box-shadow: 0 10px 30px -12px rgba(0,0,0,.35); text-align: center; place-content: stretch; }
.ill-alert b { font-size: 12px; } .ill-alert span:not(.ill-btn):not(.ill-app) { color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.ill-btn { display: block; padding: 4px 8px; border-radius: 8px; font-size: 11px; font-weight: 600; background: var(--bg); text-align: center; }
.ill-btn.hl { background: var(--sky); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky) 30%, transparent); }
.ill-settings { place-content: stretch; align-content: center; padding: 14px 16px; }
.ill-title { font: 600 13px var(--text); }
.ill-row { color: var(--muted); font-size: 11px; padding: 8px 10px; border-radius: 10px; background: var(--surface); }
.ill-settings .ill-btn { justify-self: end; }
.ill-bar { place-content: stretch; align-content: start; padding: 0; }
.ill-menubar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; height: 26px; padding: 0 12px; background: color-mix(in srgb, var(--surface) 70%, transparent); font-size: 11px; }
.ill-menubar .ic { width: 13px; height: 13px; }
.ill-tray { display: grid; place-items: center; width: 22px; height: 18px; border-radius: 5px; background: color-mix(in srgb, var(--ink) 12%, transparent); --tray-cut: var(--surface); }
.ill-login { margin: 18px auto 0; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; width: 70%; padding: 10px 12px; border-radius: 12px; background: var(--surface); box-shadow: 0 10px 24px -14px rgba(0,0,0,.35); }
.ill-login small { grid-column: 2; color: var(--muted); font-size: 10.5px; }
