:root {
  --bg: #17191c;
  --surface: #22252a;
  --text: #f9fafb;
  --muted: #b2b5bb;
  --accent: #ffe600;
  --accent-text: #17191c;
  --line: rgba(255, 255, 255, .14);
  --danger: #d94242;
  --success: #1a9a5a;
  --shadow: 0 10px 30px rgba(24, 48, 86, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
body {
  min-height: 100vh;
  padding: max(14px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
}
button, input { font: inherit; }
.app-shell { width: min(680px, 100%); margin: 0 auto; }
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; padding: 8px 4px 14px;
}
.eyebrow { color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .08em; }
h1 { margin: 4px 0 0; font-size: 24px; line-height: 1.1; }
.step-pill {
  flex: 0 0 auto; padding: 8px 11px; border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 13px;
  font-weight: 700; box-shadow: var(--shadow);
}
.progress {
  height: 6px; border-radius: 999px; background: rgba(116, 132, 156, .16);
  overflow: hidden; margin-bottom: 14px;
}
.progress__fill {
  width: 20%; height: 100%; background: var(--accent);
  border-radius: inherit; transition: width .25s ease;
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: 20px; box-shadow: var(--shadow);
}
.question { margin: 0; font-size: 24px; line-height: 1.18; }
.subtitle { margin: 8px 0 18px; color: var(--muted); line-height: 1.45; }
.option-list { display: grid; gap: 10px; }
.option {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: 15px; padding: 14px 15px;
  display: flex; align-items: center; gap: 11px; text-align: left;
  cursor: pointer; transition: .15s ease;
}
.option:active { transform: scale(.99); }
.option.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.check {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px;
  border: 2px solid rgba(116, 132, 156, .35); display: grid;
  place-items: center; font-weight: 900; color: transparent;
}
.option.selected .check {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
}
.radio { border-radius: 50%; }
.option.selected .radio::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-text);
}
.field {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: 16px; padding: 16px;
  outline: none; font-size: 18px;
}
.field:focus { border-color: var(--accent); }
.actions {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 18px;
}
.btn {
  border: 0; border-radius: 15px; padding: 15px 17px;
  cursor: pointer; font-weight: 800;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: rgba(116, 132, 156, .12); color: var(--text); }
.btn-full { width: 100%; }
.upload {
  display: block;
  border: 1.5px dashed rgba(116, 132, 156, .35); border-radius: 18px;
  padding: 24px 16px; text-align: center; cursor: pointer;
}
.upload-icon { font-size: 36px; }
.upload strong { display: block; margin-top: 8px; }
.upload span { color: var(--muted); display: block; margin-top: 5px; font-size: 14px; }
.preview-list {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px;
}
.preview {
  aspect-ratio: 1 / 1; border-radius: 13px; overflow: hidden;
  position: relative; background: rgba(116, 132, 156, .1);
}
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button {
  position: absolute; top: 5px; right: 5px; width: 26px; height: 26px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.65);
  color: white; cursor: pointer;
}
.summary { display: grid; gap: 10px; }
.summary-row { border: 1px solid var(--line); border-radius: 15px; padding: 13px 14px; }
.summary-top { display: flex; justify-content: space-between; gap: 10px; }
.summary-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.summary-edit {
  border: 0; background: transparent; color: var(--accent);
  padding: 0; font-weight: 800; cursor: pointer;
}
.summary-value { margin-top: 5px; line-height: 1.4; }
.success { text-align: center; padding: 16px 0 4px; }
.success-icon {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  color: var(--success); font-size: 34px; font-weight: 900;
}
.error { color: var(--danger); font-size: 14px; margin-top: 10px; }
.hidden { display: none !important; }
.toast {
  visibility: hidden;
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom));
  transform: translate(-50%, 140%); width: min(520px, calc(100% - 28px));
  background: #202736; color: #fff; border-radius: 14px;
  padding: 13px 15px; text-align: center; transition: transform .22s ease;
  z-index: 10;
}
.toast.show { visibility: visible; transform: translate(-50%, 0); }
.loading { opacity: .6; pointer-events: none; }
.actions > .btn:only-child { grid-column: 1 / -1; }
/* The site's fonts are self-hosted so the Telegram webview needs no font CDN. */
@font-face {
  font-family: "Home Montserrat"; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/montserrat-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Home Montserrat"; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/montserrat-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Home Open Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/static/fonts/open-sans-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Home Open Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/static/fonts/open-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}
body.is-home {
  --accent: #ffe600;
  position: relative; isolation: isolate;
  padding: max(20px, env(safe-area-inset-top)) max(25px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(25px, env(safe-area-inset-left));
  color: #fff; font-family: "Home Open Sans", Arial, sans-serif;
  background: #5e6262;
}
body.is-home::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.5)), url('/static/home-background.webp') center / cover no-repeat;
}
.is-home .app-shell { width: min(1150px, 100%); }
.home-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 50px; margin-bottom: 40px;
}
.home-logo { display: block; width: 360px; max-width: 48%; height: auto; }
.home-header-contacts { display: flex; align-items: center; gap: clamp(24px, 7vw, 90px); }
.home-phones { display: flex; flex-direction: column; gap: 3px; font-size: 16px; font-weight: 700; }
.home-phones a { display: flex; align-items: center; min-height: 32px; color: #fff; white-space: nowrap; text-underline-offset: 3px; cursor: pointer; touch-action: manipulation; }
.home-panel { width: min(600px, 100%); padding: 48px; border-radius: 4px; background: rgba(0,0,0,.88); }
.home-panel h1 {
  margin: 5px 0 12px; font-family: "Home Montserrat", Arial, sans-serif;
  font-size: 46px; font-weight: 700; line-height: 1.37; letter-spacing: 0;
}
.home-panel h1 em { color: var(--accent); font-style: normal; }
.home-region { margin: 0 0 22px; font-family: "Home Montserrat", Arial, sans-serif; font-weight: 700; font-size: 26px; line-height: 1.2; }
.home-situations { list-style: none; padding: 13px 0; margin: 0; border-block: 2px solid rgba(255,255,255,.25); }
.home-situations li { position: relative; padding-left: 16px; }
.home-situations li::before { content: "•"; position: absolute; left: 4px; top: 7px; line-height: 1.5; }
.home-situation {
  display: block; width: 100%; min-height: 34px; padding: 5px 0;
  border: 0; background: transparent; color: #fff; font-size: 17px;
  line-height: 1.5; text-align: left; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: pointer;
}
.home-situation:hover, .home-phones a:hover { color: var(--accent); }
.home-start p { margin: 21px 0 20px; font-size: 18px; line-height: 1.5; }
.home-start p span { color: var(--accent); }
.home-cta {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; border-radius: 5px; padding: 14px 20px; font-size: 17px; font-weight: 700; color: #000;
}
.home-cta:hover { background: #eedb2f; }
.home-cta span { display: inline-block; transform: rotate(-35deg); font-size: 18px; }
.home-note { margin: 18px 0 0; color: #dedede; text-align: center; font-size: 14px; line-height: 1.5; }
@media (max-width: 600px) {
  body.is-home { padding: max(16px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left)); }
  body.is-home::before { background-image: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.5)), url('/static/hero.webp'); background-position: 57% center; }
  .home-header { gap: 12px; min-height: 36px; margin-bottom: 28px; }
  .home-logo { width: 220px; max-width: 52%; }
  .home-header-contacts { min-width: 0; flex-shrink: 0; }
  .home-phones { font-size: 12px; gap: 4px; }
  .home-panel { padding: 32px 30px; background: rgba(0,0,0,.8); }
  .home-panel h1 { font-size: clamp(26px, 8.7vw, 34px); line-height: 1.2; margin: 4px 0 14px; }
  .home-region { font-size: 22px; margin-bottom: 20px; }
  .home-situations { padding: 12px 0; }
  .home-situations li { padding-left: 14px; }
  .home-situations li::before { top: 5px; }
  .home-situation { font-size: 15px; min-height: 34px; padding: 5px 0; line-height: 1.5; }
  .home-start p { font-size: 16px; margin: 18px 0; }
  .home-cta { min-height: 46px; padding: 12px 18px; font-size: 14px; }
}
@media (max-width: 360px) {
  .home-header { flex-wrap: wrap; gap: 10px; }
  .home-logo { max-width: 100%; }
  .home-phones { flex-direction: column; gap: 4px; }
  .home-panel { padding: 28px 24px; }
}
@media (max-width: 420px) {
  .card { padding: 17px; border-radius: 19px; }
  .question { font-size: 22px; }
  .actions { grid-template-columns: 1fr; }
  .actions .btn-secondary { order: 2; }
}
