/* test.dengo.ru — wizard form styles */

.wizard-body { background: #fff; }

/* progress bar */
.step-bar {
  background: var(--c-bg-blue);
  padding: 12px 16px;
}
.step-bar__label {
  font-weight: 600;
  font-size: 12px;
  color: var(--c-navy);
  margin-bottom: 8px;
}
.step-bar__track {
  display: flex;
  gap: 6px;
}
.step-bar__seg {
  flex: 1 1 0;
  height: 4px;
  border-radius: 2px;
  background: var(--c-blue-2);
}
.step-bar__seg--done    { background: var(--c-blue); }
.step-bar__seg--current { background: var(--c-yellow); }

/* hero for form (smaller than main) */
.hero--form {
  padding: 20px 16px;
  background: var(--c-bg-blue);
}
.hero--form .hero__title {
  font-size: 22px;
  line-height: 1.18;
  margin: 0;
}
.hero--form .hero__subtitle {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--c-muted);
}

/* main wizard column */
.wizard {
  padding: 16px;
  background: #fff;
}

/* info/security badge */
.wizard__badge,
.wizard__note {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--c-bg-blue);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 20px;
}
.wizard__note { margin: 16px 0 0; }
.wizard__badge-text { font-weight: 600; font-size: 13px; color: var(--c-navy); }
.wizard__badge-icon {
  width: 20px;
  height: 20px;
  background: var(--c-yellow);
  border-radius: 4px;
  flex-shrink: 0;
}

/* form fields */
.form { display: flex; flex-direction: column; }
.field {
  display: block;
  position: relative;
  margin-bottom: 16px;
}

/* Visible label for type="date" inputs (HTML5 date pickers don't render placeholder) */
.field-label {
  display: block;
  font-size: 12px;
  color: var(--c-muted);
  margin-bottom: 4px;
  padding: 0 4px;
}
.field input[type="date"] {
  text-transform: uppercase;  /* makes empty-state placeholder text consistent */
  font-family: inherit;
}
.field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(20%) sepia(40%) saturate(900%) hue-rotate(195deg);  /* navy tint */
  cursor: pointer;
}
.field input[type="date"]:invalid { color: var(--c-input-placeholder); }
.field input[type="date"]:valid { color: var(--c-navy); }
.field input,
.field select {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  color: var(--c-navy);
  background: #fff;
  border: 2px solid var(--c-blue-2);
  border-radius: var(--radius-lg);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%233a6fd8' stroke-width='2' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 40px;
}
.field input::placeholder { color: var(--c-input-placeholder); }
.field input:focus,
.field select:focus { border-color: var(--c-blue); }

.field--filled input,
.field--filled select { border-color: var(--c-blue); color: var(--c-navy); }
.field--error input,
.field--error select { border-color: #d33; }

.field-error {
  margin: -10px 0 12px;
  font-size: 12px;
  color: #d33;
  padding: 0 4px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}
.field-row .field { margin-bottom: 16px; }

/* "Авто"-поле — заполняется через API из соседних полей; визуально мягче */
.field--auto input {
  background: var(--c-bg-blue);
  border-color: var(--c-blue-2);
  color: var(--c-navy);
  padding-right: 44px;
}
.field--auto input:focus { background: #fff; border-color: var(--c-blue); }
.field--auto input::placeholder { font-size: 13px; }
.field--auto__icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--c-yellow);
  pointer-events: none;
  line-height: 1;
}
.field--auto.field--filled input { background: #fff; }

/* Consent at step 5 (sticky-сноска + чекбокс перед отправкой) */
.form__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 4px;
  padding: 12px;
  background: var(--c-bg-blue);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.5;
  color: var(--c-navy);
  cursor: pointer;
}
.form__consent input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin: 1px 0 0;
  accent-color: var(--c-blue);
  cursor: pointer;
}
.form__consent a {
  color: var(--c-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.form__consent a:hover { color: var(--c-navy); }
.field--error .form__consent,
.form__consent.field--error {
  border-color: #d33;
  background: #ffe8e8;
}

/* back link */
.wizard__back {
  display: inline-block;
  margin-top: 12px;
  color: var(--c-blue);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* ---------------- thank-you ---------------- */
.thank-you {
  text-align: center;
  padding: 48px 24px 32px;
  background: #fff;
}
.thank-you__icon { margin: 0 auto 24px; width: 64px; height: 64px; }
.thank-you__title {
  font-weight: 800;
  font-size: 22px;
  line-height: 1.25;
  color: var(--c-navy);
  margin-bottom: 16px;
}
.thank-you__subtitle {
  color: var(--c-muted);
  font-size: 14px;
  margin-bottom: 4px;
}
/* Ring spinner (used above "Подбираем для вас лучшие условия") */
.spinner {
  display: block;
  margin: 0 auto 28px;
  border-style: solid;
  border-color: var(--c-bg-blue);
  border-top-color: var(--c-yellow);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.spinner--lg { width: 56px; height: 56px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Прогресс-бар на pending-экране — заменяет молчаливый spinner.
   Стадии меняет thank_you.js по таймеру (0-30/30-90/90-180 с). */
.progress {
  max-width: 480px;
  margin: 28px auto 0;
}
.progress__bar {
  background: var(--c-bg-blue, #eaf1ff);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-yellow, #ffb700), var(--c-navy, #1d3461));
  border-radius: 999px;
  width: 0;
  transition: width 0.6s ease-out;
  will-change: width;
}
.progress__stages {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.progress__stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--c-muted, #94a0b8);
  text-align: center;
  opacity: 0.6;
  transition: opacity 0.4s ease;
}
.progress__dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-bg-blue, #eaf1ff);
  border: 2px solid var(--c-bg-blue, #eaf1ff);
  display: inline-block;
  position: relative;
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}
.progress__stage.is-active {
  opacity: 1;
  color: var(--c-navy, #1d3461);
  font-weight: 600;
}
.progress__stage.is-active .progress__dot {
  background: var(--c-yellow, #ffb700);
  border-color: var(--c-yellow, #ffb700);
  transform: scale(1.08);
  animation: progress-pulse 1.6s ease-in-out infinite;
}
.progress__stage.is-done {
  opacity: 0.85;
  color: var(--c-navy, #1d3461);
}
.progress__stage.is-done .progress__dot {
  background: var(--c-navy, #1d3461);
  border-color: var(--c-navy, #1d3461);
}
.progress__stage.is-done .progress__dot::after {
  content: '';
  position: absolute;
  inset: 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 6.5l2.5 2.5L10 3' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
@keyframes progress-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 183, 0, 0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(255, 183, 0, 0); }
}
.thank-you__subtitle--lead {
  font-size: 15px;
  margin-bottom: 0;
}
@media (max-width: 480px) {
  .progress__label { font-size: 11px; }
  .progress__dot   { width: 20px; height: 20px; }
}

/* Declined / sent / error icon variants on thank-you */
.thank-you__icon--declined,
.thank-you__icon--sent { margin: 0 auto 24px; width: 64px; height: 64px; }
.thank-you__retry { display: inline-block; margin-top: 28px; max-width: 280px; }

/* =============================================================
   TABLET / DESKTOP — >=768px
   Centered card layout, like privsosed.ru/anketa.
   ============================================================= */
@media (min-width: 768px) {
  /* Page background — light blue carries through behind the card */
  body.wizard-body { background: var(--c-bg-blue); }

  /* Step bar — blends with page bg, content constrained to card width */
  .step-bar {
    background: transparent;
    padding: 32px 16px 8px;
  }
  .step-bar__inner {
    max-width: 560px;
    margin: 0 auto;
  }
  .step-bar__label { font-size: 13px; }

  /* Hero (page heading) — same column, transparent bg */
  .hero--form {
    background: transparent;
    padding: 8px 16px 24px;
  }
  .hero--form .hero__title,
  .hero--form .hero__subtitle {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
  .hero--form .hero__title { font-size: 30px; line-height: 1.1; }

  /* Wizard — main form card */
  .wizard {
    max-width: 560px;
    margin: 0 auto 48px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(29, 52, 97, 0.08);
    padding: 32px;
  }

  /* Thank-you page — centered narrow column */
  .thank-you {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(29, 52, 97, 0.08);
    padding: 64px 32px 48px;
    margin-top: 40px;
    margin-bottom: 48px;
  }
  .thank-you__title { font-size: 26px; }
}

/* =============================================================
   DESKTOP — >=1024px
   ============================================================= */
@media (min-width: 1024px) {
  .step-bar { padding-top: 48px; }
  .hero--form .hero__title { font-size: 34px; }
  .wizard { padding: 40px; }
}
