/* Анкета БЖ × «Власний імпорт». Фірмові кольори: сірий #D9D9D9 (картка) і
   синій #095FDA (текст та інтерактив), шрифт Suisse Int'l (див. fonts.css). */

:root {
  --page: #FFFFFF;
  --card: #D9D9D9;  /* як у макетах і фон логотипу (у старому CSS було #E5E5E5 → «квадрат» навколо лого) */
  --ink: #095FDA;
  --ink-soft: #095FDA;
  --accent: #095FDA;
  --accent-track: rgba(9, 95, 218, 0.2);
  --field: #FFFFFF;
  --placeholder: rgba(9, 95, 218, 0.5);
  --error: #D3141B;
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Suisse Intl', 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

a { color: var(--accent); font-weight: 700; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 1144px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}

/* --- Card --- */
.card {
  background: var(--card);
  padding: 56px 80px;
  scroll-margin-top: 16px;
}

.card-header { display: flex; flex-direction: column; align-items: center; }

/* Банер на всю ширину картки (компенсуємо її padding). */
.banner {
  display: block;
  align-self: stretch;
  margin: -56px -80px 32px;
}
.banner img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2400 / 1260;
}
/* Під час питань — смуга з логотипом БЖ і написом «ОПИТУВАННЯ». */
.card.is-compact .banner img {
  aspect-ratio: 4.5 / 1;
  object-fit: cover;
  object-position: 50% 34%;
}

.progress {
  width: 100%;
  height: 3px;
  background: var(--accent-track);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.35s ease;
}
.progress-text {
  min-height: 20px;
  margin: 14px 0 28px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* --- Steps --- */
.step { display: none; }
.step.active { display: block; animation: fade-in 0.25s ease-out; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .step.active { animation: none; }
  .progress-fill { transition: none; }
}

.intro-text {
  max-width: 760px;
  margin: 8px auto 40px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.question-text {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}
.question-text:focus { outline: none; }

.question-hint {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* --- Options --- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.options { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 24px; }

.option { position: relative; }
.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 22px; height: 22px;
  margin: 0;
  top: 10px; left: 0;
}
.option label {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 9px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
}
.option label::before {
  content: "";
  flex-shrink: 0;
  width: 22px; height: 22px;
  margin-top: 1px;
  border: 2px solid var(--accent);
  background: transparent;
  transition: background 0.12s;
}
.option input[type="radio"] + label::before { border-radius: 50%; }
.option input[type="radio"]:checked + label::before {
  background: radial-gradient(circle, var(--accent) 0 45%, transparent 50%);
}
.option input[type="checkbox"]:checked + label::before { background: var(--accent); box-shadow: inset 0 0 0 3px var(--card); }
.option input:focus-visible + label::before { outline: 3px solid var(--accent); outline-offset: 2px; }
.option label:hover { opacity: 0.82; }

.option-extra { margin: 2px 0 8px 38px; }

.reveal {
  margin: 6px 0 10px 38px;
  padding: 16px 20px;
  background: var(--field);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.55;
}

.field {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.field::placeholder { color: var(--placeholder); }
.field:focus { outline: none; border-color: var(--accent); }
.field-phone { max-width: 420px; margin: 20px 0 12px; font-size: 18px; letter-spacing: 0.02em; }

/* --- Scale --- */
.scale-wrap { margin: 16px 0 24px; }
.scale { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.scale-item { position: relative; }
.scale-item input { position: absolute; opacity: 0; inset: 0; margin: 0; pointer-events: none; }
.scale-item label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s;
}
.scale-item input:checked + label { background: var(--accent); color: #fff; }
.scale-item input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 3px; }
.scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 420px;
  margin: 10px auto 0;
  font-size: 14px;
  font-weight: 600;
}
.scale-labels span:last-child { text-align: right; }

/* --- Errors --- */
.error { margin: -8px 0 16px; color: var(--error); font-size: 15px; font-weight: 700; }
.has-error .options .option label::before,
.has-error .scale-item label { border-color: var(--error); }

/* --- Buttons --- */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 36px; }
.nav.center { justify-content: center; }

.btn {
  display: inline-block;
  padding: 14px 36px;
  border: 2px solid var(--accent);
  border-radius: 2px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: transparent; color: var(--accent); }
.btn:hover { opacity: 0.88; }
.btn:disabled { opacity: 0.45; cursor: progress; }

/* --- Messages (thanks / closed) --- */
.step-message, .card-message { text-align: center; }
.card-message { display: flex; flex-direction: column; align-items: center; }
.message-title { margin: 8px 0 0; font-size: 30px; font-weight: 800; line-height: 1.25; }
.message-title:focus { outline: none; }
.message-text { max-width: 720px; margin: 16px auto 0; font-size: 17px; line-height: 1.6; }

.noscript { text-align: center; font-weight: 700; }

/* --- 18+ modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}
.modal[hidden] { display: none; }
.modal-box {
  width: 100%;
  max-width: 480px;
  padding: 40px 32px;
  background: var(--page);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modal-title { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.4; }
.modal .nav { margin-top: 28px; }
.modal .btn { min-width: 120px; }

/* --- Mobile --- */
@media (max-width: 720px) {
  .container { padding: 16px 16px 32px; }
  .card { padding: 28px 20px; }
  .banner { margin: -28px -20px 20px; }
  .card.is-compact .banner img { aspect-ratio: 3 / 1; object-position: 50% 25%; }
  .progress-text { font-size: 13px; margin: 10px 0 18px; }
  .intro-text { font-size: 20px; margin-bottom: 28px; }
  .question-text { font-size: 19px; }
  .question-hint { font-size: 13px; margin-bottom: 12px; }
  .option label { font-size: 16px; gap: 14px; }
  .option-extra, .reveal { margin-left: 0; }
  .reveal { font-size: 15px; }
  .scale { gap: 8px; }
  .scale-item label { width: 48px; height: 48px; font-size: 17px; }
  .scale-labels { font-size: 12px; }
  .btn { padding: 13px 22px; font-size: 15px; }
  .message-title { font-size: 23px; }
  .message-text { font-size: 15px; }
}
