:root {
  --ink: #18202b;
  --muted: #667085;
  --line: rgba(24, 32, 43, 0.14);
  --paper: rgba(255, 255, 255, 0.9);
  --accent: #0f766e;
  --accent-dark: #115e59;
  --gold: #d69e2e;
  --danger: #c2410c;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #e7eef1;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(214, 158, 46, 0.12)),
    #edf2f4;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  padding: clamp(18px, 3vw, 42px);
  display: grid;
  place-items: center;
}

.quiz-layout {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  position: relative;
  min-height: 720px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 18, 27, 0.1), rgba(12, 18, 27, 0.86)),
    url("https://images.unsplash.com/photo-1503376780353-7e6692767b70?auto=format&fit=crop&w=1400&q=85") center / cover;
  transform: scale(1.02);
  z-index: -2;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(15, 118, 110, 0.78), transparent 46%),
    linear-gradient(12deg, rgba(214, 158, 46, 0.42), transparent 34%);
  z-index: -1;
}

.hero-content {
  width: 100%;
  padding: clamp(28px, 5vw, 58px);
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(36px, 5vw, 70px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-content p {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.55;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 38px;
}

.hero-stats div {
  min-height: 104px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-stats strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.hero-stats span {
  display: block;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.35;
}

.quiz-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(24px, 4vw, 44px);
  background: var(--paper);
}

.form-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 4px;
}

.form-head span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-head strong {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field,
.field-group {
  display: grid;
  gap: 10px;
  margin: 0;
}

.field span,
.field-group legend {
  padding: 0;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.field input:focus {
  border-color: rgba(15, 118, 110, 0.65);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.13);
}

.option-grid {
  display: grid;
  gap: 10px;
}

.car-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fuel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-grid label {
  min-height: 52px;
  cursor: pointer;
}

.option-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-grid span {
  height: 100%;
  min-height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.option-grid input:checked + span {
  border-color: rgba(15, 118, 110, 0.75);
  background: #e7f6f3;
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.submit-btn {
  min-height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0f4f4a);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.28);
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(15, 118, 110, 0.34);
}

.submit-btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.submit-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.status.is-error {
  color: var(--danger);
}

.status.is-success {
  color: var(--accent-dark);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 18, 25, 0.58);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(10px);
  transition: opacity 0.22s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.success-modal {
  position: relative;
  width: min(430px, 100%);
  padding: 38px 30px 30px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 249, 0.96)),
    #fff;
  box-shadow: 0 32px 90px rgba(4, 18, 30, 0.32);
  text-align: center;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.22s ease;
}

.modal-overlay.is-open .success-modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #52606d;
  background: #fff;
  cursor: pointer;
}

.modal-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.success-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #16a34a);
  box-shadow: 0 18px 36px rgba(15, 118, 110, 0.3);
}

.success-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-eyebrow {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.success-modal h2 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.success-modal p {
  margin: 14px auto 0;
  max-width: 310px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.modal-action {
  width: 100%;
  min-height: 52px;
  margin-top: 26px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.22);
}

@media (max-width: 980px) {
  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 520px;
  }
}

@media (max-width: 620px) {
  .page-shell {
    padding: 0;
    place-items: stretch;
  }

  .quiz-layout {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .hero-panel {
    min-height: 420px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stats div {
    min-height: 78px;
  }

  .car-grid,
  .fuel-grid {
    grid-template-columns: 1fr;
  }
}
