/* Шрифты лежат на сервере: Google Fonts в России работают нестабильно. */
@font-face {
  font-family: "Nunito"; font-weight: 200 1000; font-display: swap;
  src: url("fonts/nunito-cyrillic.fd4986b86093.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Nunito"; font-weight: 200 1000; font-display: swap;
  src: url("fonts/nunito-latin.166202cc391c.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Caveat"; font-weight: 400 700; font-display: swap;
  src: url("fonts/caveat-cyrillic.b30aa3db700f.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Caveat"; font-weight: 400 700; font-display: swap;
  src: url("fonts/caveat-latin.2d9de14f93a2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #1d2b4f;
  --blue: #0b5596;
  --yellow: #ffd84d;
  --coral: #e8513f;
  --green: #2bb673;
  --paper: #fffdf6;
  --grid: #e4edf7;
  --muted: #55618a;
  --error: #c62828;
  --error-bg: #ffe9e6;

  --tint-yellow: #fff3b0;
  --tint-blue: #d6ebff;
  --tint-coral: #ffd9d4;
  --tint-green: #d4f5e2;

  --border: 2.5px solid var(--ink);
  --radius: 16px;
  --shadow: 4px 4px 0 var(--ink);

  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 17px/1.6 var(--font);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

h1, h2, h3 { font-weight: 900; line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h2, .h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
h3, .h3 { font-size: 1.2rem; }
p { text-wrap: pretty; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 760px; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; margin: 0 0 .4em; }
.hand { font-family: var(--hand); font-weight: 700; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 8px 14px; background: var(--yellow); border: var(--border); border-radius: 10px; font-weight: 800; color: var(--ink); }
.skip-link:focus { top: 12px; }

/* Карточка с «мультяшной» тенью */
.box, .card {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --- Шапка и подвал --- */
.site-header { padding: 16px 0 8px; }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px 8px 14px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo img { width: 56px; height: auto; }
.logo__text { display: flex; flex-direction: column; line-height: 1.1; }
.logo__text b { font-size: 1.2rem; font-weight: 900; }
.logo__text small { font-size: .78rem; font-weight: 700; color: var(--muted); }
.nav { display: flex; gap: 4px; align-items: center; font-weight: 800; }
.nav__link { padding: 8px 14px; border-radius: 999px; color: var(--ink); text-decoration: none; }
.nav__link:hover { background: var(--tint-yellow); color: var(--ink); }
.nav .btn { margin-left: 8px; }

.site-footer { margin-top: 72px; padding: 28px 0; background: #fff; border-top: var(--border); font-size: .95rem; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.site-footer__contacts { display: flex; flex-direction: column; gap: 4px; text-align: right; }

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border: var(--border); border-radius: 14px;
  background: var(--yellow); color: var(--ink);
  font: inherit; font-weight: 900; font-size: 1.05rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--lg { padding: 14px 30px; font-size: 1.12rem; }
.btn--sm { padding: 8px 16px; font-size: .98rem; border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
.btn--sm:hover { box-shadow: 4px 4px 0 var(--ink); }
.btn--ghost { background: #fff; }
.btn[disabled] { opacity: .65; cursor: progress; }

.link-button { padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.blank-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.blank-link::before { content: "↓"; }

/* --- Главная: первый экран --- */
.hero { padding: 28px 0 8px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
.hero__lead { max-width: 34em; margin: 0 0 24px; font-size: 1.15rem; color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.status { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 6px 14px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; font-weight: 800; font-size: .95rem; }
.status__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(43, 182, 115, .5); animation: pulse 2s infinite; }
.status--closed .status__dot { background: var(--coral); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(43, 182, 115, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 182, 115, 0); } }

/* Эмблема как фотография, приклеенная скотчем */
.polaroid { position: relative; margin: 0; padding: 24px 24px 14px; background: #fff; border: var(--border); border-radius: 18px; box-shadow: 8px 8px 0 var(--ink); transform: rotate(2deg); text-align: center; }
.polaroid img { display: block; width: 100%; }
.polaroid figcaption { margin-top: 6px; color: var(--coral); font-size: 1.8rem; line-height: 1.1; }
.polaroid::before { content: ""; position: absolute; top: -14px; left: 50%; width: 110px; height: 28px; transform: translateX(-50%) rotate(-3deg); background: rgba(255, 216, 77, .85); border: 2px solid var(--ink); }

/* --- Главная: секции страницы --- */
.section { padding: 72px 0 0; }
.section--tight { padding-top: 48px; }
.section h2 .hand { color: var(--blue); font-size: 1.25em; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 0; }
.tile { margin: 0; padding: 16px 18px; }
.tile dt { margin: 0 0 4px; color: var(--muted); font-weight: 800; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.tile dd { margin: 0; color: var(--muted); }
.tile dd b { display: block; color: var(--ink); font-size: 1.3rem; line-height: 1.25; }
.tile--accent { background: var(--yellow); }
.tile--accent dt, .tile--accent dd { color: var(--ink); }

.how { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.timeline { margin: 8px 0 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px; padding-bottom: 28px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 22px; top: 50px; bottom: 6px; border-left: 3px dashed var(--ink); }
.timeline__when { margin: 0; color: var(--blue); font-weight: 800; }
.timeline h3 { margin: 2px 0 4px; }
.timeline p:last-child { margin: 0; color: var(--muted); }
.step__num { display: grid; place-items: center; width: 46px; height: 46px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 50%; font-size: 1.9rem; line-height: 1; }

.prepare { position: sticky; top: 20px; margin: 0; padding: 22px; }
.prepare h3 { margin-bottom: 14px; }
.prepare ul { display: flex; flex-direction: column; gap: 14px; margin: 0 0 18px; padding: 0; list-style: none; font-weight: 800; }
.prepare li { display: flex; gap: 12px; }
.prepare small { display: block; margin-top: 2px; color: var(--muted); font-weight: 600; font-size: .88rem; }
.prepare__num { flex: none; display: grid; place-items: center; width: 26px; height: 26px; background: var(--tint-green); border: 2px solid var(--ink); border-radius: 50%; font-size: .8rem; font-weight: 900; }
.prepare__btn { width: 100%; }

.rows { margin: 8px 0 0; padding: 0; list-style: none; columns: 2; column-gap: 0; background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.rows li { display: flex; gap: 14px; align-items: baseline; padding: 14px 20px; border-bottom: 2px solid var(--grid); break-inside: avoid; font-weight: 800; }
.rows__num { flex: none; min-width: 1.2em; color: var(--blue); font-family: var(--hand); font-size: 1.5rem; line-height: 1; }
.rows small { display: block; color: var(--muted); font-weight: 600; font-size: .92rem; }
.rows small.rows__meta { margin-top: 2px; color: var(--blue); font-weight: 700; font-size: .85rem; }

.faq { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.faq .card { margin: 0; padding: 0; box-shadow: 3px 3px 0 var(--ink); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 16px 20px; font-weight: 800; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 20px 16px; color: var(--muted); }

.prose { max-width: 820px; padding: 28px 32px; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }

.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 28px 32px; background: var(--blue); color: #fff; border: var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.cta h2 { margin-bottom: 4px; }
.cta p { margin: 0; opacity: .9; }
.cta__contacts { display: flex; flex-direction: column; gap: 4px; font-size: 1.15rem; font-weight: 800; }
.cta__contacts a { color: #fff; }
.cta__contacts a:hover { color: var(--yellow); }

/* --- Анкета --- */
.page { padding: 24px 0 0; }
.page-head { max-width: 780px; margin: 0 0 24px; }
.page-head h1 { margin-bottom: 12px; }
.page-head .muted { margin: 0; }

.form-layout { display: grid; grid-template-columns: 220px minmax(0, 780px); gap: 32px; align-items: start; }
.form { min-width: 0; }

.progress { position: sticky; top: 16px; padding: 16px; background: #fff; border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.progress__title { margin: 0 0 8px; font-weight: 800; font-size: .95rem; }
.progress__bar { height: 10px; margin-bottom: 14px; background: var(--grid); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.progress__bar span { display: block; width: 0; height: 100%; background: var(--green); transition: width .3s; }
.progress__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.progress__list a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: var(--ink); font-weight: 700; text-decoration: none; }
.progress__list a::before {
  content: ""; flex: none; display: grid; place-items: center; width: 20px; height: 20px;
  border: 2px solid var(--ink); border-radius: 50%; background: #fff; font-size: .75rem; font-weight: 900;
}
.progress__list a:hover { background: var(--tint-yellow); }
.progress__list a.is-current { background: var(--tint-yellow); }
.progress__list a.is-done::before { content: "✓"; background: var(--green); color: #fff; }
.progress__optional a { color: var(--muted); font-weight: 600; }
.progress__optional a::before { border-style: dashed; }
.progress__optional a::after { content: "по желанию"; margin-left: auto; font-size: .72rem; }

.card { margin: 0 0 24px; padding: 26px; }
fieldset.card { min-width: 0; }
fieldset.card > legend {
  float: left; width: 100%; margin: 0 0 18px; padding: 0;
  font-size: 1.35rem; font-weight: 900;
}
fieldset.card > legend + * { clear: both; }
.legend-num { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 12px; vertical-align: 2px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 50%; font-size: 1rem; }
.legend-num--muted { background: #fff; border-style: dashed; }
.legend-note { color: var(--muted); font-weight: 600; font-size: 1rem; }
.legend-help { clear: both; margin: 0 0 16px; color: var(--muted); font-size: .95rem; }

.card--details { padding: 0; }
.card--details > summary { padding: 22px 26px; font-size: 1.35rem; font-weight: 900; cursor: pointer; list-style: none; }
.card--details > summary::-webkit-details-marker { display: none; }
.card--details > summary:hover .legend-num { background: var(--tint-yellow); }
.card--details[open] > summary { padding-bottom: 18px; }
.card--details[open] > summary .legend-num { background: var(--yellow); border-style: solid; }
.card--details > .grid { padding: 0 26px 10px; }

.grid { display: grid; gap: 0 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--name { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px; }

.field { margin-bottom: 18px; }
.field > label, .choices legend { display: block; margin-bottom: 6px; font-weight: 800; font-size: .95rem; }
.field--required > label::after { content: " *"; color: var(--coral); }
.req { color: var(--coral); }

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select,
.field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  background: #fff; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 10px;
  font: inherit;
}
.field input::placeholder { color: #9aa3c0; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; box-shadow: 3px 3px 0 var(--yellow), 3px 3px 0 2px var(--ink);
}
.field--error input:not([type="checkbox"]):not([type="radio"]),
.field--error select,
.field--error textarea { border-color: var(--error); background: var(--error-bg); }
.field--valid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field--valid select { border-color: var(--green); }

/* Поле загрузки: настоящий input растянут поверх зоны — так работают и клик, и перетаскивание. */
.drop {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px;
  background: #fffbe6; border: 2.5px dashed var(--ink); border-radius: 14px;
  transition: background .15s;
}
.drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop:hover, .drop.is-dragover { background: var(--tint-yellow); }
.drop.is-dragover { border-style: solid; }
.drop:focus-within { box-shadow: 3px 3px 0 var(--yellow), 3px 3px 0 2px var(--ink); }
.drop__icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; background: #fff; border: 2px solid var(--ink); border-radius: 50%; font-weight: 900; }
.drop__text { min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.drop__text small { display: block; color: var(--muted); font-weight: 600; }
.drop.has-file { background: var(--tint-green); border-style: solid; border-color: var(--green); }
.drop.has-file .drop__icon { background: var(--green); color: #fff; border-color: var(--ink); }
.field--error .drop { background: var(--error-bg); border-color: var(--error); }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; flex: none; accent-color: var(--ink); }
.check--small { margin: -4px 0 12px; font-size: .95rem; }

.help { margin: 6px 0 0; color: var(--muted); font-size: .88rem; }
.error { margin: 6px 0 0; color: var(--error); font-size: .92rem; font-weight: 800; }

.alert { margin: 0 0 20px; padding: 14px 18px; background: #fff; border: var(--border); border-radius: 12px; font-weight: 600; }
.alert--error { background: var(--error-bg); border-color: var(--error); color: #7f1d1d; }
.alert--info { background: var(--tint-blue); }

.submit-card .field { margin-bottom: 20px; }
.submit-card .help { margin-top: 14px; }

/* Ловушка для ботов: людям поле не видно. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- Страница «Спасибо» --- */
.success { text-align: center; padding: 40px 24px; }
.success__icon {
  display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 16px;
  border: var(--border); border-radius: 50%; background: var(--tint-green); font-size: 2.2rem; font-weight: 900;
}
.success__number { margin: 0 0 8px; font-size: 1.2rem; }
.success__number strong { display: inline-block; margin-left: 6px; padding: 2px 12px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 10px; }
.next-steps { margin: 0; padding-left: 1.3em; }
.next-steps li { margin-bottom: 8px; }
.next-steps li:last-child { margin-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.actions__help { margin-top: 12px; }

/* --- Адаптив --- */
@media (max-width: 960px) {
  .form-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .progress {
    top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
    margin: 0 -20px 20px; padding: 10px 20px; border-width: 0 0 2.5px; border-radius: 0; box-shadow: none;
  }
  .progress__title { flex: none; margin: 0; }
  .progress__bar { flex: 1; margin: 0; }
  .progress__list { display: none; }
}
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .polaroid { order: -1; width: min(340px, 90%); margin: 12px auto 0; }
  .hero__lead { margin-left: auto; margin-right: auto; }
  .hero__actions { justify-content: center; }
  .how { grid-template-columns: 1fr; }
  .prepare { position: static; }
  .rows { columns: 1; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .site-header { padding-top: 10px; }
  .nav__link, .logo__text small { display: none; }
  .logo img { width: 48px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .grid--name { grid-template-columns: minmax(0, 1fr) 90px; }
  .grid--name > :first-child { grid-column: 1 / -1; }
  .site-footer__contacts { text-align: left; }
  .card { padding: 18px; }
  .card--details { padding: 0; }
  .card--details > summary { padding: 18px; }
  .card--details > .grid { padding: 0 18px 6px; }
  .prose, .cta { padding: 22px 20px; }
  .progress { margin: 0 -16px 16px; padding: 10px 16px; }
  .hero__actions .btn, .submit-card .btn, .actions .btn { width: 100%; }
  .polaroid figcaption { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status__dot { animation: none; }
  .btn, .progress__bar span { transition: none; }
}
