/* =============================================================
   1. Tokens — identidad AenArte (oscuro como base, sin alternancia
   por prefers-color-scheme: es la identidad de marca, no un modo).
   Contrastes verificados contra WCAG 2.1 AA:
     --ink       sobre --bg / --surface  ≈ 16:1 / 14:1
     --ink-soft  sobre --bg / --surface  ≈ 9:1  / 8:1
     --ink-faint sobre --bg / --surface  ≈ 5.6:1 / 5:1
     --primary (texto/enlace) sobre --bg / --surface ≈ 6.2:1 / 5.5:1
     --on-primary sobre --primary (botones)          ≈ 6.2:1
     --accent (texto) sobre --bg / --surface          ≈ 9.6:1 / 8.5:1
     --border-strong sobre --surface / --bg           ≈ 3.3:1 / 3.7:1 (no-texto, UI)
   ============================================================= */
:root {
  --bg: #0B1D1A;
  --surface: #152826;
  --surface-2: #1B322F;
  --ink: #F7F4F0;
  --ink-soft: #C9B7A8;
  --ink-faint: #A0907F;
  --border: #223F3A;
  --border-strong: #5C7A74;

  --primary: #FF6B5C;
  --primary-dark: #E85A4A;
  --primary-soft: rgba(255, 107, 92, 0.16);
  --on-primary: #0B1D1A;

  --accent: #E8B96C;
  --accent-soft: rgba(232, 185, 108, 0.16);

  --warning-bg: #2A1E10;
  --warning-border: #7C5218;
  --warning-ink: #F3B562;

  --channel-meta: #9C8CFF;
  --channel-google-search: #FF9B6B;
  --channel-google-display: #E8B96C;
  --channel-tiktok: #F2EDE8;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Manrope", var(--sans);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background:
    radial-gradient(1100px 560px at 12% -10%, rgba(255, 107, 92, 0.10), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(232, 185, 108, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink); }
ul { padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; }

::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 1.25rem; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--surface);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* =============================================================
   4. Header & footer
   ============================================================= */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 40;
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding-block: 0.9rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; }
.brand__mark { display: flex; color: var(--primary); }
.brand__name { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.site-nav { display: none; gap: 1.5rem; font-weight: 600; font-size: 0.92rem; color: var(--ink-soft); }
.site-nav a:hover { color: var(--primary); }

@media (min-width: 720px) {
  .site-nav { display: flex; }
}

.site-footer { border-top: 1px solid var(--border); padding-block: 2rem; margin-top: 3rem; background: var(--surface); }
.site-footer__inner { display: flex; flex-direction: column; gap: 0.8rem; font-size: 0.88rem; color: var(--ink-faint); }
.site-footer__inner nav { display: flex; gap: 1.2rem; }
.site-footer__inner nav a { font-weight: 600; color: var(--ink-soft); }
.site-footer__inner nav a:hover { color: var(--primary); }

@media (min-width: 720px) {
  .site-footer__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* =============================================================
   5. Hero
   ============================================================= */
.hero { padding-block: 2.6rem 1.6rem; text-align: center; }
.hero h1 { font-size: clamp(1.6rem, 4.4vw, 2.5rem); max-width: 20ch; margin-inline: auto; color: var(--primary); }
.hero__subtitle { margin-top: 0.9rem; color: var(--ink-soft); font-size: 1.05rem; max-width: 56ch; margin-inline: auto; }

/* =============================================================
   6. Tool card
   ============================================================= */
.tool-section { padding-block: 0.5rem 2rem; }

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.4rem;
}
@media (min-width: 720px) { .tool-card { padding: 2rem; } }

.field-row { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.3rem; }
@media (min-width: 540px) { .field-row { grid-template-columns: 2fr 1fr; } }

.field label, .field-group legend { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.5rem; color: var(--ink); }
.field-group legend { padding: 0; margin-bottom: 0.7rem; }

input[type="number"], select {
  width: 100%; padding: 0.75rem 0.9rem; border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font-size: 1rem; font-family: var(--sans);
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
input[type="number"]:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}

.field-group { border: 0; padding: 0; margin-bottom: 1.4rem; }

.option-grid { display: grid; grid-template-columns: 1fr; gap: 0.7rem; }
@media (min-width: 720px) { .option-grid { grid-template-columns: repeat(2, 1fr); } }

.option-card {
  position: relative; display: flex; flex-direction: column; gap: 0.2rem;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 0.85rem 1rem 0.85rem 2.4rem; cursor: pointer;
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out);
}
.option-card:hover { border-color: var(--primary); }
.option-card input { position: absolute; left: 0.9rem; top: 1.05rem; accent-color: var(--primary); width: 1.05rem; height: 1.05rem; }
.option-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.option-card__title { font-weight: 700; font-size: 0.95rem; }
.option-card__hint { font-size: 0.82rem; color: var(--ink-faint); }

.field--industry { margin-bottom: 1.4rem; }
.field--business-name { margin-bottom: 1.4rem; }
.field__optional { font-weight: 400; color: var(--ink-faint); font-size: 0.82rem; }
input[type="text"] {
  width: 100%; padding: 0.75rem 0.9rem; border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font-size: 1rem; font-family: var(--sans);
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

.form-error {
  background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning-ink);
  border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; font-size: 0.9rem; margin-bottom: 1rem; font-weight: 600;
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-weight: 700; border-radius: var(--radius-md); padding: 0.9rem 1.6rem; font-size: 1rem; transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s var(--ease-out); }
.btn--primary { background: var(--primary); color: var(--on-primary); font-weight: 800; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn--primary:active { transform: scale(0.98); }
.btn--block { width: 100%; }

.noscript-msg { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning-ink); padding: 1rem; border-radius: var(--radius-sm); margin-top: 1rem; font-weight: 600; }

.privacy-badge { margin-top: 1.2rem; font-size: 0.85rem; color: var(--ink-faint); text-align: center; }

/* =============================================================
   7. Resultados
   ============================================================= */
.resultados { margin-top: 1.8rem; padding-top: 1.6rem; border-top: 1px solid var(--border); }

.alert { border-radius: var(--radius-md); padding: 1rem 1.2rem; font-size: 0.92rem; margin-bottom: 1.4rem; line-height: 1.55; }
.alert--warning { background: var(--warning-bg); border: 1.5px solid var(--warning-border); color: var(--warning-ink); }

.result-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.8rem; margin-bottom: 1.2rem; padding-bottom: 1.1rem; border-bottom: 1px dashed var(--border-strong);
}
.expert-toggle-wrap { max-width: 32rem; }
.expert-toggle { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.expert-toggle input { accent-color: var(--primary); width: 1.05rem; height: 1.05rem; }
.expert-toggle__hint { margin-top: 0.3rem; margin-left: 1.55rem; font-size: 0.8rem; color: var(--ink-faint); font-weight: 400; }

.btn--ghost {
  background: transparent; color: var(--primary); border: 1.5px solid var(--border-strong);
  padding: 0.6rem 1.1rem; font-size: 0.88rem;
}
.btn--ghost:hover { border-color: var(--primary); background: var(--primary-soft); }
.btn--ghost:disabled { opacity: 0.6; cursor: default; }

.expert-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem; margin-bottom: 1.4rem;
}
.expert-panel__hint { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 1rem; }
.expert-slider { margin-bottom: 1rem; }
.expert-slider:last-child { margin-bottom: 0; }
.expert-slider__head { display: flex; justify-content: space-between; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; }
.expert-slider__head strong { color: var(--accent); font-family: var(--display); }
.expert-slider input[type="range"] {
  width: 100%; accent-color: var(--primary); height: 1.4rem; cursor: pointer;
}

.fx-note { font-size: 0.8rem; color: var(--ink-faint); margin-top: 1rem; }

.channel-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 720px) { .channel-grid { grid-template-columns: repeat(2, 1fr); } }

.channel-card {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.1rem;
  background: var(--surface-2);
}
.channel-card__head { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 0.7rem; margin-bottom: 0.8rem; }
.channel-card__dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 0.35rem; background: var(--ink-faint); }
.channel-card--meta .channel-card__dot { background: var(--channel-meta); }
.channel-card--google-search .channel-card__dot { background: var(--channel-google-search); }
.channel-card--google-display .channel-card__dot { background: var(--channel-google-display); }
.channel-card--tiktok .channel-card__dot { background: var(--channel-tiktok); }
.channel-card__head h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.channel-card__head p { font-size: 0.82rem; color: var(--ink-faint); }
.channel-card__pct { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--primary); white-space: nowrap; }
.channel-card__budget { font-size: 0.95rem; margin-bottom: 0.7rem; padding-bottom: 0.7rem; border-bottom: 1px dashed var(--border-strong); }
.channel-card__budget strong { color: var(--accent); font-family: var(--display); }
.channel-card__metrics { display: grid; gap: 0.45rem; }
.metric { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; font-size: 0.87rem; }
.metric span { color: var(--ink-soft); }
.metric strong { font-weight: 700; text-align: right; }
.metric--na em { font-style: italic; font-weight: 400; color: var(--ink-faint); text-align: right; font-size: 0.82rem; }

.duration-card {
  margin-top: 1.4rem; background: var(--primary-soft); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.2rem 1.3rem;
}
.duration-card h3 { font-size: 1.02rem; margin-bottom: 0.6rem; }
.duration-card p { font-size: 0.92rem; margin-bottom: 0.6rem; }
.duration-card ul { font-size: 0.87rem; color: var(--ink-soft); }

.disclaimer { font-size: 0.82rem; color: var(--ink-faint); margin-top: 1.3rem; line-height: 1.6; }
.disclaimer--footer { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }

/* =============================================================
   8. Ad slots
   ============================================================= */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md);
  color: var(--ink-faint); font-weight: 700; letter-spacing: 0.08em; font-size: 0.8rem;
  background: var(--surface-2);
}
.ad-slot--leaderboard { margin-block: 1.8rem; }
.ad-slot--incontent { margin-block: 1.8rem; min-height: 120px; }
.ad-slot--sidebar { min-height: 250px; width: 100%; position: sticky; top: 5.5rem; }

/* =============================================================
   9. Content + sidebar layout
   ============================================================= */
.content-with-sidebar { display: grid; grid-template-columns: 1fr; gap: 2rem; padding-block: 0.5rem 2rem; }
.content-main { min-width: 0; }
.sidebar { display: none; }

@media (min-width: 1280px) {
  .content-with-sidebar { grid-template-columns: 1fr 280px; }
  .sidebar { display: block; }
}

.content-block { padding-block: 1.6rem; }
.content-block h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); color: var(--primary); margin-bottom: 0.9rem; }
.content-block h3 { font-size: 1.05rem; margin-top: 1.2rem; margin-bottom: 0.5rem; }
.content-block p { color: var(--ink-soft); margin-bottom: 0.7rem; }

.explainer-list li, .tips-list li { color: var(--ink-soft); }
.explainer-list strong, .tips-list strong { color: var(--ink); }

.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem; margin-bottom: 0.7rem; background: var(--surface);
}
.faq-item summary {
  cursor: pointer; font-weight: 700; font-size: 0.98rem; list-style: none;
  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-size: 1.3rem; color: var(--primary); flex-shrink: 0; transition: transform .2s var(--ease-out); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 0.7rem; color: var(--ink-soft); font-size: 0.93rem; }

/* =============================================================
   9.5 Pop-up de anuncio al descargar el PDF
   ============================================================= */
.pdf-ad-modal {
  border: 0; padding: 0; background: transparent; border-radius: var(--radius-lg); overflow: visible;
  position: fixed; top: 50%; left: 50%; margin: 0; transform: translate(-50%, -50%);
  max-height: 90vh;
}
.pdf-ad-modal::backdrop { background: rgba(4, 10, 9, 0.65); }
.pdf-ad-modal__box {
  position: relative; width: min(400px, calc(100vw - 2.6rem)); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.6rem 1.4rem 1.4rem;
}
.pdf-ad-modal__close {
  position: absolute; top: -0.75rem; right: -0.75rem; width: 2.6rem; height: 2.6rem;
  border-radius: 50%; background: var(--ink); color: var(--surface);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700;
  box-shadow: var(--shadow-md); border: 3px solid var(--bg);
  transition: transform .15s var(--ease-out), background .15s var(--ease-out);
}
.pdf-ad-modal__close:hover { background: var(--primary-dark); transform: scale(1.06); }
.ad-slot--modal { min-height: 250px; margin-top: 0.6rem; margin-bottom: 1.2rem; }
.pdf-ad-modal__continue { font-size: 0.92rem; }

@media (min-width: 540px) {
  .pdf-ad-modal__box { padding: 2rem 1.8rem 1.7rem; }
}

/* =============================================================
   10. Responsive breakpoints (reference)
   ============================================================= */
@media (min-width: 540px) { /* large phone / small tablet */ }
@media (min-width: 720px) { /* tablet portrait */ }
@media (min-width: 960px) { /* tablet landscape / small laptop */ }
@media (min-width: 1280px) { /* laptop / desktop */ }
@media (min-width: 1600px) { .container { max-width: 1280px; } }

/* =============================================================
   11. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .btn--primary:active { transform: none; }
}
