/* Conttrol landing — layout editorial (inspiración Mitzal) con paleta Conttrol:
   fondo azul-marino profundo, acento ámbar #e8a33d, azul de marca #0f4c81.

   Animación: todo el movimiento vive detrás de `html.js-anim` (que el JS solo
   añade cuando hay JS y el usuario NO pidió reduced-motion). Sin JS o con
   prefers-reduced-motion, la página es 100% estática y visible. */

:root {
  color-scheme: dark;
  --bg: #0a1422;
  --surface: #101d30;
  --surface-2: #15253c;
  --text: #eef2f7;
  --muted: #8fa1b8;
  --muted-2: #6a7c93;
  --divider: rgba(238, 242, 247, 0.14);
  --accent: #e8a33d;
  --accent-soft: #f3c884;
  --accent-dark: #7a5213;
  --brand: #0f4c81;
  --brand-light: #6ea8d8;
  --btn-on-accent: #1a1204;
  --hover-tint: rgba(238, 242, 247, 0.03);
  --font-heading: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Tema claro: elegido con el conmutador (data-theme) o, sin JS, según el SO */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #e8edf4;
  --text: #182335;
  --muted: #4d5f76;
  --muted-2: #68798e;
  --divider: rgba(24, 35, 53, 0.14);
  --accent: #9c6008;
  --accent-soft: #7d4d06;
  --accent-dark: #7a5213;
  --brand: #0f4c81;
  --brand-light: #2f6da8;
  --btn-on-accent: #ffffff;
  --hover-tint: rgba(24, 35, 53, 0.04);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #e8edf4;
    --text: #182335;
    --muted: #4d5f76;
    --muted-2: #68798e;
    --divider: rgba(24, 35, 53, 0.14);
    --accent: #9c6008;
    --accent-soft: #7d4d06;
    --accent-dark: #7a5213;
    --brand: #0f4c81;
    --brand-light: #2f6da8;
    --btn-on-accent: #ffffff;
    --hover-tint: rgba(24, 35, 53, 0.04);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-soft); }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.shell { max-width: 1240px; margin: 0 auto; padding-left: clamp(20px, 4vw, 56px); padding-right: clamp(20px, 4vw, 56px); }

h1, h2, h3 { font-family: var(--font-heading); text-transform: uppercase; letter-spacing: -0.01em; margin: 0; }

/* ── Rendimiento: no renderizar secciones bajo el pliegue hasta acercarse ── */
.features, .plans, .limits, .closing, .site-footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 700px;
}

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-heading); font-weight: 600; font-size: 14px;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  padding: 13px 22px; border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--btn-on-accent); }
.btn-primary:hover { background: var(--accent-soft); color: var(--btn-on-accent); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--divider); }
.btn-secondary:hover { border-color: var(--text); color: var(--text); }
/* Botón oscuro: vive sobre el bloque ámbar de cierre, no cambia con el tema */
.btn-dark { background: #0a1422; color: #e8a33d; }
.btn-dark:hover { background: #132238; color: #f3c884; }
.btn-block { width: 100%; justify-content: center; }

/* ── Conmutador de tema ── */
.theme-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: var(--surface); border: 1px solid var(--divider);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  cursor: pointer; color: var(--muted);
  transition: color 0.15s;
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ── Header (pegajoso, gana fondo al hacer scroll) ── */
.site-header {
  position: sticky; top: 0; z-index: 70;
  border-bottom: 1px solid var(--divider);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s, box-shadow 0.25s;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header { background: rgba(10, 20, 34, 0.85); }
  :root[data-theme="light"] .site-header { background: rgba(244, 246, 249, 0.88); }
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.header-row { display: flex; align-items: center; gap: 24px; padding-top: 18px; padding-bottom: 18px; }
.wordmark {
  font-family: var(--font-heading); font-weight: 700; font-size: 22px;
  letter-spacing: 0.16em; text-transform: uppercase; margin-right: auto;
}
.wordmark::first-letter { color: var(--accent); }
.site-header nav { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 28px); }
.site-header nav a:not(.btn) {
  position: relative;
  font-family: var(--font-heading); font-size: 13px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text); text-decoration: none;
}
.site-header nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.22s var(--ease-out);
}
.site-header nav a:not(.btn):hover { color: var(--accent); }
.site-header nav a:not(.btn):hover::after { transform: scaleX(1); }

/* ── Hero ── */
.hero .shell { padding-top: clamp(48px, 9vh, 110px); padding-bottom: clamp(48px, 8vh, 96px); }
.kicker {
  font-family: var(--font-heading); font-size: 13px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 26px;
}
.kicker.muted { color: var(--muted-2); margin: 0; }
.kicker.dark { color: var(--accent-dark); }
.hero h1 {
  font-weight: 700; font-size: clamp(40px, 7.4vw, 108px); line-height: 0.92;
  max-width: 18ch;
}
.lede { font-size: 18px; line-height: 1.75; max-width: 60ch; margin: 32px 0 0; color: var(--muted); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }

/* ── Entrada del hero (escalonada, solo con js-anim) ── */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.js-anim .rise {
  opacity: 0;
  animation: rise-in 0.7s var(--ease-out) forwards;
  animation-delay: calc(0.09s + var(--d, 0) * 0.11s);
}

/* ── Reveal al hacer scroll (solo con js-anim) ── */
.js-anim .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 0.08s);
}
.js-anim .reveal.in { opacity: 1; transform: none; }

/* ── Reclamos numerados ── */
.claims { border-top: 1px solid var(--divider); }
.claims > .shell { padding-top: clamp(36px, 5vh, 60px); }
.claim { border-top: 1px solid var(--divider); margin-top: clamp(28px, 4vh, 44px); }
.claim:first-of-type { border-top: 0; }
.claim-grid {
  display: grid; grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: clamp(14px, 3vw, 40px); padding-top: clamp(26px, 4vh, 42px); padding-bottom: clamp(26px, 4vh, 42px);
}
.claim-num {
  font-family: var(--font-heading); font-weight: 600; font-size: clamp(18px, 2vw, 24px);
  color: var(--accent); padding-top: 6px;
}
.claim-quote {
  font-family: var(--font-heading); font-weight: 600; text-transform: uppercase;
  font-size: clamp(26px, 4vw, 54px); line-height: 1; color: var(--accent);
  margin: 0; max-width: 28ch;
}
.claim-answer { font-size: 17px; line-height: 1.75; margin: 20px 0 0; max-width: 66ch; color: var(--text); }

/* ── Secciones genéricas ── */
section h2 { font-weight: 600; font-size: clamp(28px, 4.2vw, 56px); line-height: 0.98; max-width: 24ch; }
.section-lede { font-size: 16px; line-height: 1.7; max-width: 58ch; margin: 18px 0 0; color: var(--muted); }

/* ── Qué hace ── */
.features { border-top: 1px solid var(--divider); }
.features .shell { padding-top: clamp(48px, 7vh, 84px); padding-bottom: clamp(48px, 7vh, 84px); }
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(28px, 3.5vw, 48px); margin-top: clamp(32px, 4vw, 52px);
}
.feature svg {
  width: 26px; height: 26px; color: var(--accent);
  transition: transform 0.25s var(--ease-out);
}
.feature:hover svg { transform: translateY(-3px) scale(1.08); }
.feature h3 { font-weight: 600; font-size: 21px; line-height: 1.15; margin: 14px 0 0; }
.feature p { font-size: 15px; line-height: 1.65; margin: 8px 0 0; color: var(--muted); }

/* ── Planes ── */
.plans { border-top: 1px solid var(--divider); background: var(--surface); }
.plans .shell { padding-top: clamp(48px, 7vh, 84px); padding-bottom: clamp(48px, 7vh, 84px); }
.plans-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.interval-toggle { display: flex; border: 1px solid var(--divider); }
.interval-toggle button {
  font-family: var(--font-heading); font-size: 13px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 10px 18px;
  border: 0; cursor: pointer; background: transparent; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.interval-toggle button.active { background: var(--accent); color: var(--btn-on-accent); }

.plan-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: clamp(18px, 2.4vw, 28px); margin-top: clamp(32px, 4vw, 48px);
  min-height: 120px; /* evita salto de layout mientras cargan los planes */
}
.plan-loading, .plan-error { font-size: 15px; color: var(--muted); padding: 32px 0; }
.plan-error a { color: var(--accent); }
@keyframes pulse { 50% { opacity: 0.45; } }
.js-anim .plan-loading { animation: pulse 1.4s ease-in-out infinite; }

.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: var(--bg); border: 1px solid var(--divider); padding: 28px;
  transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
}
.plan-card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 163, 61, 0.55);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}
.plan-card.featured { border-color: var(--accent); }

/* Entrada escalonada de las tarjetas al renderizarse */
@keyframes pop-in {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.js-anim .plan-card.pop {
  animation: pop-in 0.5s var(--ease-out) backwards;
  animation-delay: calc(var(--d, 0) * 0.09s);
}

.plan-card .corner {
  position: absolute; width: 10px; height: 10px; border: 1px solid var(--accent);
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out);
}
.plan-card:hover .corner { width: 18px; height: 18px; }
.plan-card .corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.plan-card .corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.plan-card .corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.plan-card .corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.plan-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 26px; }
.plan-name { font-family: var(--font-heading); font-weight: 600; font-size: 24px; text-transform: uppercase; }
.plan-tag {
  font-family: var(--font-heading); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 10px;
  background: var(--accent); color: var(--btn-on-accent);
}
.plan-desc { font-size: 14px; line-height: 1.6; margin: 0; color: var(--muted); min-height: 44px; }
.plan-price-row { display: flex; align-items: baseline; gap: 7px; margin-top: 8px; }
.plan-price { font-family: var(--font-heading); font-weight: 700; font-size: 42px; line-height: 1; color: var(--accent); }
.plan-period { font-size: 12px; color: var(--muted-2); }
.plan-alt { font-size: 12px; line-height: 1.55; margin: 4px 0 0; color: var(--muted-2); min-height: 19px; }

.plan-limits { margin-top: 14px; border-top: 1px solid var(--divider); flex: 1; }
.plan-limit {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
  font-size: 13px; border-bottom: 1px solid var(--divider);
}
.plan-limit dt {
  font-family: var(--font-heading); letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted-2); margin: 0;
}
.plan-limit dd { font-family: var(--font-heading); font-size: 15px; margin: 0; }
.plan-card .btn { margin-top: 18px; }
.plans-note { font-size: 13px; line-height: 1.7; color: var(--muted-2); margin: 28px 0 0; max-width: 70ch; }

/* ── Límites ── */
.limits { border-top: 1px solid var(--divider); }
.limits .shell { padding-top: clamp(44px, 6vh, 72px); padding-bottom: clamp(44px, 6vh, 72px); }
.limits-table { margin-top: clamp(24px, 3vw, 36px); font-size: 15px; }
.limits-row {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr) 7rem; gap: 20px;
  padding: 12px 0; border-bottom: 1px solid var(--divider); line-height: 1.6;
  transition: background 0.2s;
}
.limits-row:not(.limits-head):hover { background: var(--hover-tint); }
.limits-row > span:nth-child(2) { color: var(--muted); }
.limits-row > span:nth-child(3) { color: var(--muted-2); }
.limits-head {
  font-family: var(--font-heading); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted-2); border-bottom: 1px solid var(--text);
}
.limits-head > span { color: inherit !important; }
.limits-name { font-family: var(--font-heading); font-size: 16px; text-transform: uppercase; }
@media (max-width: 640px) {
  .limits-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .limits-head { display: none; }
}

/* ── Cierre (bloque ámbar fijo: no cambia con el tema) ── */
.closing { background: #e8a33d; color: #1a1204; }
.closing .shell { padding-top: clamp(48px, 8vh, 100px); padding-bottom: clamp(48px, 8vh, 100px); }
.closing h2 { color: #1a1204; font-weight: 700; font-size: clamp(32px, 5.6vw, 80px); line-height: 0.92; max-width: 18ch; }
.closing p:not(.kicker) { font-size: 18px; line-height: 1.7; max-width: 52ch; margin: 26px 0 0; color: #3d2c0a; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 26px; font-size: 16px; }
.contact-links a { color: #1a1204; }
.contact-links a:hover { color: #000; }
.closing :focus-visible { outline-color: #1a1204; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--divider); }
.footer-row {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 28px;
  padding-top: 22px; padding-bottom: 22px;
  font-family: var(--font-heading); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted-2);
}
.footer-legal {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px;
  padding-top: 0; padding-bottom: 26px;
  font-size: 12px; letter-spacing: 0.04em; color: var(--muted-2);
}
.footer-legal a { color: var(--muted); text-decoration: none; }
.footer-legal a:hover { color: var(--accent); text-decoration: underline; }

/* ── Aviso de cookies ── */
.cookie-notice {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  display: none; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 720px; margin: 0 auto; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--divider);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  font-size: 13px; line-height: 1.6; color: var(--muted);
}
.cookie-notice.show { display: flex; }
.cookie-notice p { margin: 0; flex: 1 1 320px; }
.cookie-notice a { color: var(--accent); }
.cookie-notice .btn { padding: 9px 16px; font-size: 12px; }
/* Con el aviso visible, el conmutador de tema sube para no encimarse */
.cookie-notice.show ~ .theme-toggle,
body:has(.cookie-notice.show) .theme-toggle { bottom: 110px; }
@media (min-width: 780px) {
  body:has(.cookie-notice.show) .theme-toggle { bottom: 16px; right: 16px; }
  .cookie-notice { left: 50%; right: auto; transform: translateX(-50%); width: min(720px, calc(100vw - 180px)); }
}

/* ── Páginas legales ── */
.legal-page { background: var(--bg); }
.legal { max-width: 820px; margin: 0 auto; padding: clamp(36px, 6vh, 72px) clamp(20px, 4vw, 56px) clamp(48px, 8vh, 96px); }
.legal h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.02; }
.legal .legal-updated {
  font-family: var(--font-heading); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted-2); margin: 18px 0 0;
}
.legal h2 { font-size: clamp(19px, 2.4vw, 26px); line-height: 1.15; margin-top: clamp(34px, 5vh, 52px); }
.legal h3 { font-size: 16px; margin-top: 26px; }
.legal p, .legal li { font-size: 15px; line-height: 1.8; color: var(--muted); }
.legal p { margin: 14px 0 0; }
.legal ul, .legal ol { margin: 14px 0 0; padding-left: 22px; }
.legal li { margin-top: 8px; }
.legal li::marker { color: var(--accent); }
.legal strong { color: var(--text); }
.legal .legal-callout {
  border: 1px solid var(--divider); border-left: 3px solid var(--accent);
  background: var(--surface); padding: 16px 20px; margin-top: 22px;
}
.legal .legal-callout p { margin: 0; }
.legal table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border: 1px solid var(--divider); vertical-align: top; line-height: 1.6; }
.legal th {
  font-family: var(--font-heading); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-2); background: var(--surface);
}
.legal td { color: var(--muted); }
.legal .table-scroll { overflow-x: auto; margin-top: 18px; }
.legal .table-scroll table { margin-top: 0; min-width: 560px; }
.legal .back-home {
  display: inline-flex; align-items: center; gap: 8px; margin-top: clamp(36px, 5vh, 52px);
  font-family: var(--font-heading); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
}

/* ── Reduced motion: sin animaciones ni transiciones de movimiento ── */
@media (prefers-reduced-motion: reduce) {
  .js-anim .rise, .js-anim .reveal, .js-anim .plan-card.pop { opacity: 1; transform: none; animation: none; transition: none; }
  .plan-card, .plan-card .corner, .feature svg, .btn { transition: none; }
  .plan-card:hover, .feature:hover svg { transform: none; }
  .js-anim .plan-loading { animation: none; }
}
