/* --- Variables --- */
:root {
  --bg-dark: #0f1114;
  --bg-card: #1a1d23;
  --bg-panel: #e8eaed;
  --text: #f0f2f5;
  --text-muted: #9ca3af;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --disclaimer-bg: #fef08a;
  --disclaimer-text: #1a1a1a;
  --ad-badge-bg: #f97316;
  --ad-badge-text: #fff;
  --radius: 16px;
  --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.12), transparent),
              radial-gradient(ellipse 60% 40% at 100% 50%, rgba(59, 130, 246, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

.main, .page, .header, .footer, .disclaimer-banner, .ad-badge {
  position: relative;
  z-index: 1;
}

/* --- Ad badge (placa publicidad) --- */
.ad-badge {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--ad-badge-bg);
  color: var(--ad-badge-text);
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
  animation: badge-pulse 2s ease-in-out infinite;
}

.ad-badge-text {
  display: inline-block;
  animation: badge-shake 3s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(1.02); opacity: 0.95; }
}

@keyframes badge-shake {
  0%, 90%, 100% { transform: translateX(0); }
  92% { transform: translateX(-2px); }
  96% { transform: translateX(2px); }
}

/* --- Disclaimer banner --- */
.disclaimer-banner {
  background: var(--disclaimer-bg);
  color: var(--disclaimer-text);
  padding: 12px 20px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
  animation: disclaimer-fade 1s ease-out;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.disclaimer-text {
  max-width: 900px;
  margin: 0 auto;
}

.disclaimer-text strong {
  color: #b45309;
}

@keyframes disclaimer-fade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background-image: linear-gradient(135deg, var(--accent) 0%, #60a5fa 100%);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent);
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: var(--font);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.12);
}

.btn-primary {
  background: #fff;
  color: var(--bg-dark);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(255,255,255,0.25);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* --- Screens --- */
.screen {
  display: none;
  min-height: 60vh;
  padding: 32px 24px 48px;
}

.screen.active {
  display: block;
  animation: screen-in 0.4s ease-out;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Intro --- */
.screen-intro .intro-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.intro-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  max-width: 520px;
}

.animate-in {
  animation: title-in 0.8s ease-out forwards;
}

.animate-in-delay {
  animation: title-in 0.8s ease-out 0.15s both;
}

.animate-in-delay-2 {
  animation: title-in 0.8s ease-out 0.3s both;
}

@keyframes title-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-cta {
  padding: 16px 28px;
  font-size: 1.1rem;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.btn-cta .btn-arrow {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f1114'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 7l5 5m0 0l-5 5m5-5H6'/%3E%3C/svg%3E") center/contain no-repeat;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.btn-cta:hover .btn-arrow {
  animation: arrow-bounce 0.6s ease infinite;
}

@keyframes arrow-bounce {
  0%, 100% { transform: translateX(4px); }
  50% { transform: translateX(8px); }
}

.intro-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 440px;
  margin-bottom: 32px;
}

.intro-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Intro right: cards --- */
.intro-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-panel {
  background: var(--bg-panel);
  color: #1a1d23;
  border-radius: var(--radius);
  padding: 24px;
  animation: card-float 4s ease-in-out infinite;
}

.card-panel-2 {
  animation-delay: 0.5s;
}

@keyframes card-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.card-header {
  margin-bottom: 16px;
}

.card-label {
  font-size: 0.8rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 4px 0 2px;
}

.card-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
}

.card-visual {
  min-height: 60px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-bars {
  width: 80px;
  height: 40px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 30%, #cbd5e1 30%, #cbd5e1 50%, var(--accent) 50%, var(--accent) 75%, #cbd5e1 75%);
  border-radius: 8px;
  animation: bars-grow 1.5s ease-out;
}

@keyframes bars-grow {
  from { transform: scaleX(0); transform-origin: left; }
  to { transform: scaleX(1); transform-origin: left; }
}

.mini-dots {
  width: 48px;
  height: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.mini-dots::before,
.mini-dots::after {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  animation: dot-blink 1.2s ease-in-out infinite;
}

.mini-dots::after { animation-delay: 0.4s; }

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: #6b7280;
}

.mini-gauge {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.tag::after {
  content: '';
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b82f6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* --- Quiz --- */
.screen-quiz .quiz-inner {
  max-width: 560px;
  margin: 0 auto;
}

.quiz-progress-wrap {
  max-width: 560px;
  margin: 0 auto 24px;
}

.quiz-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
}

.quiz-progress-text {
  display: block;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quiz-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid rgba(255,255,255,0.06);
  animation: quiz-card-in 0.5s ease-out;
}

@keyframes quiz-card-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.quiz-question {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.4;
  animation: question-in 0.4s ease-out;
}

@keyframes question-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  animation: option-in 0.35s ease-out backwards;
}

.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; }

@keyframes option-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.quiz-option:hover {
  background: rgba(255,255,255,0.08);
  transform: translateX(4px);
}

.quiz-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.15);
}

.quiz-option input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.option-text {
  flex: 1;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* --- Stats screen --- */
.screen-stats {
  max-width: 800px;
  margin: 0 auto;
}

.stats-title {
  font-size: 1.75rem;
  margin-bottom: 8px;
  text-align: center;
}

.stats-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  opacity: 0;
}

.stat-box.animate-stat {
  animation: stat-in 0.6s ease-out forwards;
}

.stat-box:nth-child(1) { animation-delay: 0.1s; }
.stat-box:nth-child(2) { animation-delay: 0.25s; }
.stat-box:nth-child(3) { animation-delay: 0.4s; }

@keyframes stat-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-continue-quiz {
  display: block;
  margin: 0 auto;
}

.btn-continue-quiz .btn-arrow {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f1114'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 7l5 5m0 0l-5 5m5-5H6'/%3E%3C/svg%3E") center/contain no-repeat;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.btn-continue-quiz:hover .btn-arrow {
  transform: translateX(4px);
}

/* --- Result --- */
.screen-result .result-content {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  animation: result-content-in 0.5s ease-out 0.2s both;
}

.result-title {
  font-size: 1.5rem;
  margin-bottom: 16px;
  animation: title-in 0.6s ease-out;
}

@keyframes result-content-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.result-text {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-result-cta {
  margin-bottom: 12px;
}

.btn-result-cta .btn-arrow-dark {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  vertical-align: middle;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f1114'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 7l5 5m0 0l-5 5m5-5H6'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform 0.3s ease;
}

.btn-result-cta:hover .btn-arrow-dark {
  transform: translateX(4px);
}

.btn-result-secondary {
  display: inline-block;
  margin-top: 8px;
}

/* --- Footer --- */
.footer {
  padding: 32px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Policy pages --- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.page h1 {
  font-size: 1.75rem;
  margin-bottom: 24px;
}

.page h2 {
  font-size: 1.2rem;
  margin: 24px 0 12px;
  color: var(--accent);
}

.page p, .page li {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

.page ul {
  margin-left: 20px;
  margin-bottom: 16px;
}

.page a {
  color: var(--accent);
  text-decoration: none;
}

.page a:hover {
  text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .screen-intro .intro-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .intro-title {
    margin-left: auto;
    margin-right: auto;
  }

  .intro-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .btn-cta {
    margin-left: auto;
    margin-right: auto;
  }

  .ad-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
  }
}
