/* ═══════════════════════════════════════════════════
   PLAN RESURRECCIÓN — STYLES
   Tailwind gestiona el layout; aquí van:
   · CSS variables (palette del sitio existente)
   · Progressive reveal
   · Sliders personalizados
   · Jerarquía de outputs (números grandes)
   · Value stack y tablas
   · PDF template
   ═══════════════════════════════════════════════════ */

/* ── 1. VARIABLES (match novaiaautomation.com) ── */
:root {
  --bg:           #F8F6F2;
  --bg-subtle:    #F0EDE8;
  --bg-card:      #FFFFFF;
  --border:       rgba(17, 24, 39, 0.08);
  --border-hover: rgba(255, 87, 1, 0.3);
  --ink:          #111827;
  --muted:        rgba(17, 24, 39, 0.52);
  --accent:       #FF5701;
  --accent-dim:   rgba(255, 87, 1, 0.08);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  --radius:     8px;
  --radius-lg:  12px;
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --max-w:      760px;
}

/* ── 2. BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Dot pattern — igual que el sitio principal */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(17,24,39,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 120% 120% at 50% 0%, black 40%, transparent 90%);
  mask-image: radial-gradient(ellipse 120% 120% at 50% 0%, black 40%, transparent 90%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* Font helpers */
.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }
.text-muted   { color: var(--muted); }

/* ── 3. SECTION LABEL ── */
.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── 4. PROGRESSIVE REVEAL ── */
.section-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  pointer-events: none;
}
.section-reveal.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── 5. FORM ELEMENTS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.9375rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--ink);
  outline: none;
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-input::-webkit-inner-spin-button,
.form-input::-webkit-outer-spin-button { opacity: 0.4; }

.form-helper {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}
.form-warn {
  font-size: 0.8125rem;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 9px 13px;
  margin-top: 4px;
  line-height: 1.5;
}
.form-warn--center { text-align: center; font-size: 0.9375rem; padding: 16px 20px; }

/* Slider value badge */
.slider-val {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* Custom range slider */
.form-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
  margin: 4px 0;
}
.form-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 87, 1, 0.35);
  transition: transform 150ms;
}
.form-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.form-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* ── Input group labels ── */
.form-group-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-bottom: -4px;
}

/* ── 6. ADVANCED BLOCK ── */
.advanced-block {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 200ms;
}
.advanced-toggle:hover { color: var(--ink); }

.advanced-chevron {
  width: 16px;
  height: 16px;
  transition: transform 300ms var(--ease-out);
  flex-shrink: 0;
}
.advanced-chevron.open { transform: rotate(180deg); }

.advanced-fields {
  max-height: 0;
  overflow: hidden;
  transition: max-height 450ms var(--ease-out);
}
.advanced-fields.open { max-height: 2000px; }

/* ── 7. OUTPUT: HERO (número más grande de la página) ── */
.output-hero {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
  margin: 4px 0;
}

/* ── 8. CASCADE TABLE ── */
.cascade-table {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
}
.cascade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.cascade-row--last { border-bottom: none; }
.cascade-label {
  font-size: 0.875rem;
  color: var(--muted);
  font-family: var(--font-mono);
}
.cascade-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 56px;
  text-align: right;
}
.cascade-row--last .cascade-value { color: var(--accent); }

.output-highlight {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  text-align: center;
}
.output-highlight__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 12px;
}
.output-highlight__value {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

/* ── 9. RESULTS STACK ── */
.results-stack { display: flex; flex-direction: column; }

.result-item { padding: 28px 0; text-align: center; }
.result-item--hero { padding: 36px 0; }

.result-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 8px;
}
.result-number--hero {
  font-size: clamp(3rem, 9vw, 6rem);
  color: var(--accent);
}
.result-label {
  font-size: 1rem;
  color: var(--muted);
}
.result-divider {
  height: 1px;
  background: var(--border);
  margin: 0 15%;
}

/* ── 10. VALUE TABLE ── */
.value-table {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
.value-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.value-row--header {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: none;
  padding-bottom: 4px;
}
.value-row--total {
  font-weight: 700;
  border-bottom: none;
  padding-top: 16px;
}
.value-sep {
  height: 2px;
  background: var(--ink);
}
.value-sep--top  { margin-bottom: 4px; }
.value-sep--bottom { margin-top: 4px; margin-bottom: 0; }

.value-price { text-align: right; white-space: nowrap; flex-shrink: 0; }
.value-price--total { color: var(--accent); font-size: 1.0625rem; }

/* ── 11. INVERSIÓN ── */
.inversion-block {
  display: flex;
  align-items: center;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
}
.inversion-item { text-align: center; }
.inversion-main {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}
.inversion-sub {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 6px;
  max-width: 180px;
  line-height: 1.4;
}
.inversion-plus {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
}
.inversion-sep {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 32px 0;
}
.inversion-total { text-align: center; }
.inversion-total__label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.inversion-total__value {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 10px;
}
.inversion-total__breakdown {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}
.roi-block {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  text-align: center;
}
.roi-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}
.roi-value {
  color: var(--accent);
  font-size: 2.5rem;
  font-weight: 900;
  display: inline-block;
  margin: 0 6px;
  vertical-align: middle;
  line-height: 1;
}

/* ── 12. GARANTÍA ── */
.garantia-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 580px) { .garantia-grid { grid-template-columns: 1fr; } }

.garantia-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.garantia-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent-dim);
  margin-bottom: 12px;
  /* Visible pero decorativo */
  -webkit-text-stroke: 1.5px var(--border);
}
.garantia-card p { font-size: 0.9375rem; line-height: 1.6; color: var(--ink); }

/* ── 13. CTA BUTTONS ── */
.cta-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: 1.5px solid var(--accent);
  cursor: pointer;
  transition: opacity 200ms, transform 200ms var(--ease-out), box-shadow 200ms;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(255, 87, 1, 0.25);
}
.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 87, 1, 0.35);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 200ms, transform 200ms var(--ease-out);
  text-decoration: none;
}
.btn-ghost:hover {
  border-color: rgba(17, 24, 39, 0.2);
  transform: translateY(-2px);
}


/* ── SIDEBAR NAVIGATION ── */
.calc-sidebar {
  display: none;
}
@media (min-width: 1280px) {
  .calc-sidebar {
    display: flex;
    position: fixed;
    left: calc(50% - 540px);
    top: 90px;
    bottom: 90px;
    z-index: 50;
    flex-direction: column;
    justify-content: center;
    gap: 0;
  }
}

.calc-sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  text-decoration: none;
  opacity: 0.25;
  pointer-events: none;
  transition: opacity 350ms var(--ease-out);
}
.calc-sidebar__item--always {
  opacity: 0.55;
  pointer-events: auto;
}
.calc-sidebar__item.sidebar-unlocked {
  opacity: 0.55;
  pointer-events: auto;
}
.calc-sidebar__item.sidebar-active {
  opacity: 1;
}

.calc-sidebar__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background 300ms var(--ease-out), transform 300ms var(--ease-out), width 300ms, height 300ms;
}
.calc-sidebar__item.sidebar-active .calc-sidebar__dot {
  background: var(--accent);
  width: 9px;
  height: 9px;
}
.calc-sidebar__item.sidebar-unlocked:not(.sidebar-active) .calc-sidebar__dot {
  background: var(--ink);
}

.calc-sidebar__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.calc-sidebar__item.sidebar-active .calc-sidebar__label {
  color: var(--accent);
}


/* ══════════════════════════════════════════════════
   PDF TEMPLATE
   html2pdf renderiza este div. Usa sólo fuentes
   del sistema para garantizar fidelidad en el PDF.
   ══════════════════════════════════════════════════ */
#pdf-template {
  display: none;
  position: absolute;
  left: -9999px;
  top: 0;
  width: 210mm; /* A4 */
  background: #fff;
  color: #111;
}
