/* Публичный сайт */

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .wrap { padding-inline: 24px; } }
@media (min-width: 1024px) { .wrap { padding-inline: 32px; } }

/* ---------- Шапка ---------- */
.masthead { background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
.masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 64px; padding-block: var(--s-2); }
@media (min-width: 1024px) { .masthead__inner { min-height: 76px; } }

.brand { display: flex; align-items: center; gap: var(--s-3); color: var(--c-text); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--c-text); text-decoration: none; }
.brand__emblem:empty { display: none; }
.brand__emblem img { height: 44px; width: auto; }
.brand__text { display: grid; line-height: 1.2; }
.brand__name { font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.005em; }
.brand__sub { font-size: var(--fs-sm); color: var(--c-text-2); }

.masthead__phone {
  display: none; align-items: center; gap: var(--s-2); white-space: nowrap;
  font-weight: 600; font-size: var(--fs-md); color: var(--c-text); text-decoration: none;
  min-height: var(--tap); padding: 0 var(--s-3); border-radius: var(--r-md);
}
.masthead__phone svg { width: 20px; height: 20px; color: var(--c-primary); }
.masthead__phone:hover { background: var(--c-primary-soft); color: var(--c-primary); text-decoration: none; }
.masthead__phone .tag { font-size: var(--fs-xs); font-weight: 600; color: var(--c-warning); background: var(--c-warning-soft); border: 1px solid var(--c-warning-line); padding: 1px 6px; border-radius: 4px; }
@media (min-width: 760px) { .masthead__phone:not([hidden]) { display: inline-flex; } }

/* ---------- Вступление ---------- */
.intro { display: grid; gap: var(--s-6); padding-block: var(--s-7) var(--s-7); }
@media (min-width: 1024px) {
  .intro { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-9); align-items: end; padding-block: var(--s-9) var(--s-8); }
}
.intro__eyebrow {
  display: flex; align-items: center; gap: var(--s-3);
  font-size: var(--fs-sm); font-weight: 600; color: var(--c-primary); margin-bottom: var(--s-4);
}
.intro__eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--c-primary); }
.intro__title { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.08; letter-spacing: -0.022em; max-width: 21ch; text-wrap: balance; }
.intro__subtitle { margin-top: var(--s-4); font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem); font-weight: 500; color: var(--c-text-2); line-height: var(--lh-snug); }
.intro__lead { margin-top: var(--s-5); max-width: 58ch; color: var(--c-text-2); }

.hotline {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-6); display: grid; gap: var(--s-2);
}
.hotline__title { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-3); }
.hotline__phone {
  display: inline-flex; align-items: center; gap: var(--s-3); justify-self: start;
  font-size: 1.625rem; font-weight: 700; letter-spacing: -0.01em; color: var(--c-primary); text-decoration: none;
  min-height: var(--tap);
}
.hotline__phone svg { width: 26px; height: 26px; }
a.hotline__phone:hover { color: var(--c-primary-hover); text-decoration: underline; text-decoration-thickness: 2px; }
span.hotline__phone { color: var(--c-text-2); }

.hotline__hours { font-size: var(--fs-sm); color: var(--c-text-2); }
.hotline__note { font-size: var(--fs-sm); color: var(--c-text-2); line-height: 1.45; padding-top: var(--s-2); border-top: 1px solid var(--c-line); margin-top: var(--s-1); }

/* ---------- Сетка страницы ---------- */
.layout { padding-bottom: var(--s-10); }
.form-col { min-width: 0; }

/* Инструкция */
.guide__sticky { display: grid; gap: var(--s-5); }
@media (min-width: 1024px) { .guide__sticky { position: sticky; top: var(--s-6); } }
.guide__title { font-size: var(--fs-lg); font-weight: 700; line-height: var(--lh-snug); }
.guide__list { display: grid; gap: var(--s-4); margin: 0; padding: 0; }
.guide__list li { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-3); font-size: var(--fs-sm); line-height: 1.5; color: var(--c-text-2); }
.guide__n {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-surface); border: 1.5px solid var(--c-primary-soft-2); color: var(--c-primary);
  font-weight: 700; font-size: var(--fs-xs);
}
@media (max-width: 1023px) {
  .guide { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--s-5); }
  .guide__title { font-size: var(--fs-md); }
}

/* Навигация по разделам */
.progress { display: none; }
@media (min-width: 1024px) { .progress { display: block; padding-top: var(--s-5); border-top: 1px solid var(--c-line); } }
.progress ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.progress a {
  display: grid; grid-template-columns: 22px 1fr; gap: var(--s-3); align-items: center;
  padding: var(--s-2) var(--s-3); margin-inline: calc(var(--s-3) * -1); border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--c-text-2); text-decoration: none; line-height: 1.3;
}
.progress a:hover { background: var(--c-bg-deep); color: var(--c-text); }
.progress a[aria-current='step'] { color: var(--c-text); font-weight: 600; background: var(--c-surface); }
.progress__dot {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--c-line-strong); background: var(--c-surface); color: transparent;
}
.progress__dot svg { width: 14px; height: 14px; }
.progress a.is-done .progress__dot { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.progress a.has-error .progress__dot { border-color: var(--c-danger); background: var(--c-danger); color: #fff; }
.progress a.has-error .progress__dot::after { content: '!'; font-size: 12px; font-weight: 700; }
.progress a.has-error .progress__dot svg { display: none; }

/* ---------- Лист формы ---------- */
.form-sheet {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  container-type: inline-size;
}
.form-sheet--loading { min-height: 1200px; padding: var(--s-7); display: grid; gap: var(--s-5); align-content: start; }
.skeleton--title { height: 26px; width: 40%; }
.skeleton--field { height: 52px; }

.form-head { padding: var(--s-6) var(--s-5) 0; }
@container (min-width: 600px) { .form-head { padding: var(--s-7) var(--s-8) 0; } }
.form-head__title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; line-height: var(--lh-tight); }
.form-head__note { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--c-text-3); }

.form-summary-slot { padding: var(--s-5) var(--s-5) 0; }
.form-summary-slot:empty, .form-summary-slot[hidden] { display: none; }
@container (min-width: 600px) { .form-summary-slot { padding: var(--s-6) var(--s-8) 0; } }

.fsec { padding: var(--s-6) var(--s-5); border-top: 1px solid var(--c-line); scroll-margin-top: var(--s-4); }
.fsec:first-of-type { border-top: 0; }
@container (min-width: 600px) { .fsec { padding: var(--s-7) var(--s-8); } }
.fsec__head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-5); }
.fsec__num { font-size: var(--fs-sm); font-weight: 700; color: var(--c-primary); font-variant-numeric: tabular-nums; min-width: 1.6em; }
.fsec__title { font-size: var(--fs-lg); font-weight: 700; line-height: var(--lh-snug); letter-spacing: -0.005em; }
.fsec__desc { margin: calc(var(--s-3) * -1) 0 var(--s-5) calc(1.6em + var(--s-3)); font-size: var(--fs-sm); color: var(--c-text-3); max-width: var(--measure); }
@container (max-width: 599px) { .fsec__desc { margin-left: 0; } }

.grid { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1fr); }
@container (min-width: 560px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-6); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-6); }
  .grid > .field--wide { grid-column: 1 / -1; }
}
@container (min-width: 760px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.consent { gap: var(--s-2); }
.consent__doc { margin-top: var(--s-2); font-size: var(--fs-sm); }

.submit-row { display: grid; gap: var(--s-4); margin-top: var(--s-6); }
@container (min-width: 600px) { .submit-row { grid-template-columns: auto 1fr; align-items: center; gap: var(--s-5); } }
.submit-row__note { font-size: var(--fs-sm); color: var(--c-text-3); max-width: 46ch; }
@container (max-width: 599px) { .submit-row .btn { width: 100%; } }

.submit-alert { margin-top: var(--s-5); }
.submit-alert .btn { margin-top: var(--s-3); }

/* Экран успеха внутри листа */
.success-sheet { padding: var(--s-8) var(--s-5); }
@container (min-width: 600px) { .success-sheet { padding: var(--s-9) var(--s-8); } }
.success-sheet .btn { margin-top: var(--s-2); }

/* ---------- Подвал ---------- */
.footer { border-top: 1px solid var(--c-line); background: var(--c-bg-deep); }
.footer__inner { display: grid; gap: var(--s-3); padding-block: var(--s-6) calc(var(--s-6) + env(safe-area-inset-bottom)); font-size: var(--fs-sm); color: var(--c-text-2); }
@media (min-width: 760px) { .footer__inner { grid-template-columns: 1fr auto; align-items: center; } }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0; padding: 0; }
.footer__links a { color: var(--c-text-2); display: inline-flex; min-height: var(--tap); align-items: center; }
.footer__links a:hover { color: var(--c-primary); }

/* Простые страницы (документ, 404) */
.doc { padding-block: var(--s-8) var(--s-10); }
.doc__body { max-width: 72ch; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--s-6); }
@media (min-width: 640px) { .doc__body { padding: var(--s-8); } }
.doc__body h1 { font-size: var(--fs-xl); line-height: var(--lh-tight); margin-bottom: var(--s-4); }
.doc__body p + p, .doc__body .alert + p, .doc__body p + .alert { margin-top: var(--s-4); }
.doc__back { display: inline-flex; margin-bottom: var(--s-5); font-weight: 600; }

/* Инструкция сворачивается на узких экранах */
.guide__summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.guide__summary::-webkit-details-marker { display: none; }
.guide__details[open] > .guide__list { margin-top: var(--s-4); }
@media (max-width: 1023px) {
  .guide { padding: 0; }
  .guide__summary { cursor: pointer; min-height: 56px; padding: var(--s-3) var(--s-5); border-radius: var(--r-lg); }
  .guide__summary::after {
    content: ''; width: 20px; height: 20px; flex: none; background: var(--c-text-2);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
    transition: transform var(--dur) var(--ease);
  }
  .guide__details[open] > .guide__summary::after { transform: rotate(180deg); }
  .guide__summary:hover { background: var(--c-surface-2); }
  .guide__summary:focus-visible { outline-offset: -3px; }
  .guide__details[open] > .guide__list { margin: 0; padding: 0 var(--s-5) var(--s-5); }
  .hotline { padding: var(--s-4) var(--s-5); }
  .hotline__phone { font-size: 1.375rem; }
}
@media (min-width: 1024px) {
  .guide__summary { pointer-events: none; }
}
