/* ============================================================
   PSIQUE QUIZZES · DESIGN SYSTEM
   Mobile-first · accesible · cinematográfico
   ============================================================ */

:root {
  /* Brand palette base (overridable per quiz with --accent) */
  --navy: #1A3A6B;
  --navy-deep: #0D2350;
  --purp: #7B2FBE;
  --purp-light: #A368E0;
  --teal: #2878A8;
  --gold: #E8B84B;
  --bg: #F7F8FC;
  --bg-card: #FFFFFF;
  --text: #1A2332;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --accent: var(--purp);
  --accent-soft: rgba(123, 47, 190, 0.08);
  --shadow-sm: 0 2px 8px rgba(13, 35, 80, 0.06);
  --shadow-md: 0 8px 28px rgba(13, 35, 80, 0.10);
  --shadow-lg: 0 20px 50px rgba(13, 35, 80, 0.14);
  --radius: 16px;
  --radius-lg: 24px;
  --transition: 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 80% -10%, var(--accent-soft), transparent 60%),
                    radial-gradient(1000px 500px at -10% 100%, rgba(40, 120, 168, 0.06), transparent 60%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

/* ============= TYPOGRAPHY ============= */
.display-h1 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin-bottom: 12px;
}
.lead {
  font-size: clamp(15px, 4vw, 18px);
  color: var(--text-muted);
  line-height: 1.55;
}
.brand-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

/* ============= SCREENS ============= */
.screen {
  display: none;
  min-height: 100vh;
  padding: 24px 20px 110px;
  animation: fadeIn 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
#screen-questions { padding-bottom: 130px; }
.screen.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.container { max-width: 920px; margin: 0 auto; }

/* ============= INTRO ============= */
.intro-container { padding-top: 12px; }
.intro-hero {
  width: 100%;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(40, 120, 168, 0.10) 100%);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-img { width: 80%; max-width: 360px; object-fit: contain; }

.intro-content { text-align: left; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 24px 0;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.meta-icon { font-size: 18px; }

.disclaimer-box {
  background: #FEF7E6;
  border-left: 4px solid var(--gold);
  padding: 14px 16px;
  border-radius: 10px;
  margin: 20px 0;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.55;
}
.disclaimer-box strong { color: #8B6914; }

.emotional-disclaimer-box {
  background: linear-gradient(135deg, rgba(255,200,170,0.18), rgba(163,104,224,0.10));
  border: 1px solid rgba(217, 119, 87, 0.25);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 16px 0 20px;
  display: flex;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #1A2332;
  align-items: flex-start;
}
.emotional-disclaimer-box .ed-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1.2;
  margin-top: 1px;
}

.attribution {
  font-size: 12.5px;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.5;
}

.intro-promise {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

/* ============= BUTTONS ============= */
.btn-primary, .btn-secondary {
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px rgba(123, 47, 190, 0.32);
}
.btn-primary:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(123, 47, 190, 0.40); }
.btn-primary:not(:disabled):active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-secondary:not(:disabled):hover { background: var(--bg); color: var(--text); }
.btn-secondary:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-large { padding: 16px 28px; font-size: 16px; width: 100%; }
.btn-full { width: 100%; }

/* ============= QUIZ QUESTIONS ============= */
.progress-wrapper {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247, 248, 252, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 20px 14px;
  margin: -24px -20px 24px;
  border-bottom: 1px solid var(--border);
}
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purp-light));
  border-radius: 100px;
  width: 0%;
  transition: width 480ms cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 8px;
  text-align: center;
  letter-spacing: 0.3px;
}

.question-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.question-image-wrapper {
  background: linear-gradient(135deg, rgba(123, 47, 190, 0.06) 0%, rgba(40, 120, 168, 0.06) 100%);
  border-radius: var(--radius-lg);
  aspect-ratio: 16/10;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.q-img { width: 70%; max-width: 280px; object-fit: contain; }

.question-content { padding: 8px 4px; }
.q-number {
  display: inline-block;
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 2px;
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.q-text {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy);
  margin-bottom: 20px;
}

.q-options { display: flex; flex-direction: column; gap: 10px; }
.q-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  text-align: left;
  font-family: inherit;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.q-option > span:last-child { flex: 1; }
.q-option:hover { border-color: var(--border-strong); background: #fff; }
.q-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  transform: scale(1.01);
  box-shadow: var(--shadow-sm);
}
.q-option-radio {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--transition);
}
.q-option.selected .q-option-radio {
  border-color: var(--accent);
}
.q-option.selected .q-option-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
  animation: pop 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.nav-bottom {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  gap: 10px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: rgba(247, 248, 252, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 20;
}
.nav-bottom .btn-secondary { flex: 0 0 110px; padding: 14px 16px; }
.nav-bottom .btn-primary { flex: 1; }

/* ============= EMAIL CAPTURE ============= */
.capture-container { padding-top: 24px; }
.capture-celebrate { text-align: center; margin-bottom: 28px; }
.celebrate-icon {
  font-size: 56px;
  margin-bottom: 8px;
  animation: bounce 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.capture-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
}
.card-h {
  font-family: 'Crimson Pro', serif;
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 6px;
}
.card-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }

.benefits-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0 24px;
  padding: 18px;
  background: var(--bg);
  border-radius: 14px;
}
.benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.benefit-icon { font-size: 18px; flex-shrink: 0; line-height: 1.4; }

.capture-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.field input {
  font-family: inherit;
  font-size: 15px;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--transition);
  -webkit-appearance: none;
}
.field input:focus { outline: none; border-color: var(--accent); }

.capture-fineprint {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ============= RESULT ============= */
.result-container { padding-top: 12px; }
.result-hero {
  width: 100%;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(40, 120, 168, 0.10) 100%);
  aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  animation: revealFromBlur 1100ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes revealFromBlur {
  from { filter: blur(20px); opacity: 0; transform: scale(1.04); }
  to   { filter: blur(0); opacity: 1; transform: scale(1); }
}
.result-img { width: 80%; max-width: 360px; object-fit: contain; }
.result-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.result-cta-box {
  background: linear-gradient(135deg, var(--accent-soft), rgba(40, 120, 168, 0.08));
  border-left: 4px solid var(--accent);
  padding: 18px 20px;
  border-radius: 14px;
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.55;
}

.result-next, .result-community {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.result-next h3, .result-community h3 {
  font-family: 'Crimson Pro', serif;
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 12px;
}
.next-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}
.next-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}
.next-card:hover { border-color: var(--accent); transform: translateX(2px); box-shadow: var(--shadow-sm); }
.next-card-icon { font-size: 28px; }
.next-card-text strong { display: block; color: var(--navy); margin-bottom: 2px; }
.next-card-text span { font-size: 13px; color: var(--text-muted); }

/* ============= MUTE TOGGLE ============= */
#mute-toggle {
  position: fixed; top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
#mute-toggle:hover { color: var(--text); border-color: var(--border-strong); }

/* ============= FOOTER ============= */
.quiz-footer {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.5;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.quiz-footer p { margin-bottom: 6px; }
.footer-disclaimer { max-width: 600px; margin: 0 auto; font-style: italic; }

/* ============= TABLET / DESKTOP ============= */
@media (min-width: 720px) {
  .screen { padding: 40px 32px 100px; }
  .meta-grid { grid-template-columns: repeat(4, 1fr); }
  .question-container { grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
  .question-image-wrapper { aspect-ratio: 4/5; }
  .nav-bottom { padding: 18px 32px calc(18px + env(safe-area-inset-bottom)); }
  .nav-bottom .btn-primary, .nav-bottom .btn-secondary { max-width: 240px; margin: 0 auto; }
  .next-cards { grid-template-columns: 1fr 1fr; }
  .capture-card { padding: 36px; }
  .benefits-list { padding: 24px; }
}

@media (min-width: 1024px) {
  .display-h1 { font-size: 48px; }
  .intro-hero, .result-hero { aspect-ratio: 21/9; }
}

/* ============= REDUCED MOTION ============= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
