:root {
  --brand: #e92215;
  --brand-dark: #bf180f;
  --brand-soft: #fff0ee;
  --green: #159447;
  --green-dark: #0d7937;
  --green-soft: #eaf7ef;
  --ink: #181a1f;
  --muted: #6d737d;
  --line: #e5e7eb;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --page: #f1f3f5;
  --shadow: 0 18px 48px rgba(30, 35, 45, .09);
  --radius: 22px;
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
  --safe-top: max(0px, env(safe-area-inset-top));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: light; background: var(--page); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--page); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 3px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.site-header { background:rgba(255,255,255,.96); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:50; backdrop-filter:blur(16px); }
.site-header__inner { max-width:1240px; height:76px; margin:auto; padding:0 24px; display:flex; align-items:center; gap:28px; }
.brand { display:inline-flex; align-items:center; gap:10px; color:var(--ink); }
.brand--button { border:0; background:transparent; padding:0; text-align:left; }
.brand-mark { width:38px; height:38px; border-radius:12px; display:grid; place-items:center; background:var(--brand); color:#fff; font-weight:900; box-shadow:inset 0 -8px 18px rgba(0,0,0,.12); }
.brand-copy { display:flex; flex-direction:column; line-height:1.05; }
.brand-copy strong { font-size:18px; }
.brand-copy small { color:var(--muted); margin-top:4px; font-size:11px; }
.site-nav { display:flex; gap:6px; margin-left:auto; }
.site-nav button { border:0; background:transparent; color:#414650; padding:10px 12px; border-radius:10px; }
.site-nav button:hover { background:var(--surface-2); color:var(--brand); }
.site-header__actions { display:flex; align-items:center; gap:12px; }
.language-switch { display:inline-grid; grid-template-columns:1fr 1fr; border:1px solid #ffc3be; background:#fff; border-radius:10px; overflow:hidden; }
.language-switch button { min-width:38px; border:0; background:#fff; color:var(--muted); padding:7px 8px; }
.language-switch button.is-active { background:var(--brand); color:#fff; }
.language-switch--compact button { padding:5px 7px; min-width:34px; font-size:12px; }

.btn { border:1px solid transparent; border-radius:13px; min-height:46px; padding:11px 16px; font-weight:750; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.btn-primary { background:var(--brand); color:#fff; }
.btn-primary:hover { background:var(--brand-dark); }
.btn-secondary { background:#fff; border-color:var(--line); color:var(--ink); }
.btn-secondary:hover { border-color:#ffaaa3; color:var(--brand); }
.btn-green { background:var(--green); color:#fff; }
.btn-block { width:100%; }
.btn-link { background:transparent; color:var(--brand); border:0; padding:8px; font-weight:700; }

.runtime-shell { max-width:1240px; margin:30px auto 60px; padding:0 24px; display:grid; grid-template-columns:240px minmax(0,1fr); gap:24px; }
.side-nav { min-height:690px; background:#fff; border:1px solid var(--line); border-radius:24px; padding:18px; display:flex; flex-direction:column; gap:24px; align-self:start; position:sticky; top:106px; }
.side-nav__brand { display:flex; align-items:center; gap:10px; padding-bottom:16px; border-bottom:1px solid var(--line); }
.side-nav__brand > div { display:flex; flex-direction:column; }
.side-nav__brand small { color:var(--muted); margin-top:3px; }
.side-nav nav { display:grid; gap:7px; }
.nav-item { border:0; background:transparent; color:#505660; display:flex; align-items:center; gap:10px; padding:11px 12px; border-radius:13px; font-weight:700; }
.nav-item.is-active { background:var(--brand-soft); color:var(--brand); }
.nav-item svg { width:23px; height:23px; }
.side-nav__note { margin-top:auto; padding:14px; border-radius:16px; background:var(--surface-2); display:grid; gap:5px; }
.side-nav__note span { font-size:12px; color:var(--muted); line-height:1.4; }

.app-surface { min-height:760px; background:var(--surface); border:1px solid var(--line); border-radius:28px; box-shadow:var(--shadow); overflow:hidden; position:relative; }
.app-topbar { min-height:68px; padding:12px 18px; display:flex; align-items:center; border-bottom:1px solid var(--line); background:#fff; position:sticky; top:76px; z-index:20; }
.app-back { border:0; background:var(--surface-2); width:38px; height:38px; border-radius:12px; display:grid; place-items:center; margin-right:9px; }
.app-back svg { width:21px; height:21px; }
.app-brand .brand-mark { width:34px; height:34px; border-radius:10px; }
.app-brand .brand-copy strong { font-size:16px; }
.app-topbar__right { margin-left:auto; display:flex; align-items:center; gap:10px; }
.runtime-badge { color:var(--brand); background:var(--brand-soft); border-radius:999px; padding:6px 9px; font-size:11px; font-weight:800; }
.app-content { padding:26px; padding-bottom:38px; max-width:970px; margin:0 auto; }
.bottom-nav { display:none; }

/* The desktop website already has its own full header and navigation.
   Keep the compact app topbar only for PWA, Telegram and mobile web shells. */
body[data-runtime="web"][data-viewport="desktop"] .app-topbar { display:none; }

.hero { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr); gap:20px; align-items:stretch; }
.hero-copy { background:var(--brand-soft); border-radius:24px; padding:28px; display:flex; flex-direction:column; justify-content:center; min-height:270px; }
.eyebrow { color:var(--brand); font-weight:800; font-size:13px; text-transform:uppercase; letter-spacing:.06em; }
h1,h2,h3,p { margin-top:0; }
h1 { font-size:clamp(30px,4vw,52px); line-height:1.03; margin:10px 0 14px; }
h2 { font-size:27px; margin-bottom:8px; }
h3 { font-size:18px; margin-bottom:7px; }
.lead { color:#4e535d; font-size:17px; line-height:1.55; max-width:650px; }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }
.hero-visual { border-radius:24px; background:linear-gradient(145deg,#fff 0%,#ffe9e6 100%); display:grid; place-items:center; min-height:270px; overflow:hidden; position:relative; }
.hero-visual__shield { width:150px; height:180px; background:var(--brand); clip-path:polygon(50% 0,93% 15%,87% 70%,50% 100%,13% 70%,7% 15%); display:grid; place-items:center; color:#fff; font-size:72px; font-weight:900; filter:drop-shadow(0 20px 22px rgba(233,34,21,.24)); }

.section { margin-top:26px; }
.section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:14px; margin-bottom:14px; }
.section-heading p { margin:0; color:var(--muted); font-size:14px; }
.product-grid, .feature-grid, .offers-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.product-card, .feature-card, .card, .offer-card { border:1px solid var(--line); border-radius:20px; background:#fff; }
.product-card { padding:20px; display:flex; align-items:center; gap:15px; text-align:left; transition:.18s ease; }
.product-card:hover { border-color:#ffb1aa; transform:translateY(-2px); }
.product-card--green:hover { border-color:#96d9ad; }
.product-icon { flex:0 0 auto; width:54px; height:54px; border-radius:17px; display:grid; place-items:center; background:var(--brand); color:#fff; }
.product-icon.green { background:var(--green); }
.product-icon svg { width:29px; height:29px; }
.product-card__copy { flex:1; }
.product-card__copy h3 { margin:0 0 4px; }
.product-card__copy p { margin:0; color:var(--muted); font-size:13px; line-height:1.4; }
.product-card__arrow { color:var(--muted); }
.feature-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.feature-card { padding:16px; }
.feature-card svg { width:26px; height:26px; color:var(--brand); margin-bottom:10px; }
.feature-card strong { display:block; }
.feature-card span { display:block; color:var(--muted); font-size:13px; margin-top:4px; }

.flow-head { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom:18px; }
.progress-wrap { min-width:230px; }
.step-badge { display:inline-block; float:right; border:1px solid #ffb7b1; color:var(--brand); border-radius:999px; padding:6px 10px; font-size:12px; font-weight:800; margin-bottom:8px; }
.progress { clear:both; height:8px; background:#eceef1; border-radius:99px; overflow:hidden; }
.progress > span { display:block; height:100%; width:33%; background:var(--brand); border-radius:99px; }
.progress.green > span { background:var(--green); }
.form-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:18px; align-items:start; }
.card { padding:20px; }
.summary-card {
  position: sticky;
  /* top: 205px; */
  align-self: start;
}
.field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
.field-grid .span-2 { grid-column:1/-1; }
.field label { display:block; font-size:13px; font-weight:800; margin-bottom:7px; }
.field input, .field select { width:100%; min-width:0; border:1px solid var(--line); border-radius:13px; background:#fff; padding:12px 13px; color:var(--ink); }
.field input::placeholder { color:#9aa0a9; }
.helper { margin-top:6px; color:var(--muted); font-size:12px; line-height:1.4; }
.api-error { margin:16px 0 0; padding:12px 14px; border:1px solid #f2a49e; border-radius:12px; background:var(--brand-soft); color:var(--brand-dark); font-size:14px; line-height:1.4; }
.date-notice { margin:0 0 16px; padding:12px 14px; border:1px solid #9bd4ae; border-radius:12px; background:var(--green-soft); color:var(--green-dark); font-size:14px; line-height:1.4; }
.btn[aria-busy="true"] { cursor:wait; opacity:.78; }
.form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }
.data-list { display:grid; gap:0; }
.data-row { display:flex; justify-content:space-between; gap:16px; padding:12px 0; border-bottom:1px solid var(--line); }
.data-row:last-child { border-bottom:0; }
.data-row span:first-child { color:var(--muted); }
.data-row strong { text-align:right; }

.chips { display:flex; flex-wrap:wrap; gap:9px; }
.chip { border:1px solid var(--line); border-radius:12px; background:#fff; padding:10px 14px; color:var(--ink); }
.chip.is-active { border-color:var(--brand); background:var(--brand-soft); color:var(--brand); font-weight:800; }
.chip.green.is-active { border-color:var(--green); background:var(--green-soft); color:var(--green); }

.offers-grid { grid-template-columns:1fr; }
.offer-card { padding:18px; display:grid; grid-template-columns:1fr auto; gap:12px 18px; align-items:center; }
.offer-card.is-best { border:2px solid var(--green); }
.offer-card__top { display:flex; align-items:center; gap:10px; }
.offer-logo { width:42px; height:42px; border-radius:14px; display:grid; place-items:center; color:#fff; background:var(--brand); font-weight:900; }
.offer-logo.green { background:var(--green); }
.offer-price { font-size:23px; font-weight:900; color:var(--green); }
.offer-meta { color:var(--muted); font-size:13px; }
.best-badge { display:inline-flex; align-items:center; gap:5px; background:var(--green-soft); color:var(--green-dark); border-radius:999px; padding:5px 8px; font-size:11px; font-weight:800; margin-bottom:8px; }

.payment-option { display:flex; align-items:center; gap:12px; padding:14px; border:1px solid var(--line); border-radius:15px; margin-top:10px; }
.payment-option input { width:18px; height:18px; accent-color:var(--brand); margin-left:auto; }
.pay-logo { width:46px; height:38px; border-radius:11px; background:var(--surface-2); display:grid; place-items:center; font-weight:900; color:var(--green-dark); }
.success { text-align:center; max-width:680px; margin:20px auto; }
.success-mark { width:96px; height:96px; border-radius:50%; background:var(--green); color:#fff; display:grid; place-items:center; font-size:48px; margin:0 auto 18px; }
.action-stack { display:grid; gap:10px; margin-top:18px; }

.policy-list { display:grid; gap:14px; }
.policy-card { padding:18px; border:1px solid var(--line); border-radius:18px; }
.policy-card__head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.status { border-radius:999px; padding:5px 8px; font-size:11px; font-weight:800; background:var(--green-soft); color:var(--green-dark); }
.status.expired { background:#f0f1f3; color:#70757e; }
.tabs { display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--line); border-radius:13px; overflow:hidden; margin-bottom:15px; }
.tabs button { border:0; background:#fff; padding:10px; font-weight:800; }
.tabs button.is-active { background:var(--brand); color:#fff; }
.profile-card { display:grid; grid-template-columns:auto 1fr; gap:15px; align-items:center; }
.avatar { width:72px; height:72px; border-radius:50%; background:#e8eaee; display:grid; place-items:center; font-size:28px; font-weight:800; color:#6f7580; }
.settings-list { display:grid; gap:9px; margin-top:16px; }
.setting-row { width:100%; border:1px solid var(--line); background:#fff; border-radius:15px; padding:14px; display:flex; align-items:center; gap:10px; text-align:left; }
.setting-row span:last-child { margin-left:auto; color:var(--muted); }

.toast { position:fixed; left:50%; bottom:24px; transform:translate(-50%,20px); opacity:0; pointer-events:none; background:#17191d; color:#fff; padding:11px 15px; border-radius:12px; z-index:200; transition:.2s; }
.toast.is-visible { opacity:1; transform:translate(-50%,0); }

/* Mobile, PWA and Telegram share one component layer. Only the outer shell changes. */
body[data-runtime="pwa"], body[data-runtime="telegram"] { background:#fff; }
body[data-runtime="pwa"] .site-header,
body[data-runtime="telegram"] .site-header,
body[data-runtime="pwa"] .side-nav,
body[data-runtime="telegram"] .side-nav { display:none; }
body[data-runtime="pwa"] .runtime-shell,
body[data-runtime="telegram"] .runtime-shell { display:block; max-width:none; margin:0; padding:0; }
body[data-runtime="pwa"] .app-surface,
body[data-runtime="telegram"] .app-surface { min-height:100dvh; border:0; border-radius:0; box-shadow:none; }
body[data-runtime="pwa"] .app-topbar,
body[data-runtime="telegram"] .app-topbar { top:0; padding-top:calc(12px + var(--safe-top)); }
body[data-runtime="pwa"] .app-content,
body[data-runtime="telegram"] .app-content { padding-bottom:calc(92px + var(--safe-bottom)); }
body[data-runtime="pwa"] .bottom-nav,
body[data-runtime="telegram"] .bottom-nav { display:grid; grid-template-columns:repeat(3,1fr); position:fixed; left:0; right:0; bottom:0; z-index:30; background:rgba(255,255,255,.96); border-top:1px solid var(--line); padding:8px 10px var(--safe-bottom); backdrop-filter:blur(16px); }
body[data-runtime="pwa"] .bottom-nav .nav-item,
body[data-runtime="telegram"] .bottom-nav .nav-item { flex-direction:column; gap:3px; justify-content:center; font-size:11px; padding:7px 4px; }
body[data-runtime="pwa"] .app-mode-label::after { content:"PWA"; }
body[data-runtime="telegram"] .app-topbar { background:var(--surface); }
body[data-runtime="telegram"] .runtime-badge { background:#e8f2ff; color:#1675d1; }

body[data-viewport="mobile"][data-runtime="web"] .site-header { display:none; }
body[data-viewport="mobile"][data-runtime="web"] .side-nav { display:none; }
body[data-viewport="mobile"][data-runtime="web"] .runtime-shell { display:block; max-width:none; margin:0; padding:0; }
body[data-viewport="mobile"][data-runtime="web"] .app-surface { min-height:100dvh; border-radius:0; }
body[data-viewport="mobile"][data-runtime="web"] .app-topbar { top:0; }
body[data-viewport="mobile"][data-runtime="web"] .bottom-nav { display:grid; grid-template-columns:repeat(3,1fr); position:fixed; left:0; right:0; bottom:0; z-index:30; background:#fff; border-top:1px solid var(--line); padding:8px 8px var(--safe-bottom); }
body[data-viewport="mobile"][data-runtime="web"] .bottom-nav .nav-item { flex-direction:column; font-size:11px; gap:3px; justify-content:center; }

@media (max-width: 820px) {
  .site-header { display:none; }
  .side-nav { display:none; }
  .runtime-shell { display:block; margin:0; padding:0; }
  .app-surface { border-radius:0; border-left:0; border-right:0; box-shadow:none; min-height:100dvh; }
  .app-topbar { top:0; }
  .app-content { padding:20px 16px 96px; }
  .bottom-nav { display:grid; grid-template-columns:repeat(3,1fr); position:fixed; bottom:0; left:0; right:0; z-index:30; background:#fff; border-top:1px solid var(--line); padding:8px 8px var(--safe-bottom); }
  .bottom-nav .nav-item { flex-direction:column; justify-content:center; font-size:11px; gap:3px; }
  .hero, .form-layout { grid-template-columns:1fr; }
  .hero-copy, .hero-visual { min-height:220px; }
  .summary-card { position:static; }
  .field-grid { grid-template-columns:1fr; }
  .field-grid .span-2 { grid-column:auto; }
  .product-grid, .feature-grid { grid-template-columns:1fr; }
  .flow-head { flex-direction:column; }
  .progress-wrap { width:100%; min-width:0; }
}


/* UI polish: consistent rhythm, cleaner cards and mobile-first controls */
.app-content { width: 100%; }
.section-heading h2 { margin-bottom: 6px; }
.card, .product-card, .feature-card, .offer-card, .policy-card, .payment-option {
  box-shadow: 0 6px 18px rgba(28, 32, 40, .035);
}

/* Offers */
.offer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "badge badge"
    "main action"
    "meta action";
  gap: 10px 16px;
  padding: 18px;
}
.offer-card .best-badge { grid-area: badge; justify-self: start; margin: 0; }
.offer-main { grid-area: main; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.offer-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.offer-identity h3 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offer-price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.offer-meta { grid-area: meta; min-width: 0; }
.offer-action { grid-area: action; align-self: center; min-width: 112px; }

/* Contact confirmations */
.field .helper { font-weight: 500; }
.field.span-2 > label.helper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 11px 0 0;
  color: #505761;
  line-height: 1.45;
  cursor: pointer;
}
.field.span-2 > label.helper input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}
.agreements > .agreement-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  margin: 11px 0 0;
  color: #505761;
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
}
.agreements > .agreement-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 1px 0 0;
  accent-color: var(--brand);
}
.agreements > .agreement-option > span { min-width: 0; }

/* Payment options */
.payment-option { min-height: 74px; padding: 14px 16px; }
.payment-option > * { min-width: 0; }
.payment-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.payment-copy strong { line-height: 1.2; }
.payment-description { color: var(--muted); font-size: 13px; line-height: 1.35; }
.payment-option input[type="radio"] { flex: 0 0 auto; }

@media (max-width: 820px) {
  h1 { font-size: clamp(32px, 9vw, 42px); line-height: 1.05; }
  h2 { font-size: 28px; line-height: 1.12; }
  .lead { font-size: 15.5px; line-height: 1.5; }
  .app-content { padding: 20px 14px calc(94px + var(--safe-bottom)); }
  .section { margin-top: 22px; }
  .section-heading { align-items: flex-start; margin-bottom: 12px; }
  .card { padding: 18px; border-radius: 18px; }

  /* Hero becomes one compact visual card instead of two tall blocks. */
  .hero { display: block; overflow: hidden; border-radius: 24px; background: var(--brand-soft); }
  .hero-copy { min-height: 0; padding: 24px 22px 21px; border-radius: 0; }
  .hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .hero-actions .btn { width: 100%; }
  .hero-visual { min-height: 128px; border-radius: 0; background: rgba(255,255,255,.34); border-top: 1px solid rgba(233,34,21,.08); }
  .hero-visual__shield { width: 82px; height: 98px; font-size: 42px; filter: drop-shadow(0 12px 14px rgba(233,34,21,.18)); }

  .product-card { padding: 16px; border-radius: 18px; }
  .product-icon { width: 50px; height: 50px; border-radius: 15px; }

  /* Benefits are compact horizontal rows on mobile. */
  .feature-grid { grid-template-columns: 1fr; gap: 10px; }
  .feature-card {
    display: grid;
    grid-template-columns: 34px minmax(0,1fr);
    grid-template-areas: "icon title" "icon text";
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    padding: 15px 16px;
  }
  .feature-card svg { grid-area: icon; margin: 0; width: 27px; height: 27px; }
  .feature-card strong { grid-area: title; }
  .feature-card span { grid-area: text; margin: 0; }

  .form-layout { gap: 14px; }
  .field-grid { gap: 16px; }
  .field input, .field select { min-height: 48px; padding: 12px 13px; }
  .form-actions { display: grid; grid-template-columns: 1fr; margin-top: 18px; }
  .form-actions .btn { width: 100%; }
  .chips { gap: 8px; }
  .chip { min-height: 44px; padding: 10px 15px; }

  /* Offer layout: clear hierarchy, full-width CTA, no squeezed prices. */
  .offer-card {
    grid-template-columns: 1fr;
    grid-template-areas: "badge" "main" "meta" "action";
    gap: 11px;
    padding: 16px;
    border-radius: 19px;
  }
  .offer-card.is-best { padding: 15px; }
  .offer-main { gap: 12px; }
  .offer-identity { gap: 10px; }
  .offer-logo { width: 44px; height: 44px; border-radius: 13px; }
  .offer-price { font-size: 22px; margin-left: auto; }
  .offer-meta { font-size: 13px; line-height: 1.4; }
  .offer-action { width: 100%; min-width: 0; min-height: 44px; }

  /* Payment summary should be visible before choosing a provider. */
  .payment-layout { display: flex; flex-direction: column; }
  .payment-layout > * { width: 100%; }
  .payment-layout .summary-card { order: -1; }
  .payment-option { gap: 12px; min-height: 76px; padding: 13px 14px; }
  .pay-logo { width: 44px; height: 40px; flex: 0 0 44px; }

  .data-row { align-items: flex-start; padding: 11px 0; }
  .data-row strong { max-width: 62%; overflow-wrap: anywhere; }
  .policy-card { padding: 16px; }
}

@media (max-width: 390px) {
  .app-content { padding-left: 12px; padding-right: 12px; }
  .hero-copy { padding: 22px 18px 19px; }
  .offer-main { align-items: flex-start; }
  .offer-price { font-size: 20px; }
  .offer-identity h3 { font-size: 17px; }
  .language-switch button { min-width: 35px; }
}


/* Final polish: clearer form hierarchy and fully clickable offer cards */
.form-layout > section.card {
  border-color: #dfe3e8;
  box-shadow: 0 10px 30px rgba(28, 32, 40, .055);
}

.field label {
  color: #101820;
  letter-spacing: -.01em;
}

.field input,
.field select {
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.field input:hover,
.field select:hover {
  border-color: #cfd4da;
}

.field input:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand-dark);
}

.field input[aria-invalid="true"] { border-color: var(--brand-dark); background: var(--brand-soft); }

.form-actions .btn-primary {
  min-width: 202px;
  box-shadow: 0 8px 18px rgba(233, 34, 21, .17);
  transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.form-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(233, 34, 21, .22);
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  letter-spacing: -.025em;
}

.offers-grid {
  gap: 14px;
}

.offer-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  outline: none;
  width: 100%;
  color: inherit;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.offer-card:hover {
  transform: translateY(-2px);
  border-color: #f2a49e;
  background: #fffdfd;
  box-shadow: 0 14px 34px rgba(28, 32, 40, .09);
}

.offer-card:active {
  transform: translateY(0);
}

.offer-card:focus-visible {
  outline: 3px solid var(--brand-dark);
  outline-offset: 3px;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(233, 34, 21, .12), 0 14px 34px rgba(28, 32, 40, .09);
}

.offer-card.is-best:hover,
.offer-card.is-best:focus-visible {
  border-color: var(--green);
  background: #fbfffc;
  box-shadow: 0 0 0 4px rgba(21, 148, 71, .08), 0 14px 34px rgba(21, 148, 71, .12);
}

.offer-action {
  pointer-events: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.offer-card:hover .offer-action.btn-secondary,
.offer-card:focus-visible .offer-action.btn-secondary {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.offer-card.is-best:hover .offer-action,
.offer-card.is-best:focus-visible .offer-action {
  background: var(--green-dark);
}

@media (max-width: 820px) {
  .form-actions .btn-primary { min-width: 0; }
  .offer-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .offer-card,
  .form-actions .btn-primary,
  .field input,
  .field select { transition: none; }
}

/* Website mobile preview must switch component layout too, not only the outer shell.
   These rules intentionally use data-viewport so the desktop preview toolbar can
   emulate a phone even when the browser window itself is wide. */
body[data-viewport="mobile"] .app-surface,
body[data-viewport="mobile"] .app-content,
body[data-viewport="mobile"] .app-content > *,
body[data-viewport="mobile"] .hero,
body[data-viewport="mobile"] .hero-copy,
body[data-viewport="mobile"] .hero-visual {
  min-width: 0;
  max-width: 100%;
}

body[data-runtime="web"][data-viewport="mobile"] .runtime-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body[data-runtime="web"][data-viewport="mobile"] .app-surface {
  width: 100%;
  min-height: 100dvh;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

body[data-viewport="mobile"] .app-topbar {
  min-width: 0;
  padding: 12px 14px;
}

body[data-viewport="mobile"] .app-brand,
body[data-viewport="mobile"] .app-topbar__right {
  min-width: 0;
}

body[data-viewport="mobile"] .app-brand .brand-copy strong {
  font-size: 15px;
}

body[data-viewport="mobile"] .app-brand .brand-copy small {
  font-size: 10px;
}

body[data-viewport="mobile"] .app-content {
  width: 100%;
  padding: 18px 14px calc(92px + var(--safe-bottom));
  overflow-x: hidden;
}

body[data-viewport="mobile"] h1 {
  max-width: 100%;
  margin: 8px 0 13px;
  font-size: 34px;
  line-height: 1.06;
  letter-spacing: -.035em;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

body[data-viewport="mobile"] h2 {
  font-size: 27px;
  line-height: 1.12;
}

body[data-viewport="mobile"] .lead {
  max-width: none;
  font-size: 15px;
  line-height: 1.5;
}

body[data-viewport="mobile"] .hero {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 22px;
  background: var(--brand-soft);
}

body[data-viewport="mobile"] .hero-copy {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 22px 20px 20px;
  border-radius: 0;
}

body[data-viewport="mobile"] .eyebrow {
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: .055em;
}

body[data-viewport="mobile"] .hero-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 14px;
}

body[data-viewport="mobile"] .hero-actions .btn {
  width: 100%;
  min-width: 0;
}

body[data-viewport="mobile"] .hero-visual {
  display: grid;
  width: 100%;
  min-height: 132px;
  border-top: 1px solid rgba(233,34,21,.08);
  border-radius: 0;
  background: rgba(255,255,255,.34);
}

body[data-viewport="mobile"] .hero-visual__shield {
  width: 82px;
  height: 98px;
  font-size: 42px;
  filter: drop-shadow(0 12px 14px rgba(233,34,21,.18));
}

body[data-viewport="mobile"] .section {
  margin-top: 22px;
}

body[data-viewport="mobile"] .section-heading {
  align-items: flex-start;
  margin-bottom: 12px;
}

body[data-viewport="mobile"] .product-grid,
body[data-viewport="mobile"] .feature-grid,
body[data-viewport="mobile"] .form-layout,
body[data-viewport="mobile"] .field-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-viewport="mobile"] .field-grid .span-2 {
  grid-column: auto;
}

body[data-viewport="mobile"] .product-card {
  width: 100%;
  padding: 16px;
  border-radius: 18px;
}

body[data-viewport="mobile"] .product-card__copy,
body[data-viewport="mobile"] .product-card__copy p {
  min-width: 0;
  overflow-wrap: anywhere;
}

body[data-viewport="mobile"] .product-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
}

body[data-viewport="mobile"] .feature-grid {
  gap: 10px;
}

body[data-viewport="mobile"] .feature-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas: "icon title" "icon text";
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 15px 16px;
}

body[data-viewport="mobile"] .feature-card svg {
  grid-area: icon;
  width: 27px;
  height: 27px;
  margin: 0;
}

body[data-viewport="mobile"] .feature-card strong { grid-area: title; }
body[data-viewport="mobile"] .feature-card span { grid-area: text; margin: 0; }

body[data-viewport="mobile"] .flow-head {
  flex-direction: column;
}

body[data-viewport="mobile"] .progress-wrap {
  width: 100%;
  min-width: 0;
}

body[data-viewport="mobile"] .form-layout {
  gap: 14px;
}

body[data-viewport="mobile"] .summary-card {
  position: static;
}

body[data-viewport="mobile"] .card {
  padding: 18px;
  border-radius: 18px;
}

body[data-viewport="mobile"] .form-actions {
  display: grid;
  grid-template-columns: 1fr;
}

body[data-viewport="mobile"] .form-actions .btn,
body[data-viewport="mobile"] .offer-action {
  width: 100%;
  min-width: 0;
}

body[data-viewport="mobile"] .offer-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "badge" "main" "meta" "action";
  gap: 11px;
  padding: 16px;
  border-radius: 19px;
}

body[data-viewport="mobile"] .offer-card.is-best {
  padding: 15px;
}

body[data-viewport="mobile"] .offer-main {
  width: 100%;
  gap: 10px;
}

body[data-viewport="mobile"] .offer-price {
  margin-left: auto;
  font-size: 21px;
}

body[data-viewport="mobile"] .payment-layout {
  display: flex;
  flex-direction: column;
}

body[data-viewport="mobile"] .payment-layout .summary-card {
  order: -1;
}

body[data-viewport="mobile"] .bottom-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 380px) {
  body[data-viewport="mobile"] .app-content {
    padding-left: 11px;
    padding-right: 11px;
  }

  body[data-viewport="mobile"] h1 {
    font-size: 31px;
  }

  body[data-viewport="mobile"] .app-topbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  body[data-viewport="mobile"] .runtime-badge {
    display: none;
  }
}

/* Hero visual strategy:
   - keep a compact trust visual only on the desktop website;
   - remove decorative visual weight from website mobile, PWA and Telegram. */
body[data-runtime="web"][data-viewport="desktop"] .hero {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  align-items: stretch;
}
body[data-runtime="web"][data-viewport="desktop"] .hero-copy,
body[data-runtime="web"][data-viewport="desktop"] .hero-visual {
  min-height: 240px;
}
body[data-runtime="web"][data-viewport="desktop"] .hero-visual__shield {
  width: 112px;
  height: 136px;
  font-size: 56px;
  filter: drop-shadow(0 15px 18px rgba(233,34,21,.18));
}
body[data-viewport="mobile"] .hero,
body[data-runtime="pwa"] .hero,
body[data-runtime="telegram"] .hero {
  display: block;
  grid-template-columns: 1fr;
}
body[data-viewport="mobile"] .hero-visual,
body[data-runtime="pwa"] .hero-visual,
body[data-runtime="telegram"] .hero-visual {
  display: none !important;
}

@media (max-width: 820px) {
  body[data-runtime="web"] .hero-visual { display: none !important; }
}
body[data-viewport="mobile"] .hero-copy,
body[data-runtime="pwa"] .hero-copy,
body[data-runtime="telegram"] .hero-copy {
  min-height: 0;
}
