/* Анкета — вид по утверждённым макетам anketa-*.dc.html (решение владельца 13.10.2026).
   Подключается поверх стилей сайта (pages/site.css): цвета, шрифты и тёмная тема — оттуда.
   Классы af-* — опоры скрипта формы (form.js), их не переименовывать. */

/* скрытое скриптом (поля другого основания и т. п.) — скрыто, что бы ни задавали стили ниже */
.form-page [hidden] { display: none !important; }

/* --- страница --- */
.af-page { display: flex; flex-direction: column; gap: 1.25rem; padding-bottom: 4.5rem; }
.af-page .crumbs { padding-top: 1.5rem; }
.af-head { display: flex; flex-direction: column; gap: 0.5rem; }
.af-h1 { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem); line-height: 1.05; text-transform: uppercase; overflow-wrap: normal; }
.af-h2 { margin: 0; font-size: clamp(1.3125rem, 1.2rem + 0.4vw, 1.5rem); font-weight: 600; line-height: 1.25; }
@media (min-width: 1024px) { .af-page { gap: 1.75rem; } .af-page .crumbs { padding-top: 2.5rem; } }

/* --- шаги: компьютер (от 1024) — полоса с галочками; телефон и планшет — «Шаг N из 5» и прогресс --- */
.af-steps-nav { display: none; }
.af-progress { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.75rem; }
.af-progress li { display: flex; align-items: center; white-space: nowrap; font-size: 0.9375rem; font-weight: 600; color: var(--muted); }
.af-progress li > a, .af-progress li > span { display: inline-flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; }
.af-progress .af-line { flex: 1; min-width: 1rem; height: 2px; background: var(--line2); }
.af-progress .af-line-done { background: var(--accent); }
.af-num { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.af-progress .af-done { color: var(--text); }
.af-progress .af-done .af-num { border: 0; background: var(--accent); color: var(--btn-text); }
.af-progress .af-now { color: var(--text); font-weight: 700; }
.af-progress .af-now .af-num { border: 2px solid var(--accent); color: var(--accent); font-weight: 700; box-shadow: 0 0 0 4px var(--accent-soft); }
.af-phone-steps { display: flex; flex-direction: column; gap: 0.625rem; }
.af-phone-steps-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; font-size: 0.9375rem; }
.af-phone-steps-row span { text-align: right; }
.af-phone-steps-row span { color: var(--muted); }
.af-bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--line); overflow: hidden; }
.af-bar::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
.af-bar::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
.af-bar::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
@media (min-width: 1024px) { .af-steps-nav { display: block; } .af-phone-steps { display: none; } }

/* --- раскладка: карточка формы и колонка справа (только на компьютере) --- */
.af-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; }
.af-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.af-aside { display: none; }
@media (min-width: 600px) { .af-box { padding: 2rem; border-radius: 14px; } }
@media (min-width: 1024px) {
  .af-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .af-aside { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 6.25rem; }
  .af-aside-card { padding: 1.5rem; gap: 0.875rem; }
}
.af-aside .label { margin: 0; }
.af-aside ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.9375rem; line-height: 1.45; }
.af-aside li { display: flex; gap: 0.625rem; }
.af-aside li svg { color: var(--accent); margin-top: 2px; flex: none; }
.af-aside-note { gap: 0.625rem; font-size: 0.9375rem; }
.af-strong-link { font-weight: 600; text-decoration: underline; min-height: 2.75rem; display: inline-flex; align-items: center; }
.af-muted { color: var(--muted); }
.af-muted a { color: var(--text); text-decoration: underline; }

/* --- форма и поля --- */
.af-form { display: flex; flex-direction: column; gap: 1.5rem; }
.af-field { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.af-field > label, .af-field > legend { font-size: 0.9375rem; font-weight: 600; padding: 0; }
.af-field legend { margin-bottom: 0.5rem; }
.af-nominator-links a { display: inline-block; padding: 0.625rem 0; }
.af-hint { margin: 0; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }
.af-field input[type=text], .af-field input[type=email], .af-field input[type=tel], .af-field select,
.af-basis-extra input, .af-switch-row select {
  min-height: 3.25rem; width: 100%; border-radius: 8px; border: 1.5px solid var(--line2); background: var(--bg);
  color: var(--text); padding: 0 0.875rem; font: inherit; font-size: 1.0625rem; min-width: 0;
}
.af-field input:focus, .af-field select:focus, .af-basis-extra input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.af-invalid input[type=text], .af-invalid input[type=email], .af-invalid input[type=tel], .af-field input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.af-date-row, .af-phone-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.af-date-row input[type=text] { flex: 1 1 11rem; max-width: 16rem; }
.af-phone-row select { flex: 0 1 14rem; width: auto; }
.af-phone-row input[type=tel] { flex: 1 1 12rem; }

/* сообщения по смыслу: красный — ошибка, бежевый — сведения, жёлтый — предупреждение, зелёный — готово */
.af-msg, .af-error, .af-warning, .af-ok {
  display: flex; flex-wrap: wrap; gap: 0.25rem 0.625rem; align-items: center; margin: 0; padding: 0.625rem 0.75rem;
  border-radius: 8px; font-size: 0.875rem; line-height: 1.45;
}
.af-error, .af-err { color: var(--danger); background: var(--danger-soft); }
.af-warning, .af-warn { color: var(--text); background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--warn); }
.af-ok, .af-okm { color: var(--ok); background: var(--ok-soft); }
.af-info { color: var(--text); background: var(--accent-soft); }
.af-error[hidden], .af-warning[hidden], .af-ok[hidden] { display: none; }
.af-msg a, .af-error a, .af-warning a, .af-ok a { color: var(--text); font-weight: 600; text-decoration: underline; }
.af-summary { font-weight: 600; font-size: 0.9375rem; }
.af-fix { margin-left: auto; font: inherit; font-weight: 600; text-decoration: underline; background: none; border: 0; color: var(--text); cursor: pointer; min-height: 2.75rem; padding: 0 0.25rem; }

/* --- выбор: карточки номинаций, «как публиковать», основания — карточки с точкой --- */
.af-cards { display: grid; gap: 0.875rem; }
.af-card, .af-radio {
  display: flex; gap: 0.75rem; align-items: flex-start; border: 1.5px solid var(--line2); border-radius: 10px;
  padding: 0.875rem 1rem; background: var(--bg); cursor: pointer; font-weight: 400;
}
.af-card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.75rem; row-gap: 0.1875rem; padding: 1.125rem; }
.af-card input { grid-row: span 6; }
.af-card-title { font-size: 1rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.3125rem; }
.af-card-fact { font-size: 0.875rem; color: var(--muted); }
.af-card:has(input:checked), .af-radio:has(input:checked) {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.af-invalid .af-card, .af-invalid .af-radio { border-color: var(--danger); }
.af-card input[type=radio], .af-radio input[type=radio], .af-basis-choice input[type=radio] {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line2);
  background: var(--bg); flex: none; margin: 1px 0 0; display: grid; place-content: center; cursor: pointer;
}
.af-card input[type=radio]:checked, .af-radio input[type=radio]:checked, .af-basis-choice input[type=radio]:checked { border-color: var(--accent); }
.af-card input[type=radio]:checked::after, .af-radio input[type=radio]:checked::after, .af-basis-choice input[type=radio]:checked::after {
  content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
}
input[type=radio]:focus-visible, input[type=checkbox]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.af-check label { display: flex; gap: 0.625rem; align-items: center; font-size: 0.9375rem; font-weight: 400; min-height: 2.75rem; cursor: pointer; }
.af-check input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 5px; border: 1.5px solid var(--line2);
  background: var(--bg); flex: none; margin: 0; display: grid; place-content: center; cursor: pointer;
}
/* галочки шага «Проверка»: текст в несколько строк — галочка у первой строки */
.af-consent label, .af-news label { align-items: flex-start; font-size: 1rem; line-height: 1.45; padding-block: 0.25rem; }
.af-consent input[type=checkbox], .af-news input[type=checkbox] { margin-top: 0.125rem; }
/* ссылки на тексты — отдельной строкой под галочкой: зона нажатия не меньше 44 px */
.af-consent-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0 0 0 2.125rem; font-size: 0.9375rem; }
.af-consent-links a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: underline; }
.af-check input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
.af-check input[type=checkbox]:checked::after { content: ""; width: 6px; height: 11px; border: solid var(--btn-text); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
@media (min-width: 600px) {
  .af-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .af-radios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
}
.af-radios { display: grid; gap: 0.75rem; }
.af-radio { margin: 0; }

/* основания участия: карточка — контейнер; внутри строка выбора с пояснением и поле, если нужно */
.af-card.af-basis { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.875rem 1rem; cursor: default; }
.af-basis-choice { display: flex; gap: 0.75rem; align-items: flex-start; cursor: pointer; font-weight: 400; }
.af-basis-choice .af-card-title { margin: 0.125rem 0 0; }
.af-basis-note { margin: -0.5rem 0 0 2.125rem; }
.af-basis-extra { margin: 0 0 0 2.125rem; display: flex; flex-direction: column; gap: 0.5rem; }
.af-basis-extra label { font-size: 0.9375rem; font-weight: 600; }

/* файлы: зона загрузки — щелчок, перетаскивание и клавиатура (поле выбора лежит поверх) */
.af-drop { position: relative; border: 1.5px dashed var(--line2); border-radius: 10px; background: var(--bg); padding: 1.25rem 1.125rem; }
.af-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.af-drop:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.af-drop:hover { border-color: var(--accent); }
.af-invalid .af-drop { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.af-drop-text { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; font-size: 0.9375rem; color: var(--muted); }
.af-drop-text b { color: var(--text); font-size: 1rem; }
.af-drop-btn { min-height: 2.75rem; padding: 0 1.25rem; font-size: 0.9375rem; font-weight: 600; border-radius: 8px; display: inline-flex; align-items: center; color: var(--text); }
.af-loading { display: flex; align-items: center; gap: 0.75rem; margin: 0; padding: 0.75rem 1rem; border: 1.5px solid var(--line2); border-radius: 10px; background: var(--bg); font-weight: 600; }
.af-spin { flex: none; animation: af-spin 2.4s linear infinite; }
@keyframes af-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .af-spin { animation: none; } }
.af-volume p { margin: 0; }
.af-volume-over { font-weight: 600; }

/* дата рождения: плашка выбора «год → месяц → число» */
.af-calendar-button { min-height: 3.25rem; padding: 0 1rem; border-radius: 8px; border: 2px solid var(--line2); background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.af-calendar { margin-top: 0.5rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); max-width: 26rem; }
.af-calendar-title { margin: 0 0 0.5rem; font-family: var(--font-head); font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.af-calendar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.375rem; }
.af-calendar-grid.af-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.af-calendar-grid.af-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.af-calendar-grid button, .af-calendar-nav button { min-height: 2.75rem; border-radius: 8px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.9375rem; cursor: pointer; }
.af-calendar-grid button:hover, .af-calendar-grid button:focus-visible { background: var(--accent-soft); }
.af-calendar-grid button[aria-pressed="true"] { background: var(--accent); color: var(--btn-text); font-weight: 700; }
.af-calendar-grid button[disabled] { opacity: 0.35; cursor: default; }
.af-calendar-nav { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.af-gap { visibility: hidden; }

/* проверка и отправка: разделы — одной рамкой, через линию */
.af-sum { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.af-sum .af-review { border: 0; border-radius: 0; border-top: 1px solid var(--line); }
.af-sum .af-review:first-child { border-top: 0; }
.af-review > p { margin: 0; font-size: 0.9375rem; }
.af-email-check { margin: 0; padding: 1rem 1.25rem; border-radius: 12px; background: var(--accent-soft); font-size: 0.9375rem; line-height: 1.5; }
.af-email-check strong, .af-email-check b { font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem); overflow-wrap: anywhere; }
.af-review { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 1.125rem 1.25rem; }
.af-review h3 { margin: 0 0 0.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: var(--font-head); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.af-edit { font-family: var(--font-text); letter-spacing: 0; text-transform: none; font-size: 0.875rem; font-weight: 600; color: var(--text); text-decoration: underline; text-underline-offset: 3px; min-height: 2.75rem; display: inline-flex; align-items: center; }
.af-review dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.125rem; margin: 0; font-size: 0.9375rem; }
.af-review dt { color: var(--muted); }
.af-review dd { margin: 0 0 0.5rem; overflow-wrap: anywhere; }
@media (min-width: 600px) { .af-review dl { grid-template-columns: 12.5rem minmax(0, 1fr); gap: 0.375rem 1rem; } .af-review dd { margin: 0; } }

/* --- кнопки «Назад» / «Далее»: на телефоне прилипают к низу экрана --- */
.af-buttons { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.btn-sec { border: 2px solid var(--line2); background: transparent; color: var(--text); }
.af-buttons .btn { gap: 0.625rem; min-height: 3.25rem; font-size: 1.0625rem; cursor: pointer; border-style: solid; font-family: inherit; }
.af-buttons .btn-accent { border: 0; }
@media (max-width: 599px) {
  /* кнопки — обычная часть формы в конце шага, не липкая панель (решение владельца 29.10.2026) */
  .af-buttons { padding-top: 1.25rem; }
  .af-buttons .btn { font-size: 1rem; padding: 0 1rem; gap: 0.5rem; }
  .af-buttons .btn-accent { flex: 1; }
  .af-buttons .btn-sec { flex: none; }
  .af-buttons > span:empty { display: none; }
}

/* телефон: строка выбора основания — не меньше 44 px, ссылки согласия не слипаются в столбце */
@media (max-width: 599px) {
  .af-basis-choice { min-height: 2.75rem; align-items: center; }
  .af-basis-choice .af-card-title { margin: 0; }
  .af-consent-links { row-gap: 0.5rem; }
}

/* Поле-ловушка для программ-спамеров: человеку не видно (антиспам, этап 7з) */
.af-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Смена номинации под подсказкой о возрасте (решение владельца 11.10.2026) */
.af-switch-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; width: 100%; }
.af-switch-row select { width: auto; flex: 1 1 14rem; }
.af-switch { min-height: 2.75rem; padding: 0 1rem; border-radius: 8px; border: 2px solid var(--accent); background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }

/* Подсказки «С какого фестиваля рекомендован» (решение владельца 11.10.2026) */
.af-suggest { position: relative; }
.af-suggest-list { position: absolute; left: 0; right: 0; z-index: 5; margin: 2px 0 0; padding: 0.25rem 0; list-style: none; background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; max-height: 16em; overflow-y: auto; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }
.af-suggest-list li { padding: 0.625rem 0.875rem; cursor: pointer; }
.af-suggest-list li[aria-selected="true"], .af-suggest-list li:hover { background: var(--accent-soft); }
.af-suggest-city { color: var(--muted); }

/* --- итоговые страницы: «Заявка принята», «Приём закрыт», личные ссылки --- */
.af-result { display: flex; flex-direction: column; gap: 1.25rem; max-width: 46rem; }
.af-result p { margin: 0; }
.af-result .btn { align-self: flex-start; }
.af-result-card { align-items: center; text-align: center; gap: 1.125rem; padding: clamp(2rem, 1.5rem + 3vw, 3.5rem) clamp(1rem, 0.5rem + 3vw, 3rem); }
.af-result-icon { color: var(--accent); }
.af-result-ok { color: var(--ok); }
.af-result-title { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); }
.af-result-text { margin: 0; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem); line-height: 1.55; max-width: 38.75rem; }
.af-result-again { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.af-result-again form { margin: 0; }
.af-result-again .af-hint { max-width: 26.25rem; }
.af-result-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.af-result-card .btn { min-height: 3.25rem; white-space: normal; text-align: center; }
.af-replace-what { text-align: left; }
/* Блок «Поделитесь новостью» на странице «Заявка принята» (макет anketa-prinyata, шаг З):
   порядок — заголовок и пояснение, превью, галочка и кнопки; от 600 px — превью слева
   (замечание владельца 23.10.2026). Кнопка «Подать заявку в другую номинацию» — после блока. */
.af-share { width: 100%; max-width: 47.5rem; margin-top: 0.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 1.25rem; text-align: left; }
.af-share-preview { width: 13.75rem; max-width: 70%; flex: none; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.af-share-preview img { display: block; width: 100%; height: auto; background: var(--bg); }
.af-share-body { display: flex; flex-direction: column; gap: 0.875rem; width: 100%; }
.af-share-title { margin: 0; width: 100%; font-size: 1.375rem; font-weight: 600; }
.af-share-text { margin: 0; width: 100%; font-size: 1rem; line-height: 1.5; color: var(--muted); }
.af-share-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.af-share-actions .btn { flex: 1 1 12rem; cursor: pointer; font-family: inherit; }
.af-share + .af-result-again { margin-top: 1.5rem; }
@media (min-width: 600px) {
  .af-share { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "preview title" "preview text" "preview form"; column-gap: 1.75rem; row-gap: 0.875rem; align-items: start; align-content: center; }
  .af-share-preview { grid-area: preview; align-self: center; max-width: none; }
  .af-share-title { grid-area: title; }
  .af-share-text { grid-area: text; }
  .af-share-body { grid-area: form; width: auto; }
  .af-share-actions .btn { flex: 0 1 auto; }
}
/* Загруженный файл — карточкой: имя, «Word · 38 КБ», «Заменить» и «Убрать» (макет anketa-4,
   решение владельца 20.10.2026). Зона выбора при этом спрятана, но поле в ней работает. */
.af-filecard { border: 1.5px solid var(--line2); border-radius: 10px; background: var(--bg); padding: 0.875rem 1rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.af-filecard[hidden] { display: none; }
.af-filecard-icon { color: var(--accent); flex: none; }
.af-filecard-text { min-width: 0; flex: 1 1 12rem; }
.af-filecard-name { font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-filecard-meta { font-size: 0.875rem; color: var(--muted); }
.af-filecard-acts { margin-left: auto; display: flex; gap: 1rem; font-size: 0.875rem; font-weight: 600; }
.af-link { background: none; border: 0; padding: 0.25rem 0; min-height: 2.75rem; display: inline-flex; align-items: center; color: var(--text); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.af-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.af-drop.af-drop-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
