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

:root {
  --purple: #532377;
  --purple-dark: #3a1855;
  --purple-light: #7b3dab;
  --white: #ffffff;
  --off-white: #f5f0fa;
  --font-title: 'Della Respira', serif;
  --font-body: 'Chivo', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--purple-dark);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ─── Page / Screen System ─────────────────────────────────── */
.screen {
  display: none;
  min-height: 100dvh;
  width: 100%;
  background-size: cover;
  background-position: center top;
  position: relative;
  flex-direction: column;
  align-items: center;
}
.screen.active { display: flex; }

.screen-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 5, 60, 0.52);
  z-index: 0;
}

.screen-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ─── Page Backgrounds ──────────────────────────────────────── */
#page1 { background-image: url('bg-1.png'); background-color: #6a2fa8; }
#page2 { background-image: url('bg-2.png'); background-color: #5a26a0; }
#page3 { background-image: url('bg-3.png'); background-color: #5a26a0; }

/* ─── Animations ────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.82); }
  70%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 6px 28px rgba(0,0,0,0.25); }
  50%       { box-shadow: 0 6px 36px rgba(255,255,255,0.28); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Screen entrance */
.screen.active .screen-content > * { animation: fadeSlideUp 0.45s ease both; }
.screen.active .screen-content > *:nth-child(1) { animation-delay: 0.05s; }
.screen.active .screen-content > *:nth-child(2) { animation-delay: 0.12s; }
.screen.active .screen-content > *:nth-child(3) { animation-delay: 0.18s; }
.screen.active .screen-content > *:nth-child(4) { animation-delay: 0.24s; }
.screen.active .screen-content > *:nth-child(5) { animation-delay: 0.30s; }
.screen.active .screen-content > *:nth-child(6) { animation-delay: 0.36s; }

/* Question block entrance */
.question-block.active { animation: fadeSlideUp 0.35s ease both; }

/* Option button stagger */
.question-block.active .option-btn:nth-child(1) { animation: slideInLeft 0.3s 0.08s ease both; }
.question-block.active .option-btn:nth-child(2) { animation: slideInLeft 0.3s 0.14s ease both; }
.question-block.active .option-btn:nth-child(3) { animation: slideInLeft 0.3s 0.20s ease both; }
.question-block.active .option-btn:nth-child(4) { animation: slideInLeft 0.3s 0.26s ease both; }

/* Result card */
#page3.active .result-card  { animation: popIn 0.5s 0.3s ease both; }
#page3.active .result-title { animation: fadeSlideUp 0.4s 0.15s ease both; }
#page3.active .result-badge { animation: fadeIn 0.35s 0.05s ease both; }

/* ─── Logo ──────────────────────────────────────────────────── */
.logo-wrap { margin-bottom: 28px; }
.logo-wrap img {
  width: 140px;
  height: auto;
  border-radius: 24px;
  animation: popIn 0.55s ease both;
}

/* ─── Typography ────────────────────────────────────────────── */
.hero-title {
  font-family: var(--font-title);
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.2;
  text-align: center;
  color: var(--white);
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
  color: rgba(255,255,255,0.88);
  margin-bottom: 36px;
}

/* ─── Form Fields ───────────────────────────────────────────── */
.field-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}
.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 5px;
}
.field-wrap { width: 100%; }

.phone-row {
  position: relative;
  width: 100%;
}
.phone-prefix {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  pointer-events: none;
  z-index: 1;
  padding-right: 10px;
  border-right: 1.5px solid rgba(255,255,255,0.35);
}
.phone-row input[type="tel"] {
  padding-left: 62px;
}

input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  backdrop-filter: blur(6px);
}
input::placeholder { color: rgba(255,255,255,0.45); }
input:focus {
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 17px 24px;
  border-radius: 50px;
  border: none;
  background: var(--white);
  color: var(--purple);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.18s;
  box-shadow: 0 6px 28px rgba(0,0,0,0.25);
  animation: pulseGlow 3s ease-in-out infinite;
}
.btn-primary:hover  { transform: translateY(-3px) scale(1.02); box-shadow: 0 12px 36px rgba(0,0,0,0.38); animation: none; }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; animation: none; }

.btn-back {
  flex: 0 0 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.35);
  color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
}
.btn-back:hover  { background: rgba(255,255,255,0.25); transform: scale(1.08); }
.btn-back:active { transform: scale(0.94); }
.btn-back svg { width: 20px; height: 20px; stroke: white; fill: none; stroke-width: 2.5; }
.btn-next { flex: 1; }

/* ─── Progress Bar ──────────────────────────────────────────── */
.progress-bar-wrap { width: 100%; margin-bottom: 28px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
}
.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--white);
  transition: width 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

/* ─── Quiz Questions ────────────────────────────────────────── */
.question-block { display: none; width: 100%; }
.question-block.active { display: block; }

.q-number {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 10px;
}
.q-text {
  font-family: var(--font-title);
  font-size: clamp(18px, 5.5vw, 24px);
  line-height: 1.3;
  color: var(--white);
  margin-bottom: 24px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1.5px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: background 0.22s, border-color 0.22s,
              transform 0.18s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.22s;
  backdrop-filter: blur(4px);
  width: 100%;
}
.option-btn:hover  { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.6); transform: translateX(5px); }
.option-btn:active { transform: scale(0.98); }
.option-btn.selected {
  background: var(--white);
  color: var(--purple);
  border-color: var(--white);
  transform: translateX(5px);
}

.option-letter {
  min-width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}
.option-btn.selected .option-letter {
  background: var(--purple);
  border-color: var(--purple);
  color: var(--white);
  transform: scale(1.1);
}
.option-text { flex: 1; }

.nav-row { display: flex; gap: 12px; width: 100%; }

/* ─── Results Page ──────────────────────────────────────────── */
.result-badge {
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 50px;
  padding: 8px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #e8d4ff;
  margin-bottom: 18px;
}
.result-title {
  font-family: var(--font-title);
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.15;
  text-align: center;
  color: var(--white);
  margin-bottom: 18px;
}
.result-card {
  width: 100%;
  background: rgba(255,255,255,0.14);
  border: 1.5px solid rgba(255,255,255,0.28);
  border-radius: 22px;
  padding: 22px 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.result-card p {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.92);
}
.result-card strong { color: #e8d4ff; font-weight: 700; }

.divider { width: 100%; height: 1px; background: rgba(255,255,255,0.2); margin: 24px 0; }

.cta-heading {
  font-family: var(--font-title);
  font-size: clamp(18px, 5vw, 22px);
  text-align: center;
  color: var(--white);
  margin-bottom: 8px;
}
.cta-sub {
  font-size: 13px;
  text-align: center;
  color: rgba(255,255,255,0.75);
  margin-bottom: 22px;
  line-height: 1.55;
}
.visit-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  margin-top: 18px;
  text-decoration: none;
  transition: color 0.2s;
}
.visit-link:hover { color: var(--white); }
.visit-link span {
  color: var(--white);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: rgba(30, 5, 60, 0.95);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-family: var(--font-body);
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ─── Spinner ────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(83,35,119,0.35);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (min-width: 480px) {
  .screen-content { padding: 44px 32px 56px; }
}
