:root {
  --brand-blue: #2b8feb;
  --brand-white: #ffffff;
  --brand-accent: #e3e3e3;
  --header-height: 72px;
}

body {
  margin: 0;
  font-family: sans-serif;
  background: var(--brand-white);
  color: #222;
}
/* Кнопки — брендовая типографика */
button, .btn, .role-btn { font-family: inherit; font-weight: 600; text-transform: uppercase; }

/* Шапка */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, #2b8feb, #2b8feb 70%, rgba(43,143,235,0.9));
  color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
  -webkit-transform: translateZ(0);
}
.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo { height: 52px; width: auto; }
.brand__name { font-weight: 700; letter-spacing: .3px; font-size: 16px; }
.brand__logo--white { filter: saturate(0) brightness(0) invert(1) contrast(110%); }
.nav { display: flex; gap: 22px; }
.nav__link {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 14px;
  opacity: .95;
}
.nav__link:hover { opacity: 1; text-decoration: underline; }
/* Политика: показываем иконку, прячем текст на мобильных */
.nav__link--policy { display: inline-flex; align-items: center; gap: 8px; }
.nav__link--policy svg { width: 18px; height: 18px; fill: currentColor; display: block; }
@media (max-width: 640px) { .nav__link--policy .label { display: none; } }

/* Хиро */
.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(0deg, rgba(43,143,235,0.72), rgba(43,143,235,0.72)),
    url('/assets/hero/image_fon.png') center/cover no-repeat;
  color: #fff;
}
.hero__content {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 20px 42px;
  z-index: 1;
}
/* карточка больше не используется */
.hero__title { font-size: 56px; line-height: 1.1; margin: 0 0 12px; }
.hero__subtitle { font-size: 18px; margin: 0 0 22px; opacity: .95; }
.hero h1, .hero h2, .hero h3 { color: #fff; }
.btn { padding: 10px 16px; border-radius: 8px; cursor: pointer; background:#f1f1f1; color:#333; border:1px solid #ddd; }
.btn-primary { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
a.btn { text-decoration: none; }
.btn-primary { background: var(--brand-blue); color: #fff; }
.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn-white { background: rgba(255,255,255,0.9); color: var(--brand-blue); box-shadow: 0 4px 18px rgba(0,0,0,0.08); backdrop-filter: blur(2px); }
.btn-white:hover { background: #ffffff; }
.btn-white:active { transform: translateY(1px); }

.hero__bg { position: absolute; inset: 0; background: none; z-index:0; pointer-events:none; }

/* Футер */
.site-footer { background: var(--brand-blue); color: #fff; }
.site-footer__inner { max-width: 1100px; margin: 0 auto; padding: 18px 20px; display:flex; align-items:center; gap:16px; flex-wrap:wrap; justify-content: flex-end; }
.contact-group { display:flex; gap:12px; align-items:center; }
.contact-btn { display:inline-flex; align-items:center; gap:8px; padding:10px 14px; border-radius:10px; color:#fff; text-decoration:none; background: rgba(255,255,255,0.12); transition: background .2s, transform .02s; }
.contact-btn:hover { background: rgba(255,255,255,0.2); }
.contact-btn:active { transform: translateY(1px); background: rgba(255,255,255,0.28); }
.contact-btn svg { width:18px; height:18px; fill: currentColor; }
/* Не переносить телефон/почту в одну строку на десктопе */
.contact-btn { white-space: nowrap; }

/* Карточка уведомления по ПДн */
.pdn-card { max-width: 1100px; }
.pdn-card__title { text-align: center; color: var(--brand-blue); margin: 0 0 8px; }
.pdn-card__content { background: #f9fbfe; border: 1px solid var(--brand-accent); border-radius: 12px; padding: 16px; }
.pdn-card__content p { margin: 8px 0; }

/* Убираем футер на всех страницах */
.site-footer { display: none !important; }

/* Контакты в шапке */
.header-contacts { display:flex; gap:12px; align-items:center; }
.header-contacts .contact-btn { background: rgba(255,255,255,0.14); }
.header-contacts .contact-btn:hover { background: rgba(255,255,255,0.22); }
@media (max-width: 640px) {
  .header-contacts .contact-btn .label { display:none; }
}

/* Контейнеры */
.container { max-width: 1100px; margin: 0 auto; padding: 30px 20px; }

/* Макет без прокрутки во время опроса */
html, body { height: 100%; }
html, body { overflow-x: hidden; }
body.survey-mode main { min-height: calc(100vh - 120px); display: flex; flex-direction: column; }
/* В режиме опроса не скрываем остальные секции, чтобы страница могла прокручиваться */
/* Карточка вопросов не фиксируется по высоте, чтобы страница прокручивалась до футера */
body.survey-mode .survey-container { flex: 0 0 auto; display: block; overflow: visible; }

/* На десктопах тоже оставляем скролл страницы; карточка — естественной высоты */
@media (hover: hover) and (pointer: fine) {
  body.survey-mode { overflow-y: auto; }
  body.survey-mode .survey-container { height: auto; }
}

/* FAQ */
.faq__grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 28px; }
.faq__item { background: #f9fbfe; border: 1px solid var(--brand-accent); border-radius: 12px; padding: 18px; }
.faq__item h3 { margin: 0 0 8px; color: var(--brand-blue); }

/* Обратная связь */
.feedback h2 { text-align: center; color: var(--brand-blue); margin: 0 0 10px; }
.feedback__hint { text-align: center; margin: 0 0 18px; color: #555; }
.feedback__form { display: grid; gap: 10px; width: 100%; max-width: 700px; margin: 0 auto; }
.feedback__form textarea { width: 100%; min-height: 120px; padding: 12px; border: 1px solid var(--brand-accent); border-radius: 8px; font-size: 14px; box-sizing: border-box; }
/* Кнопка уже и отцентрирована относительно текстового блока */
.feedback__form button { width: min(260px, 100%); justify-self: center; }

.survey-container {
  width: 700px;
  max-width: 700px;
  margin: 30px auto;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.survey-container * { box-sizing: border-box; }
/* При прокрутке к началу вопроса учитываем высоту шапки */
#question-box { scroll-margin-top: var(--header-height); }
/* чтобы футер-«контакты» не прятался под шапкой при якоре */
#contacts { scroll-margin-top: var(--header-height); }

h1, h2, h3 {
  text-align: center;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.roles {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.role-btn {
  padding: 12px 24px;
  background: var(--brand-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}
.role-btn:hover {
  background: #1973c8;
}

/* Единое интерактивное поведение кнопок на десктопе */
@media (hover: hover) and (pointer: fine) {
  .btn,
  .role-btn,
  #feedback-toggle-home,
  #feedback-form button,
  #thank-you #feedback-btn {
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  }
  .btn:hover,
  .role-btn:hover,
  #feedback-toggle-home:hover,
  #feedback-form button:hover,
  #thank-you #feedback-btn:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
  }
  .btn:active,
  .role-btn:active,
  #feedback-toggle-home:active,
  #feedback-form button:active,
  #thank-you #feedback-btn:active {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 4px 12px rgba(0,0,0,.10);
  }
}

/* Доступность: фокус */
.btn:focus-visible,
.role-btn:focus-visible,
#feedback-toggle-home:focus-visible,
#feedback-form button:focus-visible,
#thank-you #feedback-btn:focus-visible {
  outline: 2px solid #a7d0fb;
  outline-offset: 2px;
}

.hidden {
  display: none;
}

/* Скрывать форму спасибо по hidden, несмотря на ID-специфичность */
#feedback-form.hidden { display: none !important; }


.stars {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 56px;
  margin: 20px 0;
}

.star { cursor: pointer; transition: transform 0.15s ease; display:inline-flex; }
.star:hover { transform: none; }
.star svg { width: 56px; height: 56px; display:block; }
.star .shape { fill: #dfeaf7; stroke: #c5d6ea; stroke-linejoin: round; stroke-width: 1.2; }
.star.active .shape { fill: var(--brand-blue); stroke: var(--brand-blue); }
@keyframes star-pop { 0%{ transform: scale(.8); } 60%{ transform: scale(1.2);} 100%{ transform: scale(1);} }
.star.selected { animation: star-pop .22s ease-out; }

/* Да/Нет */
.yn-group { display:flex; gap:12px; justify-content:center; margin: 8px 0 6px; }
.yn-btn { background:#f1f1f1; color:#333; border:1px solid #ddd; padding: 10px 22px; border-radius:8px; }
.yn-btn.active, .yn-btn:hover { background: var(--brand-blue); color:#fff; border-color: var(--brand-blue); }

.comment {
  display: block;
  width: 100%;
  height: 80px;
  resize: vertical;
  margin: 10px 0 14px;
  padding: 10px;
  font-size: 14px;
  border: 1px solid var(--brand-accent);
  border-radius: 6px;
}

button {
  margin: 5px;
  padding: 10px 16px;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* Кнопки в вопросах — в линию и по ширине поля */
.actions { display: flex; gap: 12px; margin-top: 6px; width: 100%; }
.survey-container .actions button { margin: 0; }
.survey-container .skip-btn { flex: 1 1 0; }
.survey-container .back-btn { flex: 0 0 160px; }
.survey-container .next-btn { flex: 1 1 0; }
/* desktop: используем естественную высоту кнопок */

.back-btn, .next-btn, .skip-btn { background: #f1f1f1; color:#333; border: 1px solid #ddd; transition: transform .02s, box-shadow .2s, background .2s, color .2s; }
.back-btn:hover, .next-btn:hover, .skip-btn:hover { background: var(--brand-blue); color: #fff; box-shadow: 0 2px 12px rgba(43,143,235,.35); border-color: var(--brand-blue); }
.back-btn:active, .next-btn:active, .skip-btn:active { transform: translateY(1px); }

#progress-bar-container {
  width: 100%;
  background: var(--brand-accent);
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 20px;
}
#progress-bar {
  height: 100%;
  width: 0%;
  background: var(--brand-blue);
  transition: width 0.3s;
}

#feedback-form { margin-top: 20px; display: grid; gap: 10px; }
#feedback-form textarea { width: 100%; height: 120px; padding: 12px; font-size: 14px; border: 1px solid var(--brand-accent); border-radius: 8px; box-sizing: border-box; }
#feedback-form button { width: 98.5%; background: #f1f1f1; color:#333; border: 1px solid #ddd; margin-top: 0; justify-self: stretch; }
#feedback-form button:hover { background: var(--brand-blue); color:#fff; border-color: var(--brand-blue); }

/* Кнопка на экране спасибо — по центру */
#thank-you #feedback-btn { display:block; width:100%; margin:12px 0 0; }
#thank-you #feedback-btn { background:#f1f1f1; color:#333; border:1px solid #ddd; }
#thank-you #feedback-btn:hover { background: var(--brand-blue); color:#fff; border-color: var(--brand-blue); }
#thank-you #feedback-btn.is-active,
#thank-you #feedback-btn.is-active:hover { background: var(--brand-blue); color:#fff; border-color: var(--brand-blue); }

/* Модалка — центрирование текста */
.modal .modal__dialog h3,
.modal .modal__dialog p { text-align: center; }

@media (max-width: 760px) {
  .survey-container { width: calc(100% - 32px); }
  .star svg { width: 48px; height: 48px; }
  /* В колонке высота кнопок одинаковая; сбрасываем прежний flex-basis у back-btn */
  .survey-container .back-btn { flex-basis: auto !important; width: 100%; }
  .btn, button { font-size: 16px; }
  .comment { font-size: 16px; }
  /* Скрыть «Главная» в шапке на мобильных */
  #nav-home { display: none; }
  /* Футер: переносим контакты на 2 строки, вправо */
  .contact-group { flex-direction: column; align-items: flex-end; gap:8px; width: 100%; }
  .contact-btn { font-size: 14px; padding:8px 12px; width: 90%; max-width: 340px; justify-content: center; margin-left: auto; }
  .pdn-card__content { padding: 14px; }
  /* Выбор роли — в столбик и на всю ширину */
  .roles { flex-direction: column; gap: 12px; align-items: stretch; }
  .role-btn { width: 100%; }
  /* Кнопки в вопросах — одинаковая высота, первая — Продолжить */
  .actions { flex-direction: column; }
  .actions .next-btn { order: 1; }
  .actions .back-btn { order: 2; }
  .actions .skip-btn { order: 3; }
  /* Только выравниваем back-btn по естественной высоте остальных */
  .actions button { padding: 12px 14px; white-space: nowrap; }
  .actions .back-btn { height: auto; }
  .yn-group { gap: 10px; }
  .yn-btn { flex: 1 1 0; }
}

@media (max-width: 480px) {
  .hero__title { font-size: 32px; }
  .star svg { width: 40px; height: 40px; }
  .actions { flex-direction: column; }
  .survey-container .back-btn { width: 100%; flex-basis: auto !important; }
}

@media (max-width: 360px) {
  .star svg { width: 36px; height: 36px; }
  .btn, button { font-size: 14px; }
}

/* Loading state for buttons */
.btn.is-loading, button.is-loading { position: relative; pointer-events: none; opacity: .92; }
.btn.is-loading::after, button.is-loading::after {
  content: '';
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .6s linear infinite;
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
}
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

@media (max-width: 1024px) {
  .site-header__inner { padding: 14px 16px; }
}

/* Адаптив */
@media (max-width: 760px) {
  .faq__grid { grid-template-columns: 1fr; }
  .hero__title { font-size: 36px; }
}

/* Переход к выбору роли */
.fade-out { opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease; }
.fade-in { opacity: 1; transform: translateY(0); transition: opacity .25s ease, transform .25s ease; }
.role-step { max-width: 760px; margin: 20px auto; padding: 20px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal.hidden { display: none !important; }
.modal .modal__dialog { background: #fff; color: #111; border-radius: 12px; padding: 20px; max-width: 450px; width: calc(100% - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal .modal__actions { display:flex; gap: 10px; justify-content:flex-end; margin-top: 14px; }
.modal .btn { background:#f1f1f1; color:#333; border:1px solid #ddd; transition: transform .02s, box-shadow .2s, background .2s, color .2s; }
.modal .btn:hover { background: var(--brand-blue); color:#fff; border-color: var(--brand-blue); box-shadow: 0 2px 12px rgba(43,143,235,.35); }
.modal .btn:active { transform: translateY(1px); }

/* Мобильная модалка: кнопки в три ряда по одной */
@media (max-width: 480px) {
  .modal .modal__dialog { padding: 16px; width: calc(100% - 24px); max-width: 420px; }
  .modal .modal__actions { flex-direction: column; justify-content: stretch; align-items: stretch; gap: 8px; }
  .modal .btn { width: 100%; font-size: 14px; padding: 12px 14px; }
}

/* Cookie banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: #fff; border-top: 1px solid #e5e5e5; box-shadow: 0 -8px 30px rgba(0,0,0,.08); }
.cookie-banner__inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.cookie-banner__text { color: #222; line-height: 1.45; }
.cookie-banner__text a { color: var(--brand-blue); font-weight: 600; }
.cookie-banner__actions { display: flex; gap: 10px; flex-shrink: 0; }
@media (max-width: 760px) {
  .cookie-banner__inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .cookie-banner__actions { justify-content: flex-end; }
}
