/* Everbest · página pública
   Tokens del manual de identidad. Proporción: Noche 60% · neutros 30% · Cumbre 10%.
   Regla: el bronce Cumbre nunca indica estado; éxito y error van con ícono y texto. */

@layer base, layout, components, utilities;

@font-face { font-family: "Inter"; src: url("../fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/InterDisplay-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
/* respaldo con métricas de Inter: evita que el texto salte cuando llega la fuente */
@font-face { font-family: "Inter Fallback"; src: local("Arial"); size-adjust: 107.06%; ascent-override: 90.49%; descent-override: 22.56%; line-gap-override: 0%; }

@layer base {
  :root {
    --noche: #121417; --grafito: #1C1F24; --granito: #2B2F36; --piedra: #6B7079;
    --niebla: #A9ADB4; --nieve: #F6F5F2; --cumbre: #C8A46A;
    --exito: #3FA373; --error: #E5674F;
    --font: "Inter", "Inter Fallback", -apple-system, "Segoe UI", Roboto, sans-serif;
    --display: "Inter Display", "Inter", "Inter Fallback", -apple-system, sans-serif;
    --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);       /* cuerpo 16 → 18 */
    --step-1: clamp(1.125rem, 1.07rem + 0.3vw, 1.3rem);     /* lead */
    --step-2: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);      /* h3 */
    --step-3: clamp(1.75rem, 1.45rem + 1.4vw, 2.6rem);      /* h2 */
    --step-4: clamp(2.6rem, 1.9rem + 3.4vw, 4.75rem);       /* display */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
    --section: clamp(64px, 8vw, 120px);
    --r: 12px; --r-lg: 20px; --wrap: 1120px;
    --ring: 0 0 0 3px color-mix(in srgb, var(--cumbre) 55%, transparent);
    color-scheme: dark;
  }
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
  body { background: var(--noche); color: var(--nieve); font-family: var(--font); font-size: var(--step-0); line-height: 1.6;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  img, svg { display: block; max-width: 100%; }
  img { height: auto; }
  a { color: var(--cumbre); text-underline-offset: 3px; }
  a:hover { color: color-mix(in srgb, var(--cumbre) 80%, white); }
  :focus-visible { outline: 3px solid color-mix(in srgb, var(--cumbre) 70%, transparent); outline-offset: 3px; border-radius: 6px; }
  h1, h2, h3, h4 { text-wrap: balance; }
  p { text-wrap: pretty; }
  ::selection { background: color-mix(in srgb, var(--cumbre) 35%, transparent); }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
}

@layer layout {
  .wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
  .narrow { width: min(100% - 48px, 760px); }
  .section { padding-block: var(--section); }
  .section-alt { background: color-mix(in srgb, var(--grafito) 70%, var(--noche)); border-block: 1px solid var(--granito); }
  .split { display: grid; gap: var(--s-7); align-items: center; }
  @media (min-width: 900px) { .split { grid-template-columns: 1.15fr .85fr; gap: var(--s-8); } .split-rev { grid-template-columns: .85fr 1.15fr; } }
  .grid-2 { display: grid; gap: var(--s-4); }
  @media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
}

@layer components {
  /* ---------- tipografía ---------- */
  .display { font-family: var(--display); font-weight: 600; font-size: var(--step-4); line-height: 1.02; letter-spacing: -.025em; }
  .h2 { font-family: var(--display); font-weight: 600; font-size: var(--step-3); line-height: 1.12; letter-spacing: -.015em; max-width: 22ch; }
  .h3 { font-family: var(--display); font-weight: 600; font-size: var(--step-2); line-height: 1.25; }
  .h4 { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
  .kicker { font-size: .8125rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--cumbre); margin-bottom: var(--s-3); }
  .lead { font-size: var(--step-1); color: var(--niebla); line-height: 1.55; max-width: 36rem; margin-top: var(--s-5); }
  .lead-sm { color: var(--niebla); margin-top: var(--s-4); max-width: 34rem; }
  .muted { color: var(--niebla); }
  .hint { color: var(--niebla); font-size: .875rem; margin-top: 6px; }

  /* ---------- botones ---------- */
  .btn { --h: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--h); padding: 0 22px;
    border-radius: var(--r); border: 1.5px solid transparent; font: 600 1rem/1 var(--font); text-decoration: none; cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .08s ease; white-space: nowrap; }
  .btn:active { transform: scale(.98); }
  .btn-sm { --h: 40px; padding: 0 16px; font-size: .9375rem; }
  .btn-lg { --h: 56px; padding: 0 28px; font-size: 1.0625rem; }
  .btn-primary { background: var(--cumbre); color: var(--noche); }
  .btn-primary:hover { background: color-mix(in srgb, var(--cumbre) 88%, white); color: var(--noche); }
  .btn-outline { border-color: var(--piedra); color: var(--nieve); background: transparent; }
  .btn-outline:hover { border-color: var(--nieve); color: var(--nieve); }
  .btn-ghost { color: var(--nieve); background: transparent; }
  .btn-ghost:hover { color: var(--cumbre); }
  .btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; }
  .cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

  /* ---------- encabezado ---------- */
  .skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--cumbre); color: var(--noche); padding: 10px 14px; border-radius: 8px; font-weight: 600; }
  .skip:focus { top: 12px; }
  .site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--noche) 88%, transparent);
    backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
  .site-header.is-scrolled { border-bottom-color: var(--granito); }
  .header-in { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 68px; }
  .logo { display: inline-flex; align-items: center; gap: 10px; color: var(--nieve); text-decoration: none; }
  .logo:hover { color: var(--nieve); }
  .logo .wordmark { height: 20px; width: auto; }
  .nav { display: none; gap: var(--s-6); }
  .nav a { color: var(--niebla); text-decoration: none; font-size: .9375rem; font-weight: 500; }
  .nav a:hover { color: var(--nieve); }
  .header-cta { display: flex; gap: var(--s-2); align-items: center; }
  @media (min-width: 900px) { .nav { display: flex; } }
  @media (max-width: 479px) { .hide-sm { display: none; } }
  @media (max-width: 359px) { .logo .wordmark { display: none; } }

  /* ---------- hero ---------- */
  .hero { padding-block: clamp(40px, 7vw, 96px) var(--section); overflow: clip; }
  .hero-in { display: grid; gap: var(--s-7); align-items: center; }
  @media (min-width: 900px) { .hero-in { grid-template-columns: 1.2fr .8fr; } }
  .trust { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-top: var(--s-5); color: var(--niebla); font-size: .9375rem; }
  .trust li { display: flex; gap: 6px; align-items: center; }
  .trust svg, .ticks svg { color: var(--exito); width: 20px; height: 20px; flex: none; }
  .hero-media { justify-self: center; }

  .phone { width: min(300px, 78vw); aspect-ratio: 600 / 1298; border-radius: 40px; padding: 10px; background: #000;
    box-shadow: 0 0 0 1px var(--granito), 0 40px 80px -30px rgba(0, 0, 0, .7); justify-self: center; }
  .phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 30px; }
  .phone-sm { width: min(270px, 70vw); }
  @media (max-width: 899px) { .phone-opt { display: none; } }

  /* ---------- cómo funciona ---------- */
  .steps { list-style: none; padding: 0; display: grid; gap: var(--s-5); margin-top: var(--s-7); counter-reset: s; }
  @media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
  .step { padding: var(--s-6); border-radius: var(--r-lg); background: var(--grafito); border: 1px solid var(--granito); }
  .step p { color: var(--niebla); margin-top: var(--s-2); }
  .step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--cumbre); color: var(--cumbre);
    font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: var(--s-4); }

  /* ---------- módulos ---------- */
  .modules { display: grid; gap: var(--s-4); margin-top: var(--s-7); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
  .module { padding: var(--s-5); border-radius: var(--r-lg); background: var(--noche); border: 1px solid var(--granito); }
  .module p { color: var(--niebla); font-size: .9375rem; margin-top: 6px; line-height: 1.5; }
  .module-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--grafito); color: var(--cumbre); margin-bottom: var(--s-4); }
  /* en teléfono: ícono a la izquierda, tarjeta compacta */
  @media (max-width: 599px) {
    .modules { gap: var(--s-3); }
    .module { display: grid; grid-template-columns: 44px 1fr; column-gap: var(--s-4); padding: var(--s-4); }
    .module-ic { grid-row: span 2; margin: 0; }
    .module p { margin-top: 2px; }
  }

  /* ---------- campamentos ---------- */
  .camps { list-style: none; padding: 0; margin-top: var(--s-6); position: relative; }
  .camps::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 2px; background: var(--granito); }
  .camps li { display: flex; gap: var(--s-4); align-items: flex-start; padding-block: 10px; position: relative; }
  .camps strong { display: block; font-weight: 600; }
  .camps span { color: var(--niebla); font-size: .9375rem; }
  .camp-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--piedra); background: var(--noche); flex: none; margin-top: 4px; position: relative; }
  .camp-dot.on { background: var(--cumbre); border-color: var(--cumbre); }

  /* ---------- avisos ---------- */
  .notif-demo { display: grid; gap: 10px; padding: var(--s-6); border-radius: 28px; background: linear-gradient(160deg, #3b4552, #1d232b); max-width: 420px; justify-self: center; width: 100%; }
  .notif { display: flex; gap: 12px; padding: 14px; border-radius: 18px; background: color-mix(in srgb, var(--nieve) 14%, transparent); }
  .notif-ic { width: 38px; height: 38px; border-radius: 9px; background: var(--noche); display: grid; place-items: center; flex: none; color: var(--nieve); }
  .notif strong { display: flex; justify-content: space-between; font-size: .9375rem; }
  .notif small { font-weight: 400; color: color-mix(in srgb, var(--nieve) 70%, transparent); }
  .notif span { font-size: .9375rem; line-height: 1.35; }
  .notif-demo figcaption { font-size: .8125rem; color: color-mix(in srgb, var(--nieve) 75%, transparent); text-align: center; margin-top: 4px; }
  .ticks { list-style: none; padding: 0; display: grid; gap: var(--s-4); margin-top: var(--s-6); }
  .ticks li { display: flex; gap: 12px; align-items: flex-start; }
  .ticks li svg { margin-top: 3px; }
  .ticks span { color: var(--niebla); }
  .ticks strong { color: var(--nieve); font-weight: 600; }
  .ticks-sm { gap: var(--s-3); margin: 0; }

  /* ---------- precio ---------- */
  .price-card { margin-top: var(--s-7); display: grid; gap: var(--s-6); padding: clamp(24px, 4vw, 48px); border-radius: var(--r-lg);
    border: 1.5px solid color-mix(in srgb, var(--cumbre) 55%, transparent); background: color-mix(in srgb, var(--cumbre) 7%, var(--noche)); align-items: center; }
  @media (min-width: 900px) { .price-card { grid-template-columns: 1.2fr 1fr auto; } }
  .price-big { font-family: var(--display); font-weight: 600; font-size: var(--step-3); line-height: 1.1; }
  .price-main .muted { margin-top: var(--s-2); max-width: 32rem; }
  .price-plans { display: flex; gap: var(--s-5); margin-top: var(--s-4); font-variant-numeric: tabular-nums; }

  /* ---------- app / lista de espera ---------- */
  .soon { margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--granito); }
  .soon-h { font-weight: 600; font-size: 1.0625rem; }
  .installed-note { display: flex; gap: 8px; align-items: center; color: var(--exito); margin-top: var(--s-4); }
  .installed-note svg { width: 20px; height: 20px; }

  /* ---------- formularios ---------- */
  .form { display: grid; gap: var(--s-5); margin-top: var(--s-5); max-width: 560px; }
  #contacto .form { max-width: none; }
  .field-row { display: grid; gap: 6px; border: 0; padding: 0; min-width: 0; }
  .label { font-size: .9375rem; font-weight: 500; color: var(--niebla); padding: 0; }
  .input { width: 100%; min-height: 52px; padding: 12px 16px; border-radius: var(--r); border: 1.5px solid var(--piedra); background: var(--grafito);
    color: var(--nieve); font: 400 1rem/1.4 var(--font); transition: border-color .15s, box-shadow .15s; }
  .input::placeholder { color: var(--piedra); }
  .input:focus { outline: none; border-color: var(--cumbre); box-shadow: var(--ring); }
  .input:user-invalid, .input[aria-invalid="true"] { border-color: var(--error); }
  .textarea { min-height: 140px; resize: vertical; field-sizing: content; max-height: 360px; }
  .err { display: flex; gap: 6px; align-items: flex-start; color: var(--error); font-size: .9375rem; line-height: 1.4; }
  .err svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
  .seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .seg-opt { position: relative; }
  .seg-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
  .seg-opt span { display: grid; place-items: center; min-height: 48px; border-radius: var(--r); border: 1.5px solid var(--piedra); font-weight: 500; transition: background-color .15s, border-color .15s; }
  .seg-opt input:checked + span { background: var(--cumbre); border-color: var(--cumbre); color: var(--noche); font-weight: 600; }
  .seg-opt input:focus-visible + span { box-shadow: var(--ring); }
  .check { display: flex; gap: 12px; align-items: flex-start; font-size: .9375rem; color: var(--niebla); line-height: 1.45; cursor: pointer; position: relative; }
  .check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
  .check .box { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--piedra); display: grid; place-items: center; color: transparent; flex: none; }
  .check .box svg { width: 16px; height: 16px; }
  .check input:checked + .box { background: var(--cumbre); border-color: var(--cumbre); color: var(--noche); }
  .check input:focus-visible + .box { box-shadow: var(--ring); }
  .form .btn { justify-self: start; }
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); margin-top: var(--s-5); line-height: 1.45; }
  .notice svg { width: 22px; height: 22px; flex: none; }
  .notice.ok { background: color-mix(in srgb, var(--exito) 14%, var(--noche)); border: 1px solid color-mix(in srgb, var(--exito) 45%, transparent); }
  .notice.ok svg { color: var(--exito); }
  .notice.err { background: color-mix(in srgb, var(--error) 12%, var(--noche)); border: 1px solid color-mix(in srgb, var(--error) 45%, transparent); }
  .notice.err svg { color: var(--error); }

  /* ---------- preguntas ---------- */
  .faq { margin-top: var(--s-6); border-top: 1px solid var(--granito); }
  .faq-item { border-bottom: 1px solid var(--granito); }
  .faq-item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--s-4); align-items: center; padding: 20px 0; font-weight: 600; font-size: 1.0625rem; }
  .faq-item summary::-webkit-details-marker { display: none; }
  .faq-item summary svg { flex: none; color: var(--niebla); transition: transform .2s; }
  .faq-item[open] summary svg { transform: rotate(180deg); }
  .faq-item p { color: var(--niebla); padding-bottom: 20px; max-width: 60ch; }

  /* ---------- cierre y pie ---------- */
  .final { padding-block: var(--section); text-align: center; }
  .final-in { display: grid; justify-items: center; gap: var(--s-5); color: var(--nieve); }
  .final .h2 { max-width: none; }
  .site-footer { border-top: 1px solid var(--granito); padding-block: var(--s-7) var(--s-6); background: var(--noche); }
  .footer-in { display: grid; gap: var(--s-6); }
  @media (min-width: 800px) { .footer-in { grid-template-columns: 1fr 2fr; } }
  .footer-brand .muted { margin-top: var(--s-2); }
  .footer-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-5); }
  .footer-nav div { display: grid; gap: 10px; align-content: start; }
  .footer-nav a { color: var(--niebla); text-decoration: none; font-size: .9375rem; }
  .footer-nav a:hover { color: var(--nieve); }
  .footer-h { font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--nieve); }
  .footer-note { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--granito); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3);
    color: var(--piedra); font-size: .8125rem; }
  .footer-note p { color: var(--niebla); }

  /* ---------- barra de instalación y hojas ---------- */
  .app-bar { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 50; display: flex; align-items: center; gap: 12px;
    padding: 10px 10px 10px 14px; border-radius: 16px; background: color-mix(in srgb, var(--granito) 96%, transparent);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45); color: var(--nieve); max-width: 520px; margin-inline: auto; }
  .app-bar p { flex: 1; display: grid; line-height: 1.25; font-size: .9375rem; min-width: 0; }
  .app-bar p span { color: var(--niebla); font-size: .8125rem; }
  .app-bar-close { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--niebla); cursor: pointer; border-radius: 50%; flex: none; }
  @starting-style { .app-bar { opacity: 0; translate: 0 16px; } }
  .app-bar { transition: opacity .3s ease, translate .3s ease; }
  .sheet { border: 0; padding: 0; border-radius: 20px; background: var(--grafito); color: var(--nieve); width: min(100% - 32px, 440px); margin: auto; }
  .sheet::backdrop { background: rgba(0, 0, 0, .6); }
  .sheet-in { padding: var(--s-6); display: grid; gap: var(--s-4); }
  .sheet .btn { justify-self: stretch; }
  .steps-ios { padding-left: 1.25rem; display: grid; gap: 10px; color: var(--niebla); }
  .steps-ios strong { color: var(--nieve); }
  .steps-ios svg { display: inline-block; vertical-align: -4px; color: var(--cumbre); }

  /* ---------- legales y errores ---------- */
  .legal .h3 { margin-top: var(--s-6); margin-bottom: var(--s-2); }
  .legal p, .legal li { color: var(--niebla); }
  .legal strong { color: var(--nieve); }
  .legal ul { padding-left: 1.25rem; display: grid; gap: 6px; }
  .center-block { text-align: left; }
}

@layer utilities {
  [hidden] { display: none !important; }
}
