/* styles.css — quiz-v2. Mobile-first, tema oscuro (azul noche, índigo y turquesa). */

:root {
  --bg: #0A0D17;
  --surface: #171B2C;
  --option: #181E32;
  --option-hover: #232A44;
  --selected-bg: #1F223F;
  --ink: #FFFFFF;
  --muted: #9DA3B4;
  --muted-2: #6C7285;
  --line: #273048;
  --track: #1E2638;
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-text: #818CF8;
  --accent-soft: rgba(99, 102, 241, .16);
  --teal: #14B8A6;
  --teal-soft: rgba(20, 184, 166, .12);
  --error: #FF5C5C;
  --img-card: #FAF6F1;   /* fondo claro detrás de las ilustraciones */
  --radius: 18px;
  --maxw: 520px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--accent-text); }

#app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); }

/* Encabezado y progreso */
.top { display: flex; align-items: center; justify-content: space-between; height: 48px; }
.icon-btn { width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.icon-btn:disabled { visibility: hidden; }
.brand { font-family: var(--font-title); font-weight: 600; font-size: 17px; }
.progress { margin: 4px 0 20px; }
.p-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-2); margin-bottom: 6px; }
.p-labels .active { color: var(--accent-text); font-weight: 700; }
.p-tracks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.p-track { height: 6px; background: var(--track); border-radius: 6px; overflow: hidden; }
.p-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-hover), var(--accent-text)); transition: width .35s ease; }

/* Paso */
main { flex: 1; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; animation: entrar .3s ease both; }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step-img { width: 112px; height: 112px; object-fit: contain; margin: 4px auto 16px; border-radius: 28px; background: var(--img-card); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.title { font-family: var(--font-title); font-weight: 600; font-size: 25px; line-height: 1.25; letter-spacing: -.01em; white-space: pre-line; margin-bottom: 8px; }
.title:focus { outline: none; }
.title-sm { font-size: 20px; }
.sub { color: var(--muted); font-size: 15px; margin-bottom: 22px; max-width: 440px; }
.badge { display: inline-block; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 5px 12px; border-radius: 99px; margin-bottom: 12px; }
.micro { background: var(--surface); border-left: 3px solid var(--teal); color: var(--muted); border-radius: 12px; padding: 13px 16px; font-size: 14px; text-align: left; width: 100%; margin-bottom: 18px; }
.note { font-size: 13px; color: var(--muted-2); margin-top: 10px; }
.muted { color: var(--muted); }
.disc { font-size: 12px; color: var(--muted-2); line-height: 1.45; max-width: 420px; margin-top: 12px; }

/* Opciones */
.opts { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; text-align: left; background: var(--option); border: 1.5px solid transparent; border-radius: var(--radius); padding: 16px 18px; font-size: 16px; font-weight: 500; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 0, 0, .15); transition: border-color .15s, background .15s, transform .1s; }
.opt:hover { background: var(--option-hover); }
.opt:active { transform: scale(.99); }
.opt.selected { border-color: var(--accent); background: var(--selected-bg); }
.dot { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--line); position: relative; }
.opt-multi .dot { border-radius: 6px; }
.opt.selected .dot { border-color: var(--accent-text); background: var(--accent-text); }
.opt.selected .dot::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; margin: 6px 0 8px; }
.tile { background: var(--option); border: 2px solid transparent; border-radius: 20px; padding: 18px 10px 16px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); transition: border-color .15s, background .15s, transform .1s; }
.tile:hover { background: var(--option-hover); }
.tile:active { transform: scale(.98); }
.tile.selected { border-color: var(--accent); background: var(--selected-bg); }
.tile-img { width: 100%; max-width: 120px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 10px; font-size: 14px; }
.why { background: none; border: 0; color: var(--accent-text); font-weight: 600; font-size: 14px; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.why:hover { background: var(--accent-soft); }

.quote { font-family: var(--font-title); font-size: 21px; line-height: 1.35; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; margin: 10px 0 18px; width: 100%; }
.scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.scale-card { background: var(--option); border: 1.5px solid transparent; border-radius: 14px; padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.scale-card:hover { background: var(--option-hover); }
.scale-card.selected { border-color: var(--accent); background: var(--selected-bg); }
.scale-img { width: 46px; height: 46px; object-fit: cover; border-radius: 50%; }

.illusion { width: 100%; max-width: 380px; border-radius: 20px; overflow: hidden; margin: 6px auto 18px; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
/* Proporción natural: las imágenes horizontales se ven completas, sin recorte */
.illusion img { width: 100%; height: auto; }

.dato { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px 22px; width: 100%; margin-top: 8px; }
.dato-body { font-size: 17px; line-height: 1.55; margin-top: 6px; color: #E2E5EF; }
.dato-body b { color: var(--accent-text); }
.dato-src { font-size: 12px; color: var(--muted-2); margin-top: 14px; }

/* Botones */
.cta { width: 100%; background: var(--accent); color: #fff; border: 0; border-radius: 99px; padding: 17px 24px; font-size: 17px; font-weight: 700; cursor: pointer; margin-top: 22px; box-shadow: 0 6px 20px rgba(99, 102, 241, .28); transition: background .15s, transform .1s, opacity .15s; }
.cta:hover { background: var(--accent-hover); }
.cta:active { transform: scale(.985); }
.cta:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

/* Pausa */
.breathe { position: relative; width: 200px; height: 200px; display: grid; place-items: center; margin: 16px auto; }
.breathe-ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(99, 102, 241, .22) 0%, rgba(99, 102, 241, .04) 70%, transparent 100%); border: 1.5px solid rgba(99, 102, 241, .35); animation: respirar 8s ease-in-out infinite; }
.breathe-core { position: relative; width: 112px; height: 112px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: 0 0 35px rgba(99, 102, 241, .45); }
@keyframes respirar { 0%, 100% { transform: scale(.8); } 50% { transform: scale(1.12); } }

/* Resultado parcial */
.gauge { position: relative; width: 170px; height: 170px; margin: 6px auto 14px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 10; }
.gauge-bg { stroke: var(--track); }
.gauge-fill { stroke: var(--accent-text); stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.2, .7, .2, 1); }
.gauge-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-title); font-size: 40px; font-weight: 600; }
.parcial-frase { font-size: 18px; line-height: 1.45; margin-bottom: 8px; }
.parcial-frase b { color: var(--accent-text); }

/* Tarjetas, barras, listas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; width: 100%; margin-bottom: 14px; text-align: left; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.card p + p { margin-top: 10px; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 112px 1fr 42px; align-items: center; gap: 10px; font-size: 13px; }
.bar-label { color: var(--muted); }
.bar-track { height: 8px; background: rgba(255, 255, 255, .08); border-radius: 8px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: rgba(129, 140, 248, .45); border-radius: 8px; transition: width .8s ease; }
.bar-fill.is-top { background: linear-gradient(90deg, var(--accent-hover), var(--accent-text)); }
.bar-val { font-weight: 700; text-align: right; }
.mirror p { font-family: var(--font-title); font-size: 18px; line-height: 1.45; }
.list { list-style: none; text-align: left; }
.list li { position: relative; padding: 9px 0 9px 22px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.list li:last-child { border-bottom: 0; }
.list li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-text); }
.hueco { font-size: 15px; text-align: left; margin-top: 6px; color: var(--muted); }
.result-head { background: linear-gradient(135deg, rgba(99, 102, 241, .18), rgba(20, 184, 166, .16)); border: 1px solid rgba(99, 102, 241, .3); border-radius: 22px; padding: 22px 18px; width: 100%; margin-bottom: 14px; }
.result-kicker { font-size: 15px; color: var(--muted); }
.result-kicker b { color: var(--ink); }

/* Plan y análisis */
.plan { list-style: none; width: 100%; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.plan li { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.plan li span:last-child { color: var(--muted); }
.plan-days { font-size: 12px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .04em; }
.calc-pct { font-family: var(--font-title); font-size: 44px; font-weight: 600; color: var(--accent-text); }
.calc-bar { width: 100%; height: 10px; background: var(--track); border-radius: 10px; overflow: hidden; margin: 10px 0 20px; }
.calc-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--teal)); transition: width .15s linear; }
.calc-items { list-style: none; width: 100%; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.calc-items li { color: var(--muted-2); padding-left: 32px; position: relative; font-size: 15px; transition: color .3s; }
.calc-items li::before { content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); transition: background .3s; }
.calc-items li.done { color: var(--ink); }
.calc-items li.done::before { background: var(--accent-text); border-color: var(--accent-text); }
.fact { background: var(--surface); border-left: 3px solid var(--teal); border-radius: 12px; padding: 16px; margin-top: 22px; text-align: left; width: 100%; }
.fact span { display: block; font-size: 12px; color: var(--muted-2); margin-top: 6px; }

/* Preguntas durante el análisis */
.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; padding: 12px; z-index: 20; }
.sheet-box { background: var(--surface); border: 1px solid var(--line); width: 100%; max-width: 500px; border-radius: 22px; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); text-align: center; animation: subir .3s ease both; }
@keyframes subir { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.sheet-kicker { font-size: 12px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .04em; }
.sheet-label { font-size: 14px; color: var(--muted); margin-top: 6px; }
.sheet-q { font-family: var(--font-title); font-size: 20px; line-height: 1.35; margin: 8px 0 18px; }
.sheet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-btn { background: var(--option); border: 1.5px solid var(--line); border-radius: 99px; padding: 14px; font-size: 16px; font-weight: 700; cursor: pointer; }
.sheet-btn.is-yes { background: var(--accent); border-color: var(--accent); color: #fff; }
.confirmadas { font-size: 14px; font-weight: 700; color: var(--teal); margin-top: 8px; }
.list li.is-confirmed { color: var(--ink); }
.list li.is-confirmed::before { background: var(--teal); }

/* Formularios y oferta */
.input { width: 100%; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px 18px; font-size: 16px; margin-bottom: 6px; }
.input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 14px; line-height: 1.45; width: 100%; margin-top: 12px; cursor: pointer; color: var(--muted); }
.check input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; accent-color: var(--accent); }
.error { color: var(--error); font-size: 14px; margin-top: 8px; width: 100%; text-align: left; }
.price { background: var(--surface); border: 2px solid var(--accent); border-radius: 20px; padding: 14px 18px; width: 100%; text-align: left; margin-top: 4px; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; font-size: 15px; color: var(--muted); }
.price-row strong { font-size: 18px; white-space: nowrap; color: var(--ink); }
.price-terms { font-size: 13px; color: var(--muted-2); margin-top: 6px; line-height: 1.45; }
.done-mark { width: 80px; height: 80px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 40px; font-weight: 800; margin: 30px auto 18px; }

/* Idioma y país */
.top { display: flex; align-items: center; justify-content: space-between; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.geo-flag { width: 24px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.lang-switch { display: inline-flex; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 99px; padding: 2px; }
.lang-switch button { background: transparent; border: 0; color: var(--muted-2); font-size: 12px; font-weight: 700; letter-spacing: .03em; padding: 4px 10px; border-radius: 99px; cursor: pointer; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active { background: var(--accent); color: #fff; }
.geo-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; width: 100%; margin-bottom: 12px; text-align: left; }
.geo-card img { width: 36px; height: 24px; border-radius: 4px; object-fit: cover; }
.geo-card span { display: block; color: var(--muted); font-size: 13px; }
.geo-card strong { display: block; font-size: 16px; }
.sheet-added { color: var(--teal); font-weight: 700; font-size: 16px; padding: 13px 0; animation: subir .25s ease both; }
.list-check li { color: var(--ink); }
.list-check li::before { content: "✓"; background: none; color: var(--teal); width: auto; height: auto; left: 2px; top: 8px; font-weight: 700; }

/* Modal y pie */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .75); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; z-index: 10; }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px; max-width: 420px; width: 100%; }
.modal-box h3 { font-family: var(--font-title); font-size: 20px; margin-bottom: 10px; }
.modal-box p { color: var(--muted); }
.foot { text-align: center; font-size: 12px; color: var(--muted-2); padding-top: 32px; display: flex; flex-direction: column; gap: 8px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.foot a { color: var(--muted-2); text-decoration: none; }
.foot a:hover { color: var(--muted); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

@media (max-width: 380px) {
  .title { font-size: 22px; }
  .quote { font-size: 18px; }
  .bar-row { grid-template-columns: 96px 1fr 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
