/* ============================================================
   AETERNA — Diagnóstico de Madurez en IA
   Design tokens
   ============================================================ */

:root {
  /* Color */
  --bg:            #161D22;
  --bg-section:    #1C242B;
  --bg-card:       #232C34;
  --bg-elevated:   #2B3640;
  --navy:          #5C86AC;
  --navy-deep:     #2D3F54;
  --cyan:          #8FEEF0;
  --cyan-strong:   #6FE0E3;
  --cyan-soft:     rgba(143, 238, 240, 0.10);
  --cyan-border:   rgba(143, 238, 240, 0.28);
  --silver:        #C7CED4;
  --text:          #EDF2F5;
  --text-muted:    #92A1AC;
  --text-faint:    #5E6B76;
  --border:        rgba(255, 255, 255, 0.07);
  --danger:        #E8989A;

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Layout */
  --container: 1180px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 26px;
  --gap: clamp(1.25rem, 2.5vw, 2.5rem);

  /* Effects */
  --glow: 0 0 60px rgba(143, 238, 240, 0.10);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   Reset & base
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

section { padding: clamp(4rem, 9vw, 7rem) 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--cyan);
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.option-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan-strong), var(--navy));
  color: #102127;
  box-shadow: 0 8px 30px rgba(143, 238, 240, 0.18);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(143, 238, 240, 0.28);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

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

.btn-block { width: 100%; }

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

/* ============================================================
   Navigation
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(22, 29, 34, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.nav-links a:hover { color: var(--cyan); }

.nav-cta { display: flex; }

@media (max-width: 760px) {
  .nav-links { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  padding-top: clamp(3.5rem, 8vw, 6rem);
  position: relative;
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--gap);
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.4rem, 5.2vw, 3.9rem);
  margin: 1.1rem 0 1.4rem;
}

.hero-content h1 span {
  background: linear-gradient(120deg, var(--cyan), var(--navy) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 540px;
  margin-bottom: 2.1rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.hero-note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* Circuit visual */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual svg { width: 100%; max-width: 480px; height: auto; }

.circuit-line {
  fill: none;
  stroke: var(--navy);
  stroke-width: 1.5;
  stroke-opacity: 0.45;
}

.circuit-line.live {
  stroke: var(--cyan);
  stroke-opacity: 0.9;
  stroke-dasharray: 6 10;
  animation: dashflow 6s linear infinite;
}

.circuit-node {
  fill: var(--bg-elevated);
  stroke: var(--navy);
  stroke-width: 1.5;
}

.circuit-node.glow {
  fill: var(--cyan);
  stroke: none;
  filter: drop-shadow(0 0 8px rgba(143,238,240,0.9));
  animation: pulse 3.2s ease-in-out infinite;
}

.circuit-node.glow.d1 { animation-delay: 0.4s; }
.circuit-node.glow.d2 { animation-delay: 1.1s; }
.circuit-node.glow.d3 { animation-delay: 1.8s; }

@keyframes dashflow {
  to { stroke-dashoffset: -160; }
}

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

/* ============================================================
   Why section (3 reason cards)
   ============================================================ */

.why { background: var(--bg-section); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head {
  max-width: 640px;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-top: 0.9rem; }
.section-head p { color: var(--text-muted); margin-top: 1rem; font-size: 1.05rem; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--cyan-border);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
}

.stat-card .number {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  color: var(--cyan);
  display: block;
  margin-bottom: 0.5rem;
}

.stat-card p { color: var(--text-muted); font-size: 0.93rem; margin: 0; }

.stat-card .source {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-top: 0.8rem;
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.reason-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.reason-card:hover {
  border-color: var(--cyan-border);
  transform: translateY(-4px);
}

.reason-card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--cyan-soft);
  border: 1px solid var(--cyan-border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.4rem;
  color: var(--cyan);
}

.reason-card h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.reason-card p { color: var(--text-muted); font-size: 0.97rem; }

@media (max-width: 880px) {
  .reason-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 340px; margin: 0 auto 1rem; }
}

/* ============================================================
   How it works (numbered steps — real sequence)
   ============================================================ */

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  position: relative;
}

.step-card {
  position: relative;
  padding-top: 1rem;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 1rem;
}

.step-card h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.step-card p { color: var(--text-muted); font-size: 0.97rem; }

.how-grid::before {
  content: '';
  position: absolute;
  top: 0.55rem;
  left: 6%;
  right: 6%;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan-border), transparent 33%, transparent 66%, var(--cyan-border));
  opacity: 0.5;
}

@media (max-width: 880px) {
  .how-grid { grid-template-columns: 1fr; }
  .how-grid::before { display: none; }
}

/* ============================================================
   Assessment widget
   ============================================================ */

.assessment { background: var(--bg-section); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.assessment-shell {
  max-width: 760px;
  margin: 0 auto;
}

.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 5vw, 3rem);
  position: relative;
  box-shadow: var(--glow);
}

/* Intro */
.quiz-intro { text-align: center; }
.quiz-intro h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 1rem 0 0.9rem; }
.quiz-intro p { color: var(--text-muted); max-width: 480px; margin: 0 auto 2rem; }
.quiz-meta {
  display: flex; justify-content: center; gap: 2.2rem; margin-top: 2.2rem;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-faint);
}
.quiz-meta strong { color: var(--cyan); display: block; font-size: 1.3rem; font-family: var(--font-display); }

/* Progress trace */
.progress-trace {
  display: flex;
  align-items: center;
  margin-bottom: 2.4rem;
}

.progress-trace .seg {
  flex: 1;
  height: 2px;
  background: var(--border);
  position: relative;
}

.progress-trace .seg.done { background: var(--cyan); }

.progress-trace .node {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  flex: 0 0 auto;
  transition: all 0.3s var(--ease);
}

.progress-trace .node.done {
  background: var(--cyan);
  border-color: var(--cyan);
}

.progress-trace .node.current {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px var(--cyan-soft);
}

.progress-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}

/* Question */
.question-title {
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  margin-bottom: 1.6rem;
  font-family: var(--font-display);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.6rem;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease);
}

.option-card:hover {
  border-color: var(--cyan-border);
  background: var(--bg-card);
}

.option-card.selected {
  border-color: var(--cyan);
  background: var(--cyan-soft);
}

.option-marker {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--text-faint);
  flex: 0 0 auto;
  position: relative;
  transition: border-color 0.2s var(--ease);
}

.option-card.selected .option-marker {
  border-color: var(--cyan);
}

.option-card.selected .option-marker::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--cyan);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

.quiz-back {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0;
}

.quiz-back:hover { color: var(--cyan); }
.quiz-back:disabled { opacity: 0; pointer-events: none; }

/* Lead gate form */
.lead-form .field {
  margin-bottom: 1.1rem;
}

.lead-form label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.lead-form input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s var(--ease);
}

.lead-form input:focus { border-color: var(--cyan); outline: none; }

.lead-form .hint {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 0.4rem;
}

.lead-form .error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 0.4rem;
  display: none;
}

.lead-form .field.invalid input { border-color: var(--danger); }
.lead-form .field.invalid .error { display: block; }

.privacy-note {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin: 1.2rem 0 1.4rem;
  line-height: 1.6;
}

/* Results */
.results h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.4rem; }
.results .level-name {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--cyan);
  margin: 0.3rem 0 1.2rem;
}

.gauge {
  position: relative;
  margin: 2rem 0 2.5rem;
}

.gauge-track {
  display: flex;
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
  background: var(--bg-elevated);
}

.gauge-track span {
  flex: 1;
  border-right: 2px solid var(--bg-card);
}

.gauge-track span:nth-child(1) { background: var(--navy-deep); }
.gauge-track span:nth-child(2) { background: var(--navy); }
.gauge-track span:nth-child(3) { background: #7BC9CC; }
.gauge-track span:nth-child(4) { background: var(--cyan); border-right: none; }

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 0.6rem;
  letter-spacing: 0.05em;
}

.gauge-marker {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  transition: left 1s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--cyan);
}

.gauge-marker svg { width: 22px; height: 22px; filter: drop-shadow(0 0 6px rgba(143,238,240,0.7)); }

.results-body p { color: var(--text-muted); margin-bottom: 1rem; }

.recs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.4rem 0 2rem;
}

.recs li {
  display: flex;
  gap: 0.75rem;
  font-size: 0.97rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.recs li::before {
  content: '→';
  color: var(--cyan);
  flex: 0 0 auto;
}

.results-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.submit-status {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 0.9rem;
  min-height: 1.2em;
}

.submit-status.error { color: var(--danger); }

/* ============================================================
   About
   ============================================================ */

.about .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

.about-visual {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: linear-gradient(160deg, var(--bg-card), var(--bg-elevated));
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.about-visual .stat { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.about-visual .stat:last-child { border-bottom: none; padding-bottom: 0; }
.about-visual .stat span:first-child { color: var(--text-muted); font-size: 0.92rem; }
.about-visual .stat span:last-child { font-family: var(--font-mono); color: var(--cyan); font-size: 0.92rem; }

.about-content h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin: 1rem 0 1.2rem; }
.about-content p { color: var(--text-muted); margin-bottom: 1.1rem; }

@media (max-width: 880px) {
  .about .container { grid-template-columns: 1fr; }
  .about-visual { order: 2; }
}

/* ============================================================
   FAQ
   ============================================================ */

.faq { background: var(--bg-section); border-top: 1px solid var(--border); }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 760px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  transition: border-color 0.2s var(--ease);
}

.faq-item:hover { border-color: var(--cyan-border); }

.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--cyan);
  flex: 0 0 auto;
  transition: transform 0.25s var(--ease);
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item p {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-top: 0.9rem;
  line-height: 1.65;
}

/* ============================================================
   Footer
   ============================================================ */

footer {
  border-top: 1px solid var(--border);
  padding: clamp(3rem, 6vw, 4.5rem) 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--gap);
  margin-bottom: 2.5rem;
}

.footer-brand .brand { margin-bottom: 1rem; }
.footer-brand p { color: var(--text-muted); max-width: 320px; font-size: 0.95rem; }

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.footer-col a, .footer-col p {
  display: block;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.footer-col a:hover { color: var(--cyan); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.6rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ============================================================
   Small phones (≤480px)
   ============================================================ */

@media (max-width: 480px) {
  .nav .container { height: 64px; }
  .brand-name { font-size: 1rem; }
  .brand img { width: 32px; height: 32px; }
  .nav-cta .btn { padding: 0.7rem 1.2rem; font-size: 0.88rem; }

  .hero-actions { gap: 1rem; }
  .hero-actions .btn { width: 100%; }
  .hero-note { width: 100%; }

  .quiz-meta { gap: 1rem; flex-wrap: wrap; }
  .quiz-meta strong { font-size: 1.1rem; }

  .quiz-nav { gap: 0.75rem; }
  .quiz-nav .btn { padding: 0.85rem 1.4rem; font-size: 0.92rem; }

  .gauge-labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 0.4rem;
    font-size: 0.68rem;
  }
  .gauge-labels span:nth-child(odd) { text-align: left; }
  .gauge-labels span:nth-child(even) { text-align: right; }

  .results-actions .btn { width: 100%; }

  .stat-card { padding: 1.3rem 1.4rem; }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
