/* ============================================================
   ¿VALE LA PENA? — estética garaje retro + premium
   Negro / amarillo / blanco / gris oscuro · rojo con moderación
   ============================================================ */
:root {
  --bg: #0e0e0f;
  --panel: #17181a;
  --panel-2: #1f2023;
  --line: #2c2d31;
  --yellow: #ffd400;
  --white: #f5f4ef;
  --muted: #9a9a94;
  --red: #e23b3b;
  --green: #35c26b;
  --blue: #3b82f6;
  --orange: #f59e0b;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-tap-highlight-color: rgba(255,212,0,.2);
  overscroll-behavior-y: contain;
}
main { flex: 1; width: 100%; padding: 1rem; max-width: 1200px; margin: 0 auto; }
img { max-width: 100%; }
a { color: var(--yellow); }

/* ---------- Header ---------- */
#site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,14,15,.96);
  border-bottom: 2px solid var(--yellow);
  padding-top: env(safe-area-inset-top, 0);
}
.shell { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
#site-header .shell { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; position: relative; }
#site-header .logo { position: absolute; left: 50%; transform: translateX(-50%); }
.logo {
  font-weight: 900; font-style: italic; letter-spacing: .5px;
  color: var(--yellow); text-decoration: none; font-size: 1.25rem; white-space: nowrap;
}
.nav { display: none; align-items: center; gap: 1.2rem; }
.nav a { color: var(--white); text-decoration: none; font-weight: 600; padding: .4rem .2rem; }
.nav a.active { color: var(--yellow); box-shadow: inset 0 -3px 0 var(--yellow); }
.nav-toggle {
  background: none; border: 1px solid var(--line); color: var(--white);
  font-size: 1.4rem; padding: .3rem .7rem; border-radius: 8px; cursor: pointer;
}
.nav.open {
  display: flex; position: absolute; top: 60px; left: 0; right: 0;
  background: var(--panel); flex-direction: column; align-items: stretch;
  padding: 1rem; gap: .6rem; border-bottom: 2px solid var(--yellow);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.4rem; border-radius: var(--radius);
  font-weight: 800; font-size: 1rem; cursor: pointer; text-decoration: none;
  border: 2px solid transparent; transition: transform .08s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--yellow); color: #111; }
.btn.white { background: var(--white); color: #111; }
.btn.buy { background: var(--green); color: #06240f; }
.btn.sell { background: var(--blue); color: #fff; }
.btn.ghost { background: transparent; color: var(--white); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.sm { min-height: 36px; padding: .35rem .8rem; font-size: .85rem; }

/* ---------- Hero ---------- */
.hero {
  text-align: center; padding: 3.5rem 1rem 2.5rem;
  background:
    repeating-linear-gradient(-45deg, rgba(255,212,0,.05) 0 18px, transparent 18px 36px),
    radial-gradient(ellipse at top, #1c1c10 0%, var(--bg) 60%);
  border-radius: var(--radius); margin-bottom: 1.5rem;
}
.hero-kicker { color: var(--muted); font-size: .8rem; font-weight: 400; letter-spacing: 2px; text-align: center; margin: .6rem 0; }
.hero-slogan { color: var(--white); font-size: clamp(1.05rem, 3vw, 1.4rem); font-weight: 800; letter-spacing: 2px; text-align: center; margin: .6rem 0; }
.hero-logo {
  font-size: clamp(2.4rem, 8vw, 4.5rem); font-weight: 900; font-style: italic;
  color: var(--yellow); letter-spacing: 1px; line-height: 1.05; margin: .3rem 0;
  text-shadow: 0 4px 24px rgba(255,212,0,.25);
}
.hero-sm { padding: 2rem 1rem; }
.hero-text { max-width: 620px; margin: 1rem auto 1.6rem; color: var(--muted); }
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Cards / grids ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem;
}
.cards-grid {
  display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem;
}
.feature-card {
  display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: var(--white);
}
.feature-card:hover { border-color: var(--yellow); }
.feature-head { display: flex; align-items: center; gap: .5rem; }
.feature-icon { font-size: 1.3rem; line-height: 1; }
.feature-card strong { font-size: 1.05rem; color: var(--yellow); }
.feature-card span:last-child, .moto-meta { color: var(--muted); font-size: .9rem; }
.moto-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.moto-card-img { width: 100%; aspect-ratio: 16/10; background: var(--panel-2); overflow: hidden; display: grid; place-items: center; }
.moto-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.moto-card-placeholder { width: 100%; height: 100%; background: var(--yellow); color: #111; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1rem; text-align: center; line-height: 1.2; }
.moto-card-info { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .2rem; }
.moto-card strong { font-size: 1.1rem; }
.moto-preview { width: 100%; max-width: 420px; margin: .8rem auto 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); aspect-ratio: 16/9; display: none; place-items: center; }
.moto-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.moto-preview.has-img { display: grid; }
.demo-strip { margin: 2rem 0; overflow: hidden; }
.demo-strip h3 { text-align: center; white-space: nowrap; font-size: clamp(.72rem, 3.4vw, 1.1rem); letter-spacing: 1px; overflow: hidden; text-overflow: ellipsis; }
.demo-strip > .hint { text-align: center; padding: 0 .5rem; }
section h3 { letter-spacing: 1.5px; font-size: 1.1rem; margin-bottom: .4rem; }
.demo-buttons { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .8rem; }

/* ---------- Wizard ---------- */
.page-head h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 900; font-style: italic; letter-spacing: .5px; }
.page-head p { color: var(--muted); margin-top: .3rem; }
.progress-bar {
  height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin-bottom: .5rem;
}
.progress-bar span {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 10px, #111 10px 20px);
  transition: width .25s ease;
}
.progress-text { color: var(--muted); font-size: .9rem; margin-bottom: 1.2rem; }
.wizard-step > .field { margin-bottom: 1.2rem; }
.wizard-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 2rem; }
.form-error { color: var(--red); font-weight: 600; min-height: 1.4em; margin-top: .4rem; }

.field-label { display: block; font-weight: 800; letter-spacing: .5px; margin-bottom: .45rem; font-size: .95rem; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .4rem; }
.inline-check { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; color: var(--muted); }
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 48px; padding: .6rem .9rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--white); font-size: 1.05rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, .opt-card:focus-within,
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--yellow); outline-offset: 2px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.price-row { display: flex; gap: .5rem; align-items: center; }
.cur-symbol { font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.cur-select { width: 90px; }

/* Tarjetas de opción (radios nativos = accesibles) */
.opt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.opt-cards input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.opt-card {
  display: block; text-align: center; padding: .65rem .5rem; min-height: 48px;
  background: var(--panel-2); border: 2px solid var(--line); border-radius: 10px;
  font-weight: 600; font-size: .92rem; cursor: pointer;
}
.opt-cards input:checked + .opt-card {
  border-color: var(--yellow); background: rgba(255,212,0,.12); color: var(--yellow);
}
.state-group { margin-bottom: 1.3rem; }
.state-group h4 { letter-spacing: 1.5px; font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }

/* ---------- Resultado ---------- */
.result-head { margin: 1rem 0; }
.result-head h2 { font-size: clamp(1.5rem, 5vw, 2.2rem); font-weight: 900; font-style: italic; }
.kicker { color: var(--muted); letter-spacing: 2px; font-size: .78rem; font-weight: 700; }
.result .card { margin-bottom: 1.2rem; }
.score-panel { display: flex; flex-direction: column; gap: 1.2rem; align-items: center; text-align: left; }
.gauge {
  --p: 50; width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(var(--yellow) calc(var(--p) * 1%), var(--panel-2) 0);
  display: grid; place-items: center; flex-shrink: 0;
}
.gauge-inner {
  width: 118px; height: 118px; border-radius: 50%; background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-num { font-size: 2.4rem; font-weight: 900; line-height: 1; }
.gauge-den { color: var(--muted); font-size: .85rem; }
.band-chip {
  display: inline-block; padding: .4rem .9rem; border-radius: 99px;
  font-weight: 900; letter-spacing: 1px; font-size: .95rem;
}
.band-chip.green { background: rgba(53,194,107,.16); color: var(--green); }
.band-chip.yellow { background: rgba(255,212,0,.14); color: var(--yellow); }
.band-chip.orange { background: rgba(245,158,11,.16); color: var(--orange); }
.band-chip.red { background: rgba(226,59,59,.16); color: var(--red); }
.score-note { color: var(--muted); font-size: .88rem; margin: .5rem 0; }
.stats div { margin: .3rem 0; }
.stat-row {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: .55rem 0; border-bottom: 1px dashed var(--line); font-size: .98rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-row small { color: var(--muted); font-weight: 400; }
.stat-row strong { text-align: right; }
.risk-green strong { color: var(--green); } .risk-yellow strong { color: var(--yellow); }
.risk-orange strong { color: var(--orange); } .risk-red strong { color: var(--red); }
.nego-target strong { color: var(--yellow); }
.tier-fast strong { color: var(--orange); }
.tier-test strong { color: var(--green); }
.why-grid div { margin-bottom: 1rem; }
.why-grid h4 { margin-bottom: .4rem; }
.why-grid ul, .card ul { padding-left: 1.2rem; }
.why-grid li, .card li { margin: .25rem 0; }
.repair-table { width: 100%; border-collapse: collapse; }
.repair-table td { padding: .5rem .2rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.repair-table td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
@media (max-width: 480px) {
  .ficha-table tr { display: flex; flex-direction: column; gap: .15rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
  .ficha-table td { border: none; padding: .15rem 0; display: block; width: 100%; }
  .ficha-table td:first-child { color: var(--muted); font-size: .82rem; font-weight: 600; text-align: left; }
  .ficha-table td:last-child { text-align: left; white-space: normal; word-break: break-word; font-size: .95rem; }
}
.repair-total td { border-top: 2px solid var(--yellow); border-bottom: none; color: var(--yellow); font-size: 1.05rem; }
.disclaimer {
  font-size: .78rem; color: var(--muted); border-left: 3px solid var(--yellow);
  padding-left: .8rem; margin: 1.2rem 0;
}
.checklist { list-style: none; }
.checklist label {
  display: flex; gap: .7rem; align-items: center; padding: .55rem .4rem;
  border-bottom: 1px dashed var(--line); cursor: pointer;
}
.checklist input { width: 20px; height: 20px; accent-color: var(--yellow); }
.check-counter { margin-top: .8rem; color: var(--yellow); }
.result-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.4rem 0; }
.back-link { display: inline-block; margin: .8rem 0; text-decoration: none; }

.ad-title { font-size: 1.15rem; font-weight: 800; margin: .3rem 0 1rem; }
.row-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .8rem; }

/* Ficha */
.ficha-badges { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.badge-card h4 { color: var(--muted); font-size: .82rem; letter-spacing: 1.5px; margin-bottom: .4rem; }
.stars { font-size: 1.3rem; }

/* Dashboard */
.analysis-card { display: flex; flex-direction: column; gap: .4rem; }
.mode-badge {
  align-self: flex-start; font-size: .72rem; font-weight: 900; letter-spacing: 1px;
  padding: .2rem .6rem; border-radius: 99px;
}
.badge-buy { background: rgba(53,194,107,.16); color: var(--green); }
.badge-sell { background: rgba(59,130,246,.16); color: var(--blue); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .btn { margin-top: 1rem; }

/* Precios */
.pricing-cards { display: grid; grid-template-columns: 1fr; gap: 1.2rem; margin: 1.5rem 0; }
.price-card { display: flex; flex-direction: column; gap: .6rem; }
.price-card.featured { border-color: var(--yellow); box-shadow: 0 0 30px rgba(255,212,0,.08); }
.price-tag { font-size: 2rem; font-weight: 900; color: var(--yellow); }
.sales-copy p { margin: .5rem 0; }
.center { text-align: center; }

/* Asistente */
.chat { display: flex; flex-direction: column; gap: .8rem; }
.chat-log { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; }
.msg { padding: .7rem 1rem; border-radius: 12px; max-width: 90%; }
.msg.bot { background: var(--panel-2); border-left: 3px solid var(--yellow); }
.msg.user { background: rgba(255,212,0,.14); align-self: flex-end; border-right: 3px solid var(--yellow); }
.sample-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--white);
  border-radius: 99px; padding: .35rem .8rem; font-size: .85rem; cursor: pointer;
}
.chip:hover { border-color: var(--yellow); color: var(--yellow); }
.chat-form { display: flex; gap: .6rem; }

/* Footer */
#site-footer { background: var(--panel); border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0; }
.footer-grid { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-logo { font-weight: 900; font-style: italic; color: var(--yellow); }
.footer-nav { display: flex; gap: 1rem; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.footer-nav a:hover { color: var(--yellow); }
.legal { font-size: .75rem; color: var(--muted); margin-top: 1rem; }

/* PDF progreso */
.pdf-progress { display: flex; align-items: center; gap: .8rem; background: var(--panel); border: 1px solid var(--yellow); border-radius: 10px; padding: .8rem 1rem; margin: 1rem 0; }
.pdf-progress-bar { flex: 1; height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.pdf-progress-bar span { display: block; height: 100%; width: 30%; background: var(--yellow); animation: pdfProgress 1.1s ease-in-out infinite; }
@keyframes pdfProgress { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.pdf-progress-text { font-weight: 800; font-size: .9rem; color: var(--yellow); white-space: nowrap; }

/* Toast */
.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--yellow); color: #111; font-weight: 700;
  padding: .8rem 1.4rem; border-radius: 99px; opacity: 0; transition: all .25s ease;
  z-index: 100; max-width: 90vw; text-align: center;
  padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0));
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Móvil ≤ 480px: botones y formularios a ancho completo ---------- */
@media (max-width: 480px) {
  main { padding: .8rem; }
  .hero { padding: 2rem .8rem 1.5rem; }
  .hero-logo { font-size: 2.2rem; }
  .btn { width: 100%; }
  .hero-ctas .btn, .result-actions .btn, .row-actions .btn { width: 100%; }
  .price-row { flex-wrap: wrap; }
  .opt-cards { grid-template-columns: 1fr 1fr; }
  input[type="text"], input[type="number"], input[type="search"], input[type="email"], input[type="password"], select, textarea { font-size: 16px; } /* evita zoom iOS */
  .chat-form { flex-direction: column; }
  .chat-form .btn { width: 100%; }
}

/* ---------- Responsive ≥ 720px ---------- */
@media (min-width: 720px) {
  main { padding: 1.5rem; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .score-panel { flex-direction: row; }
  .why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
  .pricing-cards { grid-template-columns: repeat(2, 1fr); max-width: 800px; margin-inline: auto; }
  .ficha-badges { grid-template-columns: repeat(2, 1fr); }
  .nav { display: flex; }
  .nav-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Impresión / exportar PDF ---------- */
@media print {
  body { background: #fff; color: #111; }
  .no-print, #site-header, #site-footer, .toast { display: none !important; }
  .card, .result .card { border: 1px solid #ccc; background: #fff; break-inside: avoid; }
  .hero-logo, .hero-slogan, .page-head h1, .result-head h2 { color: #000; }
  .gauge { background: conic-gradient(#000 calc(var(--p) * 1%), #ddd 0); }
  .gauge-inner { background: #fff; }
  .stat-row, .repair-table td { border-color: #ccc; }
  .disclaimer { color: #444; }
  a { color: #000; }
}
