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

:root {
  --teal:   #9B6232;
  --teal-l: #B8783C;
  --teal-d: #7A4A22;
  --blue:   #1A6BC8;
  --blue-l: #4A93E0;
  --hero:   #0B1D3A;
  --dark:   #080808;
  --dark-2: #0C1421;
  --dark-3: #111927;
  --text:   #E2EAF6;
  --text-2: #7A8FAD;
  --font:   'Poppins', sans-serif;
  --ease:   cubic-bezier(0.16, 1, 0.3, 1);
}

html { height: 100%; }

body {
  font-family: var(--font);
  background: var(--hero);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ─── BACKGROUND ──────────────────────────────── */
.q-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.q-blob {
  position: absolute; border-radius: 60% 40% 55% 45% / 50% 55% 45% 50%;
  animation: morph 16s ease-in-out infinite;
}
.q-blob-1 {
  width: 70vw; aspect-ratio: 1; left: -28%; top: -30%;
  background: rgba(26,107,200,.12);
}
.q-blob-2 {
  width: 60vw; aspect-ratio: 1; right: -22%; bottom: -28%;
  background: rgba(26,107,200,.08);
  border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
  animation-duration: 20s; animation-direction: reverse;
}
.q-grain {
  position: absolute; inset: 0; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 200px;
}
@keyframes morph {
  0%,100% { border-radius:60% 40% 55% 45%/50% 55% 45% 50%; transform:translate(0,0) scale(1); }
  33%      { border-radius:50% 50% 65% 35%/45% 60% 40% 55%; transform:translate(1.5%,2%) scale(1.02); }
  66%      { border-radius:70% 30% 50% 50%/60% 40% 60% 40%; transform:translate(-1%,.5%) scale(.99); }
}

/* ─── LAYOUT ──────────────────────────────────── */
.q-shell {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; flex-direction: column;
}

/* Header */
.q-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px;
}
.q-logo img { height: 42px; filter: brightness(0) invert(1); opacity: .85; }
.q-logo:hover img { opacity: 1; }
.q-back {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-family: var(--font); font-size: .82rem; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: color .2s; padding: 6px 0;
}
.q-back:hover { color: rgba(255,255,255,.85); }
.q-back svg { width: 16px; height: 16px; }

/* Progress */
.q-progress-wrap {
  padding: 0 32px 24px;
}
.q-progress-bar-bg {
  height: 3px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden;
}
.q-progress-bar-fill {
  height: 100%; background: var(--teal);
  border-radius: 99px; transition: width .5s var(--ease);
}
.q-progress-meta {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: .7rem; color: rgba(255,255,255,.35); letter-spacing: .04em;
}

/* Stage */
.q-stage {
  flex: 1;
  display: grid;
  grid-template-areas: 'slide';
  place-items: center;
  padding: 16px 24px 40px;
  overflow: hidden;
}

/* Slide — animations handled via Web Animations API in quiz.js */
.q-slide {
  grid-area: slide;
  width: 100%; max-width: 680px;
  opacity: 0; /* JS animate() sets the initial state */
}

/* Welcome screen */
.q-welcome-eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--teal-l);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.q-welcome-eyebrow span { display: block; width: 28px; height: 1.5px; background: currentColor; border-radius: 2px; }

.q-welcome-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900; line-height: 1.05; letter-spacing: -.025em;
  color: #fff; margin-bottom: 20px;
}
.q-welcome-title em { font-weight: 300; font-style: italic; color: var(--blue-l); }

.q-welcome-desc {
  font-size: 1rem; line-height: 1.78;
  color: rgba(255,255,255,.6); max-width: 520px; margin-bottom: 36px;
}

.q-welcome-meta {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  margin-bottom: 40px;
}
.q-welcome-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; color: rgba(255,255,255,.45);
}
.q-welcome-badge svg { width: 16px; height: 16px; color: var(--teal-l); flex-shrink: 0; }

/* Question slide */
.q-question-num {
  font-size: .7rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal-l); margin-bottom: 14px;
}
.q-question-text {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800; line-height: 1.2; letter-spacing: -.02em;
  color: #fff; margin-bottom: 8px;
}
.q-question-hint {
  font-size: .82rem; color: rgba(255,255,255,.4); margin-bottom: 32px;
}

/* Options */
.q-options { display: flex; flex-direction: column; gap: 10px; }
.q-option {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1.5px solid rgba(255,255,255,.08);
  cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--ease);
  text-align: left; width: 100%; font-family: var(--font);
}
.q-option:hover {
  background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16);
  transform: translateX(4px);
}
.q-option.selected {
  background: rgba(155,98,50,.12); border-color: var(--teal);
  transform: translateX(4px);
}
.q-option-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: border-color .2s, background .2s;
}
.q-option.selected .q-option-check {
  border-color: var(--teal); background: var(--teal);
}
.q-option-check svg { width: 12px; height: 12px; display: none; }
.q-option.selected .q-option-check svg { display: block; color: #fff; }

/* Multi checkbox */
.q-option-cb {
  width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,.2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s;
}
.q-option.selected .q-option-cb {
  border-color: var(--teal); background: var(--teal);
}
.q-option-cb svg { width: 12px; height: 12px; display: none; color: #fff; }
.q-option.selected .q-option-cb svg { display: block; }

.q-option-label { font-size: .95rem; font-weight: 500; color: rgba(255,255,255,.82); line-height: 1.4; }
.q-option.selected .q-option-label { color: #fff; }

/* Lecture picker (two-line option: title + meta) */
.q-option-label strong { display: block; font-weight: 600; color: #fff; margin-bottom: 3px; }
.q-option-label small { display: block; font-size: .8rem; font-weight: 400; color: rgba(255,255,255,.45); }

/* Next button */
.q-next {
  margin-top: 28px; width: 100%;
  background: var(--teal); color: #fff;
  padding: 15px 32px; border-radius: 10px; border: none;
  font-family: var(--font); font-size: .98rem; font-weight: 700; letter-spacing: .01em;
  cursor: pointer; transition: background .2s, transform .25s var(--ease), box-shadow .25s, opacity .2s;
  box-shadow: 0 4px 24px rgba(155,98,50,.35);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.q-next:hover:not(:disabled) { background: var(--teal-d); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(155,98,50,.45); }
.q-next:disabled { opacity: .35; cursor: not-allowed; transform: none !important; }

/* ─── LEAD FORM ───────────────────────────────── */
.q-lead-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800; line-height: 1.1; letter-spacing: -.02em;
  color: #fff; margin-bottom: 10px;
}
.q-lead-sub {
  font-size: .95rem; color: rgba(255,255,255,.5); margin-bottom: 32px; line-height: 1.65;
}

.q-form { display: flex; flex-direction: column; gap: 14px; }

.q-field { display: flex; flex-direction: column; gap: 6px; }
.q-field label { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.q-field input {
  background: rgba(255,255,255,.05); border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 14px 16px;
  font-family: var(--font); font-size: .98rem; color: #fff;
  transition: border-color .2s, background .2s;
  outline: none;
}
.q-field input::placeholder { color: rgba(255,255,255,.25); }
.q-field input:focus { border-color: var(--teal); background: rgba(155,98,50,.06); }
.q-field.error input { border-color: #e05050; }
.q-field-error { font-size: .76rem; color: #e07070; display: none; }
.q-field.error .q-field-error { display: block; }

/* Honeypot — visually hidden, but not display:none so screenreaders ignore it */
.q-hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; tab-index: -1; }

.q-submit {
  margin-top: 8px; width: 100%;
  background: var(--teal); color: #fff;
  padding: 16px 32px; border-radius: 10px; border: none;
  font-family: var(--font); font-size: 1rem; font-weight: 700; letter-spacing: .01em;
  cursor: pointer; transition: background .2s, transform .25s var(--ease), box-shadow .25s, opacity .2s;
  box-shadow: 0 4px 28px rgba(155,98,50,.4);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.q-submit:hover:not(:disabled) { background: var(--teal-d); transform: translateY(-2px); box-shadow: 0 10px 36px rgba(155,98,50,.5); }
.q-submit:disabled { opacity: .5; cursor: not-allowed; }

/* Opt-in */
.q-optin {
  margin-top: 4px;
}
.q-optin-label {
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer;
}
.q-optin-label input[type="checkbox"] { display: none; }
.q-optin-box {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0; margin-top: 1px;
  border: 1.5px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.04);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s;
}
.q-optin-box svg { display: none; width: 11px; height: 11px; color: #fff; }
.q-optin-label input:checked ~ .q-optin-box {
  border-color: var(--teal); background: var(--teal);
}
.q-optin-label input:checked ~ .q-optin-box svg { display: block; }
.q-optin-text {
  font-size: .82rem; color: rgba(255,255,255,.45); line-height: 1.55;
}
.q-optin-text strong { color: rgba(255,255,255,.7); font-weight: 500; }

.q-privacy { font-size: .74rem; color: rgba(255,255,255,.3); margin-top: 10px; text-align: center; line-height: 1.6; }

/* ─── THANK YOU ───────────────────────────────── */
.q-thanks { text-align: center; max-width: 560px; margin: 0 auto; }
.q-thanks-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(155,98,50,.12); border: 1.5px solid rgba(155,98,50,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 28px;
}
.q-thanks-title { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 900; letter-spacing: -.02em; color: #fff; margin-bottom: 14px; }
.q-thanks-sub { font-size: 1rem; color: rgba(255,255,255,.55); line-height: 1.75; margin-bottom: 36px; }
.q-thanks-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .88rem; color: rgba(255,255,255,.4);
  border-bottom: 1px solid rgba(255,255,255,.15); padding-bottom: 1px;
  transition: color .2s, border-color .2s;
}
.q-thanks-back:hover { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.3); }

.q-thanks-lecture {
  background: rgba(255,255,255,.04); border: 1.5px solid rgba(155,98,50,.3);
  border-radius: 14px; padding: 22px 24px; margin-bottom: 32px; text-align: left;
}
.q-thanks-lecture-label { font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 6px; }
.q-thanks-lecture-meta { font-size: .88rem; color: rgba(255,255,255,.55); margin-bottom: 4px; }
.q-thanks-lecture-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  font-size: .88rem; font-weight: 700; color: var(--teal-l);
  border-bottom: 1.5px solid var(--teal); padding-bottom: 2px;
  transition: color .2s;
}
.q-thanks-lecture-link:hover { color: #fff; }

/* ─── ERROR TOAST ─────────────────────────────── */
.q-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: #1e0e0e; border: 1px solid rgba(220,80,80,.3);
  color: #e07070; padding: 14px 24px; border-radius: 10px;
  font-size: .88rem; font-weight: 500; z-index: 500;
  transition: transform .4s var(--ease), opacity .4s;
  opacity: 0; pointer-events: none; white-space: nowrap;
}
.q-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ─── RESPONSIVE ──────────────────────────────── */
@media (max-width: 640px) {
  .q-header { padding: 16px 20px; }
  .q-progress-wrap { padding: 0 20px 20px; }
  .q-stage { padding: 12px 20px 32px; align-items: flex-start; }
  .q-option { padding: 14px 16px; }
}
