/* =========================================================================
   Valkrin · Hoja de estilos
   Sistema de diseño de la maqueta F (aprobada 30/07/2026).
   Ver Docs/03-identidad-visual.md
   ========================================================================= */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --ink:      #0E2330;
  --navy:     var(--valkrin-navy, #0B2233);
  --primary:  var(--valkrin-blue, #1192C9);
  --aqua:     var(--valkrin-cyan, #17C0C9);
  --bg:       #FFFFFF;
  --bg2:      #F4F8FB;
  --muted:    #5B7282;
  --line:     #E1EBF1;
  --ok:       #13A36B;
  --warn:     #E8804A;

  --grad:     linear-gradient(135deg, var(--primary), var(--aqua));
  --radius:   18px;
  --shadow:   0 18px 48px rgba(11, 59, 92, .10);

  --sans:     var(--valkrin-font, Arial, Helvetica, sans-serif);

  --wrap:     1140px;
  --gutter:   24px;
  --sec-y:    clamp(56px, 8vw, 88px);
  --header-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:   #EAF2F7;
    --bg:    #0C1A24;
    --bg2:   #0E222F;
    --muted: #9DB2BF;
    --line:  #1E3340;
  }
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }

h1, h2, h3 {
  margin: 0 0 .4em;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(34px, 5.2vw, 52px); font-weight: 800; }
h2 { font-size: clamp(28px, 3.6vw, 38px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
p  { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.center { text-align: center; margin-inline: auto; }
.muted { color: var(--muted); }

.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--primary);
  margin: 0 0 10px;
}

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

.skip {
  position: absolute; top: -60px; left: var(--gutter); z-index: 100;
  background: var(--primary); color: #fff; padding: 10px 18px;
  border-radius: 0 0 10px 10px; font-weight: 600;
  transition: top .2s ease;
}
.skip:focus { top: 0; }

/* ── Botones ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px;
  padding: 13px 22px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(17, 146, 201, .25); }
.btn-ghost   { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-light   { background: #fff; color: var(--navy); }
.btn-block   { width: 100%; }

/* ── Cabecera ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(10px)) {
  .site-header { background: var(--bg); }
}

.nav { display: flex; align-items: center; gap: 18px; height: var(--header-h); }

.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 21px; letter-spacing: -.02em; color: var(--ink);
  flex-shrink: 0;
}
.logo .valkrin-logo, .product-brand .valkrin-logo { width: 140px; height: auto; flex-shrink: 0; margin: 6px; }
@media (max-width: 680px) { .logo .valkrin-logo, .product-brand .valkrin-logo { width: 120px; } }

.nav-links {
  display: flex; gap: 24px; margin-inline-start: auto;
  font-size: 15px; font-weight: 500; color: var(--muted);
}
.nav-links a { transition: color .15s ease; }
.nav-links a:hover { color: var(--primary); }

.nav-right { display: flex; align-items: center; gap: 14px; margin-inline-start: 18px; }

.lang {
  display: inline-flex; border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden; font-size: 13px; font-weight: 700;
}
.lang a { padding: 6px 12px; color: var(--muted); transition: background-color .15s ease, color .15s ease; }
.lang a[aria-current="true"] { background: var(--primary); color: #fff; }

/* Botón hamburguesa (solo móvil) */
.nav-toggle {
  display: none; margin-inline-start: auto;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: ""; display: block; position: relative;
  width: 20px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-links, .nav-right .btn { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-right { margin-inline-start: 0; order: 2; }
  .nav-toggle { order: 3; margin-inline-start: 8px; }

  .nav-links.is-open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; inset-inline: 0; top: var(--header-h);
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px; box-shadow: var(--shadow);
  }
  .nav-links.is-open a {
    padding: 14px 0; border-bottom: 1px solid var(--line);
    font-size: 17px; color: var(--ink);
  }
  .nav-links.is-open a:last-child { border-bottom: 0; }
}

/* ── Secciones ──────────────────────────────────────────────────────────── */
section { padding: var(--sec-y) 0; border-top: 1px solid var(--line); }
.alt { background: var(--bg2); }
.sec-head { max-width: 44em; margin-bottom: 36px; }

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
@media (min-width: 561px) and (max-width: 900px) { .g4 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}

.ic-badge {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(17,146,201,.14), rgba(23,192,201,.14));
  color: var(--primary);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  padding: clamp(40px, 6vw, 64px) 0 var(--sec-y);
  border-top: 0;
  background: radial-gradient(1000px 460px at 88% -10%, rgba(23,192,201,.12), transparent 60%);
}
.hero-grid {
  display: grid; grid-template-columns: 1.02fr .98fr;
  gap: clamp(28px, 4vw, 48px); align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero .lead { font-size: clamp(17px, 2vw, 19px); color: var(--muted); max-width: 33em; margin-top: 14px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

.trust { display: flex; align-items: center; gap: 10px; margin-top: 22px; font-size: 14px; color: var(--muted); }
.trust .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }

.vidframe {
  position: relative; border-radius: 26px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  background: linear-gradient(180deg, #EEF5FA, #F7FBFD);
  aspect-ratio: 1 / 1;
}
.vidframe video { width: 100%; height: 100%; object-fit: cover; }

.vidcap {
  position: absolute; inset-inline-start: 16px; bottom: 14px;
  display: flex; align-items: center; gap: 9px;
  background: color-mix(in srgb, #fff 78%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--navy);
}
.vidcap .live {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(19,163,107,.5); }
  70%  { box-shadow: 0 0 0 10px rgba(19,163,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(19,163,107,0); }
}

/* ── El problema ────────────────────────────────────────────────────────── */
.stat .n {
  font-size: clamp(32px, 4vw, 40px); font-weight: 800;
  color: var(--navy); letter-spacing: -.03em; line-height: 1.1;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stat .n { color: var(--aqua); } }
.stat .l { color: var(--muted); font-size: 15px; }

.pend {
  display: inline-block; margin-top: 6px; padding: 2px 7px;
  font-size: 11px; font-weight: 700; border-radius: 6px;
  color: var(--warn); background: rgba(232,128,74,.12);
}

/* ── Cómo funciona ──────────────────────────────────────────────────────── */
.step-num { font-size: 13px; font-weight: 800; color: var(--aqua); letter-spacing: .1em; text-transform: uppercase; }
.card-test { margin-top: 20px; display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
@media (max-width: 640px) { .card-test { grid-template-columns: 1fr; } }
.tag {
  display: inline-block; margin-top: 10px; padding: 5px 12px;
  border-radius: 999px; background: rgba(17,146,201,.10);
  color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .04em;
}

/* ── Beneficios ─────────────────────────────────────────────────────────── */
.benefit { border-radius: var(--radius); padding: 28px; border: 1px solid var(--line); }
.benefit.ins {
  background: linear-gradient(150deg, #0B2233, #0E5A78);
  color: #EAF4FA; border-color: transparent; box-shadow: var(--shadow);
}
.benefit.ins h3 { color: #fff; }
.benefit ul { list-style: none; padding: 0; margin: 14px 0 0; }
.benefit li { position: relative; padding-inline-start: 26px; margin-bottom: 11px; }
.benefit li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 8px;
  width: 10px; height: 10px; border-radius: 3px; background: var(--aqua);
}
.benefit.ins li { color: #fff; }

/* ── Ficha técnica ──────────────────────────────────────────────────────── */
.specnums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
@media (max-width: 760px) { .specnums { grid-template-columns: repeat(2, 1fr); } }
.specnums .b {
  text-align: center; padding: 22px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.specnums .b .v { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; color: var(--navy); letter-spacing: -.03em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .specnums .b .v { color: var(--aqua); } }
.specnums .b .l { font-size: 13px; color: var(--muted); margin-top: 4px; }

.spec-wrap { overflow-x: auto; }
table.spec {
  width: 100%; border-collapse: collapse; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
table.spec td { padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 15px; }
table.spec tr td:first-child { color: var(--muted); }
table.spec tr td:last-child  { font-weight: 700; color: var(--navy); text-align: end; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) table.spec tr td:last-child { color: var(--ink); } }
table.spec tr:last-child td { border-bottom: 0; }

.nota-producto { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ── Aseguradoras (bloque oscuro) ───────────────────────────────────────── */
.dark {
  border-top: 0; color: #EAF4FA;
  background:
    radial-gradient(900px 420px at 88% 0%, rgba(23,192,201,.20), transparent 60%),
    linear-gradient(160deg, #071F30, #0B2233);
}
.dark h2 { color: #fff; font-size: clamp(30px, 4vw, 40px); }
.dark h3 { color: #fff; }
.dark .lead { color: #B9D4E2; font-size: clamp(16px, 2vw, 18px); max-width: 40em; }
.dark .eyebrow { color: var(--aqua); }

.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0; padding: 0; list-style: none; }
.chip {
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600;
}
.dark .panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 6px; }
@media (max-width: 900px) { .dark .panel { grid-template-columns: 1fr; } }
.dark .panel .card {
  background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14);
  box-shadow: none; color: #fff;
}
.dark .panel .card p { color: #C7DCE8; }
.dark .ic-badge { background: rgba(23,192,201,.18); color: var(--aqua); }

/* ── Confianza ──────────────────────────────────────────────────────────── */
.badges { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.logo-chip {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 20px; font-weight: 700; color: var(--muted);
}

/* ── Contacto ───────────────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 40px); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink); }
.field label .opt { font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17,146,201,.16);
}
.field textarea { resize: vertical; min-height: 110px; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--warn); }
.field .err { font-size: 13px; font-weight: 600; color: var(--warn); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

.consent { flex-direction: row; align-items: flex-start; gap: 10px; }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }
.consent label { font-weight: 500; font-size: 14px; color: var(--muted); }
.consent label a { color: var(--primary); text-decoration: underline; }

/* Honeypot: invisible para personas, presente para bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-msg { margin-top: 12px; padding: 12px 16px; border-radius: 12px; font-weight: 600; }
.form-msg.ok  { background: rgba(19,163,107,.12); color: var(--ok); }
.form-msg.err { background: rgba(232,128,74,.12); color: var(--warn); }

/* ── Pie ────────────────────────────────────────────────────────────────── */
.site-footer { background: var(--navy); color: #C7DCE8; padding: 46px 0 30px; }
.site-footer .logo { color: #fff; }
.foot-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.foot-grid p { max-width: 40em; font-size: 15px; }
.foot-grid h3 { color: #fff; font-size: 15px; }
.foot-legal { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; margin-top: 10px; list-style: none; padding: 0; }
.foot-legal a:hover { color: #fff; text-decoration: underline; }
.foot-note {
  font-size: 12px; color: #90AEC0; margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ── Aviso de cookies ───────────────────────────────────────────────────── */
.cookiebar {
  position: fixed; inset-inline: 16px; bottom: 16px; z-index: 80;
  max-width: 640px; margin-inline: auto;
  display: none; gap: 16px; align-items: center; flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; font-size: 14px; color: var(--muted);
}
.cookiebar.is-visible { display: flex; }
.cookiebar p { flex: 1 1 260px; margin: 0; }
.cookiebar a { color: var(--primary); text-decoration: underline; }

/* ── Utilidades ─────────────────────────────────────────────────────────── */
/* La CSP no permite estilos en linea (style-src 'self'), asi que los ajustes
   puntuales de espaciado y ancho viven aqui. */
.mt-s { margin-top: 12px; }
.mt-m { margin-top: 20px; }
.mt-l { margin-top: 28px; }
.mx-auto { margin-inline: auto; }
.text-center { text-align: center; }
.narrow { max-width: 640px; }
.narrow-w { max-width: 760px; }
.h-page { font-size: clamp(30px, 4vw, 42px); }
.h-ok { font-size: clamp(28px, 4vw, 40px); }
.ic-badge.is-lg { width: 64px; height: 64px; border-radius: 18px; margin-inline: auto; }
.err-block { margin: -8px 0 12px; }

/* ── Aparición al hacer scroll ──────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .btn:hover { transform: none; }
}

/* ── Impresión ──────────────────────────────────────────────────────────── */
@media print {
  .site-header, .cookiebar, .vidframe, .btn { display: none !important; }
  body { color: #000; background: #fff; }
  section { padding: 16px 0; border-top: 1px solid #ccc; }
}

/* ── Ilustración técnica del producto ───────────────────────────────────── */
.dib {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, #F7FBFD, #EDF4F9);
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dib {
    background: linear-gradient(170deg, #0E2532, #0B1E2A);
  }
}

.dib-svg { width: 100%; height: auto; display: block; }

.dib-tubo   { stroke: rgba(11, 34, 51, .22); stroke-width: 1; }
.dib-tuerca { fill: #9BB2C0; stroke: rgba(11, 34, 51, .25); stroke-width: 1; }
.dib-cuerpo { stroke: rgba(11, 34, 51, .3); stroke-width: 1; }
.dib-cara   { fill: rgba(255, 255, 255, .05); stroke: rgba(255, 255, 255, .13); stroke-width: 1; }
.dib-led    { fill: var(--ok); }

.dib-marca  { fill: #fff; font-size: 19px; font-weight: 800; letter-spacing: .14em; }
.dib-modelo { fill: #8FB6CB; font-size: 13px; font-weight: 600; letter-spacing: .04em; }

.dib-conducto { fill: rgba(23, 192, 201, .12); stroke: rgba(23, 192, 201, .3); stroke-width: 1; }
.dib-td       { fill: var(--aqua); }
.dib-haz      { fill: none; stroke: var(--aqua); stroke-width: 1.5; stroke-dasharray: 4 4; }

.dib-valvula      { fill: rgba(255, 255, 255, .12); stroke: var(--aqua); stroke-width: 2; }
.dib-valvula-paso { fill: var(--aqua); opacity: .55; }
.dib-motor        { fill: #9BB2C0; }

.dib-cota line { stroke: var(--muted); stroke-width: 1; }
.dib-cota text { fill: var(--ink); font-size: 13px; font-weight: 700; }
.dib-ref  line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.dib-ref  text { fill: var(--muted); font-size: 12px; font-weight: 600; }

.dib-pie {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.dib-conexion { font-weight: 700; color: var(--primary); }
