/* ===== Tokens ===== */
:root {
  --bg: #040810;
  --bg-panel: rgba(8, 17, 31, 0.72);
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --accent: #2563EB;
  --accent-soft: rgba(37, 99, 235, 0.18);
  --accent-glow: rgba(37, 99, 235, 0.45);
  --text: #FFFFFF;
  --text-soft: rgba(255, 255, 255, 0.62);
  --text-muted: rgba(255, 255, 255, 0.38);
  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(37, 99, 235, 0.55);
  --radius: 20px;
  --radius-sm: 14px;
  --font: 'Manrope', system-ui, sans-serif;
  --font-display: 'Instrument Serif', Georgia, serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ===== Ambient ===== */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  opacity: 0;
}

body.quiz-open .cursor-glow { opacity: 1; }

@media (hover: hover) {
  .cursor-glow { opacity: 0.6; }
}

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes lineGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.anim-in {
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) forwards;
  animation-delay: var(--d, 0s);
}

/* ===== Button ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 36px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), background 0.3s ease;
}

.btn--primary {
  background: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 20px 40px -12px var(--accent-glow);
}

.btn--primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 28px 56px -12px var(--accent-glow);
}

.btn--primary svg { transition: transform 0.4s var(--ease-out); }
.btn--primary:hover svg { transform: translateX(4px); }

.btn--ghost {
  border: 1px solid var(--border);
  padding: 14px 28px;
  border-radius: 100px;
  color: var(--text-soft);
  transition: border-color 0.3s, color 0.3s;
}

.btn--ghost:hover {
  border-color: var(--border-active);
  color: var(--text);
}

.btn--submit {
  width: 100%;
  margin-top: 8px;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bg);
}

.hero__bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to right, var(--bg) 48%, transparent 52%);
}

/* Right half — decorative image only */
.hero__decor {
  position: absolute;
  right: 0;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero__decor-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.48;
  filter: grayscale(20%) brightness(0.52) contrast(1.05);
  animation: decorDrift 24s ease-in-out infinite alternate;
}

.hero__decor-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, var(--bg) 0%, rgba(4, 8, 16, 0.75) 18%, rgba(4, 8, 16, 0.35) 45%, rgba(4, 8, 16, 0.55) 100%),
    linear-gradient(to bottom, rgba(4, 8, 16, 0.35) 0%, transparent 35%, transparent 65%, rgba(4, 8, 16, 0.5) 100%);
}

@keyframes decorDrift {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

.hero__header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(24px, 5vw, 64px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.brand__name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__badge {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 100px;
}

.hero__content {
  position: relative;
  z-index: 3;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 36px;
  padding: 0 clamp(24px, 5vw, 64px) 48px;
  max-width: 640px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.2vw, 3rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

.hero__title em {
  font-style: italic;
  color: var(--accent);
}

.hero__subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  color: var(--text-soft);
  max-width: 480px;
  margin-bottom: 0;
  font-weight: 400;
  line-height: 1.7;
}

.hero__perks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 28px;
  margin-bottom: 0;
}

.hero__perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 500;
}

.perk-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  right: clamp(24px, 5vw, 64px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  transform-origin: top;
  animation: lineGrow 1.5s var(--ease-out) 1s forwards;
  transform: scaleY(0);
}

/* ===== Quiz overlay ===== */
.quiz {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 16, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-out), visibility 0.5s;
}

.quiz.is-open {
  opacity: 1;
  visibility: visible;
}

.quiz__panel {
  width: 100%;
  max-width: 680px;
  max-height: min(90vh, 820px);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
  transform: translateY(40px) scale(0.96);
  transition: transform 0.6s var(--ease-out);
}

.quiz.is-open .quiz__panel {
  transform: translateY(0) scale(1);
}

.quiz__top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.quiz__back,
.quiz__close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
  flex-shrink: 0;
}

.quiz__back:hover,
.quiz__close:hover {
  border-color: var(--border-active);
  color: var(--text);
  background: var(--accent-soft);
}

.quiz__back:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.quiz__progress-wrap {
  flex: 1;
}

.quiz__progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 8px;
}

.quiz__progress-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--accent), #60A5FA, var(--accent));
  background-size: 200% 100%;
  border-radius: 100px;
  transition: width 0.6s var(--ease-out);
  animation: shimmer 3s linear infinite;
}

.quiz__step-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.quiz__body {
  flex: 1;
  overflow-y: auto;
  padding: 36px 28px 40px;
}

.quiz-step {
  animation: fadeUp 0.5s var(--ease-out);
}

.quiz-step__question {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

.quiz-step__options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-soft);
  text-align: left;
  transition: border-color 0.35s var(--ease-out), background 0.35s, transform 0.35s var(--ease-out), color 0.35s, box-shadow 0.35s;
  opacity: 0;
  animation: fadeUp 0.45s var(--ease-out) forwards;
}

.quiz-option:nth-child(1) { animation-delay: 0.05s; }
.quiz-option:nth-child(2) { animation-delay: 0.1s; }
.quiz-option:nth-child(3) { animation-delay: 0.15s; }
.quiz-option:nth-child(4) { animation-delay: 0.2s; }
.quiz-option:nth-child(5) { animation-delay: 0.25s; }
.quiz-option:nth-child(6) { animation-delay: 0.3s; }
.quiz-option:nth-child(7) { animation-delay: 0.35s; }

.quiz-option::after {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  margin-left: 16px;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.quiz-option:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
  transform: translateX(4px);
}

.quiz-option.is-selected {
  border-color: var(--border-active);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: 0 0 30px -10px var(--accent-glow);
}

.quiz-option.is-selected::after {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Final step form */
.quiz-final__intro {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.quiz-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-form__label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.quiz-form__label span {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.quiz-form__input {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.quiz-form__input::placeholder { color: var(--text-muted); }

.quiz-form__input:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.quiz-form__input--error {
  border-color: #EF4444;
}

.quiz-form__note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-top: 4px;
}

.quiz-form__message {
  text-align: center;
  font-size: 13px;
  min-height: 18px;
}

.quiz-form__message--success { color: #34D399; }
.quiz-form__message--error   { color: #F87171; }

/* ===== Success ===== */
.success {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 8, 16, 0.85);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s, visibility 0.5s;
}

.success.is-open {
  opacity: 1;
  visibility: visible;
}

.success__card {
  text-align: center;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  transform: scale(0.9);
  transition: transform 0.5s var(--ease-spring);
}

.success.is-open .success__card {
  transform: scale(1);
}

.success__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--border-active);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.success__card h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 12px;
}

.success__card p {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ===== Thank you page ===== */
.thank-main {
  display: flex;
  align-items: center;
}

.thank-main__inner {
  width: 100%;
}

.thank-card {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 40px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 28px;
}

.thank-card .legal-eyebrow {
  justify-content: center;
}

.thank-card .legal-title {
  margin-bottom: 16px;
}

.thank-card .legal-intro {
  margin-bottom: 32px;
}

.thank-card .btn {
  margin: 0 auto;
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px clamp(24px, 5vw, 64px);
  background: var(--bg);
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer__legal p,
.footer__contacts p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer__contacts a {
  color: var(--text-soft);
  transition: color 0.3s;
}

.footer__contacts a:hover { color: var(--text); }

.quiz-form__note a {
  color: var(--text-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.quiz-form__note a:hover { color: var(--text); }

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer__links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.3s;
}

.footer__links a:hover { color: var(--text-soft); }

.footer__copy {
  font-size: 12px;
  color: var(--text-muted);
  width: 100%;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero__header { padding: 24px; }
  .hero__content { padding-bottom: 80px; }
  .hero__badge { display: none; }
  .hero__scroll { display: none; }
  .hero__perks { grid-template-columns: 1fr; gap: 12px; }
  .hero__content { gap: 28px; }

  /* Full-bleed car background on mobile */
  .hero__decor {
    inset: 0;
    width: 100%;
    height: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    opacity: 1;
  }

  .hero__decor-image {
    opacity: 0.52;
    object-position: center 55%;
  }

  .hero__decor-fade {
    background:
      linear-gradient(to bottom, rgba(4, 8, 16, 0.88) 0%, rgba(4, 8, 16, 0.72) 30%, rgba(4, 8, 16, 0.4) 55%, rgba(4, 8, 16, 0.65) 100%);
  }

  .hero__bg-overlay {
    background: linear-gradient(to bottom, rgba(4, 8, 16, 0.25) 0%, transparent 40%, rgba(4, 8, 16, 0.35) 100%);
  }

  .quiz__body { padding: 28px 20px 32px; }
  .quiz__top { padding: 20px; }
  .footer__inner { flex-direction: column; text-align: center; }
  .footer__links { justify-content: center; }
}

/* ===== Legal / Privacy page ===== */
.legal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 24px clamp(24px, 5vw, 64px);
  border-bottom: 1px solid var(--border);
  background: rgba(4, 8, 16, 0.88);
  backdrop-filter: blur(16px);
}

.legal-header__inner {
  max-width: 820px;
  margin: 0 auto;
}

.legal-main {
  flex: 1;
  padding: 48px clamp(24px, 5vw, 64px) 72px;
}

.legal-main__inner {
  max-width: 820px;
  margin: 0 auto;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  font-size: 13px;
}

.breadcrumbs a {
  color: var(--text-muted);
  transition: color 0.3s;
}

.breadcrumbs a:hover { color: var(--accent); }

.breadcrumbs__sep {
  color: var(--text-muted);
  opacity: 0.5;
  user-select: none;
}

.breadcrumbs__current {
  color: var(--text-soft);
}

.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.legal-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.legal-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 20px;
}

.legal-intro {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 32px;
}

.legal-requisites {
  padding: 24px 28px;
  margin-bottom: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
}

.legal-requisites__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 16px;
}

.legal-requisites p {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.75;
}

.legal-requisites p + p { margin-top: 8px; }

.legal-requisites a {
  color: var(--text);
  transition: color 0.3s;
}

.legal-requisites a:hover { color: var(--accent); }

.legal-content h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 40px 0 16px;
  padding-top: 8px;
}

.legal-content h2:first-child { margin-top: 0; }

.legal-content p {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 12px;
}

.legal-content ul {
  margin: 0 0 16px 1.2em;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.8;
}

.legal-content li + li { margin-top: 6px; }

.legal-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-table {
  margin: 20px 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.legal-table__row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.legal-table__row:last-child { border-bottom: none; }

.legal-table__row span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.legal-table__row p,
.legal-table__row ul {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
  margin: 0;
}

.legal-table__row ul {
  list-style: disc;
  padding-left: 1.1em;
}

.legal-updated {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .legal-table__row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
