*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --blue: #3B5EDB;
  --blue-light: #4A6DE8;
  --blue-dark: #2D4BB8;
  --red: #E53935;
  --red-cta: #E53935;
  --green: #4CAF50;
  --yellow: #F9A825;
  --text: #1A1A2E;
  --text-secondary: #5A5A6E;
  --text-hint: #7A7A8E;
  --white: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-glass: rgba(255, 255, 255, 0.72);
  --border: #E0E0E0;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --radius-card: 20px;
  --radius-option: 14px;
  --radius-btn: 12px;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background: linear-gradient(160deg, #b8cef5 0%, #d4e0f7 15%, #e8eefb 30%, #f5f5f5 50%, #f7e8e8 70%, #f0c8c8 85%, #e8b0b0 100%);
}


/* ========== ФОНОВЫЙ ФЛАГ ========== */

.bg-flag {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-flag::before {
  content: '';
  position: absolute;
  top: -15%;
  right: -10%;
  width: 80%;
  height: 130%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.9) 30%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0.3) 100%
  );
  border-radius: 40% 0 0 60%;
  transform: rotate(-8deg);
  filter: blur(2px);
}

.bg-flag::after {
  content: '';
  position: absolute;
  top: 5%;
  right: 0;
  width: 55%;
  height: 90%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.7) 40%,
    rgba(255, 255, 255, 0.3) 100%
  );
  border-radius: 50% 0 0 40%;
  transform: rotate(-5deg) translateX(10%);
  filter: blur(8px);
}

/* ========== ХЕДЕР ========== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
}

.logo-blue {
  color: var(--blue);
}

.logo-red {
  color: var(--red);
}

.logo-sub {
  font-size: 10px;
  color: var(--red);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.rating {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stars {
  color: #F9A825;
  font-size: 14px;
  letter-spacing: 1px;
}

.rating-text {
  font-size: 9px;
  color: var(--blue);
  font-weight: 500;
  line-height: 1.2;
}

/* ========== ОСНОВНОЙ КОНТЕЙНЕР ========== */

.quiz-container {
  position: relative;
  z-index: 10;
  max-width: 720px;
  margin: 0 auto;
    padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ========== ШАГИ ========== */

.step {
  display: none;
  width: 100%;
  animation: fadeIn 0.4s ease;
}

.step.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== КАРТОЧКИ ========== */

.card {
  width: 100%;
  border-radius: var(--radius-card);
  padding: 40px 44px;
  box-shadow: var(--shadow);
}

.card--glass {
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.card--question,
.card--loading,
.card--result {
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card--start {
  text-align: center;
  padding: 48px 44px;
}

.card--loading {
  text-align: center;
  padding: 60px 44px 80px;
}

.card--result {
  padding: 40px 44px 36px;
}

/* ========== СТАРТОВЫЙ ЭКРАН ========== */

.start-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 20px;
}

.highlight-blue {
  color: var(--blue);
}

.start-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== ПРОГРЕСС-БАР ========== */

.progress-bar-wrap {
  width: 100%;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.progress-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.progress-percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  margin-left: auto;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #E8ECF0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ========== ЗЕЛЕНЫЙ БАБЛ ========== */

.bubble-hint {
  align-self: center;
  background: var(--green);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 24px;
  border-radius: 20px;
  margin-bottom: 12px;
}

/* ========== ВОПРОСЫ ========== */

.question-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 24px;
}

.question-subtitle {
  font-size: 13px;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ========== ВАРИАНТЫ ОТВЕТОВ ========== */

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-option);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: var(--white);
}

.option:hover {
  border-color: #c0c8d8;
}

.option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-text {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.option-radio,
.option-check {
  width: 22px;
  height: 22px;
  border: 2px solid #C0C0C0;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.option-check {
  border-radius: 5px;
}

.option input:checked ~ .option-radio,
.option input:checked ~ .option-check {
  border-color: var(--blue);
}

.option input:checked ~ .option-radio::after,
.option input:checked ~ .option-check::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--blue);
  border-radius: 50%;
}

.option input:checked ~ .option-check::after {
  border-radius: 2px;
  width: 10px;
  height: 10px;
}

.option.selected {
  border-color: var(--blue);
}

.option.selected .option-text {
  color: var(--blue);
  font-weight: 600;
}

/* ========== ПОДСКАЗКИ ========== */

.question-hint {
  font-size: 12px;
  color: var(--text-hint);
  text-align: center;
  line-height: 1.5;
  font-style: italic;
}

.hint-link {
  color: var(--blue);
  text-decoration: underline;
}

/* ========== НАВИГАЦИЯ ВНИЗУ ========== */

.nav-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 24px;
  padding: 0 4px;
}

.nav-counter {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ========== КНОПКИ ========== */

.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-btn);
  padding: 14px 36px;
  transition: all 0.25s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn--primary {
  background: var(--blue);
  color: var(--white);
  min-width: 160px;
}

.btn--primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 94, 219, 0.3);
}

.btn--outline {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border);
  min-width: 120px;
}

.btn--outline:hover {
  border-color: #aaa;
  color: var(--text);
}

.btn--start {
  padding: 16px 48px;
  font-size: 16px;
  border-radius: 14px;
}

.btn--cta {
  background: var(--red-cta);
  color: var(--white);
  width: 100%;
  padding: 18px 36px;
  font-size: 16px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

.btn--cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -3px;
  width: 6px;
  height: 100%;
  background: #ff1a1a;
  border-radius: 14px 0 0 14px;
}

.btn--cta:hover {
  background: #C62828;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(229, 57, 53, 0.35);
}

.btn--checklist {
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 500;
}

.btn--checklist:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* ========== ЗАГРУЗКА ========== */

.loading-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 32px;
}

.gears {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  height: 80px;
}

.gear {
  color: var(--blue);
}

.gear--1 {
  animation: spin 3s linear infinite;
  position: relative;
  z-index: 1;
}

.gear--2 {
  animation: spinReverse 2.4s linear infinite;
  margin-left: -8px;
  margin-top: 14px;
  position: relative;
  z-index: 0;
}

.gear--3 {
  animation: spin 2.8s linear infinite;
  margin-left: -6px;
  position: relative;
  z-index: 1;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.loading-percent {
  font-size: 24px;
  font-weight: 700;
  color: var(--blue);
}

/* ========== РЕЗУЛЬТАТЫ ========== */

.result-icon {
  text-align: center;
  margin-bottom: 20px;
}

.result-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 20px;
}

.result-title--green {
  color: var(--red);
}

.result-title--yellow {
  color: #E68A00;
}

.result-title--red {
  color: var(--red);
}

.result-text {
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
  color: var(--text);
  margin-bottom: 16px;
}

.result-text strong {
  color: var(--red);
}

.result-list {
  list-style: none;
  margin-bottom: 20px;
  padding: 0;
}

.result-list li {
  font-size: 14px;
  line-height: 1.5;
  padding: 4px 0 4px 28px;
  position: relative;
}

.result-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform: rotate(-45deg);
}

.text-link {
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}

/* ========== ФОРМА ========== */

.form-section {
  margin-top: 24px;
  width: 100%;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
  color: var(--text);
}

.form-input::placeholder {
  color: #B0B0B0;
}

.form-input:focus {
  border-color: var(--blue);
}

.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.phone-input-wrap:focus-within {
  border-color: var(--blue);
}

.phone-flag {
  font-size: 20px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.form-input--phone {
  border: none;
  border-radius: 0;
  padding-left: 0;
}

.form-input--phone:focus {
  border-color: transparent;
}

.form-disclaimer {
  font-size: 11px;
  color: var(--text-hint);
  text-align: center;
  line-height: 1.5;
  margin-top: 12px;
}

.form-disclaimer a {
  color: var(--blue);
}

/* ========== ЧЕК-ЛИСТ ========== */

.checklist-section {
  margin-top: 28px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.checklist-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* ========== АДАПТИВ ========== */

@media (max-width: 768px) {
  .header {
    padding: 14px 16px;
  }

  .logo-name {
    font-size: 22px;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
  }

  .quiz-container {
    padding: 100px 12px 24px;
    justify-content: flex-start;
    min-height: 0;
  }

  .card {
    padding: 28px 20px;
    border-radius: 16px;
  }

  .card--start {
    padding: 32px 20px;
  }

  .start-title {
    font-size: 19px;
  }

  .start-title br {
    display: none;
  }

  .start-desc {
    font-size: 14px;
  }

  .question-title {
    font-size: 17px;
  }

  .question-title br {
    display: none;
  }

  .result-title {
    font-size: 17px;
  }

  .result-title br {
    display: none;
  }

  .option {
    padding: 14px 16px;
  }

  .option-text {
    font-size: 14px;
  }

  .btn--start {
    padding: 14px 28px;
    font-size: 15px;
  }

  .btn--primary {
    min-width: 130px;
    padding: 12px 24px;
    font-size: 14px;
  }

  .btn--outline {
    min-width: 100px;
    padding: 12px 20px;
    font-size: 14px;
  }

  .nav-bottom {
    margin-top: 16px;
  }
}

@media (max-width: 420px) {
  .quiz-container {
    padding: 90px 10px 16px;
  }

  .card {
    padding: 20px 14px;
  }

  .card--start {
    padding: 24px 14px;
  }

  .start-title {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .start-desc {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .btn--start {
    padding: 12px 24px;
    font-size: 14px;
  }

  .question-title {
    font-size: 15px;
    margin-bottom: 16px;
  }

  .option {
    padding: 12px 14px;
  }

  .option-text {
    font-size: 13px;
  }

  .option-text br {
    display: none;
  }

  .question-hint {
    font-size: 11px;
  }

  .result-title {
    font-size: 15px;
  }

  .result-text {
    font-size: 13px;
  }

  .nav-bottom {
    margin-top: 12px;
  }

  .btn--primary {
    min-width: 110px;
    padding: 10px 20px;
    font-size: 13px;
  }

  .btn--outline {
    min-width: 80px;
    padding: 10px 16px;
    font-size: 13px;
  }
}
