/* IA Sin Miedo · sistema visual
   Cálido, claro y amable: para alguien que se siente intimidado por la tecnología.
   Titulares: Bricolage Grotesque · Texto: Atkinson Hyperlegible (diseñada para máxima legibilidad). */
:root {
  --paper: #FBF6EE; --paper-2: #F4EADB; --card: #FFFFFF;
  --ink: #1E2422; --ink-2: #4A524E; --ink-3: #6B716D; --line: #E6DACA;
  --accent: #B83E14; --accent-hover: #9C3310; --accent-soft: #FCE3D6;
  --sun: #FFC94D; --sun-soft: #FFF1C9;
  --mint: #1F6F5C; --mint-soft: #DDEFE8; --danger: #B42318; --danger-soft: #FDE4E1;
  --r-sm: 10px; --r: 16px; --r-lg: 24px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px rgba(60, 40, 20, .08);
  --shadow-lg: 0 2px 4px rgba(60, 40, 20, .06), 0 20px 48px rgba(60, 40, 20, .14);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --f-head: 'Bricolage Grotesque', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --f-body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.55 var(--f-body); overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 6.4vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4.4vw, 2.4rem); }
h3 { font-size: 1.25rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 680px; }
.eyebrow { font: 700 .82rem/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }

/* ---------- Marca ---------- */
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; font: 800 1.15rem/1 var(--f-head); color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand-tag { background: var(--ink); color: var(--sun); padding: 5px 8px 4px; border-radius: 8px; transform: rotate(-4deg); font-size: .95rem; }

/* ---------- Botones ---------- */
.btn { --bg: var(--accent); --fg: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 26px; border: 0; border-radius: 14px; background: var(--bg); color: var(--fg);
  font: 700 1.05rem/1.2 var(--f-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease-out), background .15s, box-shadow .15s; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: not-allowed; transform: none; }
.btn-lg { min-height: 60px; font-size: 1.15rem; padding: 16px 32px; }
.btn-block { width: 100%; }
.btn-ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-ink { --bg: var(--ink); }
.btn-ink:hover { background: #000; }
.btn-sm { min-height: 44px; padding: 10px 16px; font-size: .95rem; border-radius: 12px; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tarjetas y piezas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--paper-2); font-size: .88rem; font-weight: 700; color: var(--ink-2); }
.chip-mint { background: var(--mint-soft); color: var(--mint); }
.chip-sun { background: var(--sun-soft); color: #7A5200; }
.callout { border-left: 5px solid var(--sun); background: var(--sun-soft); padding: 16px 18px; border-radius: 0 var(--r) var(--r) 0; font-weight: 700; }
.list-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.list-check li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.list-check li::before { content: ''; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/16px no-repeat; }

/* ---------- Formularios ---------- */
label.field { display: grid; gap: 6px; font-weight: 700; }
.input { width: 100%; min-height: 54px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font: 1.05rem var(--f-body); color: var(--ink); }
.input:focus { outline: none; border-color: var(--ink); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.error-msg { color: var(--danger); font-size: .92rem; font-weight: 700; min-height: 1.2em; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: .92rem; color: var(--ink-2); align-items: start; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); }

/* ---------- Opciones tipo tarjeta (cuestionario / quiz) ---------- */
.options { display: grid; gap: 12px; }
.option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 14px 18px; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r); font: 700 1.05rem/1.3 var(--f-body); color: var(--ink);
  cursor: pointer; transition: border-color .15s, transform .15s var(--ease-out), background .15s; }
.option:hover { border-color: var(--ink-3); }
.option:active { transform: scale(.99); }
.option[aria-pressed="true"], .option[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.option .ico { flex: 0 0 44px; height: 44px; border-radius: 12px; background: var(--paper-2); display: grid; place-items: center; font-size: 1.4rem; }
.option.correct { border-color: var(--mint); background: var(--mint-soft); }
.option.wrong { border-color: var(--danger); background: var(--danger-soft); }
.option[disabled] { cursor: default; }

/* ---------- Barra de progreso ---------- */
.progress { height: 10px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .4s var(--ease-out); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 99;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .25s var(--ease-out); pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Simulador de chat ---------- */
.chat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 12px; }
.bubble { max-width: 92%; padding: 12px 16px; border-radius: 18px; font-size: 1rem; line-height: 1.5; white-space: pre-wrap; }
.bubble.me { justify-self: end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.bubble.ai { justify-self: start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.ai .who { display: block; font-size: .78rem; font-weight: 700; color: var(--mint); margin-bottom: 4px; letter-spacing: .04em; text-transform: uppercase; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

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

/* ---------- Dato clave (estadística con fuente) ---------- */
.stat { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 26px 24px; display: grid; gap: 10px; box-shadow: var(--shadow-lg); }
.stat .stat-n { font: 800 clamp(2.6rem, 11vw, 4rem)/1 var(--f-head); letter-spacing: -.04em; color: var(--sun); margin: 0; }
.stat .stat-t { font-size: 1.15rem; line-height: 1.45; margin: 0; color: #fff; }
.stat .stat-src { font-size: .85rem; color: #C9CFCB; margin: 0; }
.stat-src a { color: #fff; }
.stats-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .stats-grid { grid-template-columns: 1fr 1fr; } }
