/* ============ TOKENS ============ */
:root {
  --red: #e3322b;
  --red-deep: #b51f1b;
  --navy: #002860;
  --navy-2: #06163a;
  --ink: #080d1c;
  --ink-2: #111830;
  --paper: #f4f1ec;
  --paper-2: #e9e4dc;
  --yellow: #ffc20e;
  --real: #0a5bb0;
  --ath: #d5162b;
  --white: #fff;
  --muted: rgba(255, 255, 255, .62);
  --muted-dark: rgba(8, 13, 28, .6);

  --f-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --f-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;

  --gutter: clamp(16px, 4vw, 56px);
  --radius: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--yellow); color: var(--ink); }
body.is-loading { overflow: hidden; }

/* ============ TIPOGRAFÍA ============ */
.wrap { padding-inline: var(--gutter); max-width: 1480px; margin-inline: auto; }
.kicker {
  display: inline-flex; align-items: center; gap: .7em;
  font: 600 12px/1 var(--f-body); letter-spacing: .18em; text-transform: uppercase;
  color: var(--red); margin-bottom: 22px;
}
.kicker::before { content: ''; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--yellow); }
.kicker--light { color: var(--white); }
.h2 {
  font: 700 clamp(40px, 6.4vw, 104px)/.95 var(--f-display);
  letter-spacing: -.035em;
  font-variation-settings: 'opsz' 96;
}
.h3 { font: 700 clamp(28px, 3.4vw, 50px)/1 var(--f-display); letter-spacing: -.03em; }
.h2 em, .h3 em, .hero__title em {
  font-family: var(--f-serif); font-style: italic; font-weight: 400;
  letter-spacing: -.01em; color: var(--yellow);
}
[data-theme="light"] .h2 em, [data-theme="light"] .h3 em { color: var(--red); }
.lead { font-size: clamp(17px, 1.35vw, 21px); line-height: 1.5; max-width: 38ch; color: var(--muted-dark); }
[data-theme="dark"] .lead, [data-theme="red"] .lead { color: var(--muted); }
.mini { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }

/* ============ ICONOS Y BOTONES ============ */
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i--fill { fill: currentColor; stroke: none; }

.btn {
  --bg: var(--ink); --fg: var(--white);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 18px 28px; border-radius: 999px; overflow: hidden; isolation: isolate;
  background: var(--bg); color: var(--fg);
  font: 600 15px/1 var(--f-body); letter-spacing: -.005em; white-space: nowrap;
  transition: color .4s var(--ease);
}
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--hover, var(--yellow));
  transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn:hover::after, .btn:focus-visible::after { transform: none; }
.btn:hover, .btn:focus-visible { color: var(--hover-fg, var(--ink)); }
.btn .i { transition: transform .4s var(--ease); }
.btn:hover .i { transform: translateX(4px); }
.btn--red { --bg: var(--red); }
.btn--dark { --bg: var(--ink); }
.btn--yellow { --bg: var(--yellow); --fg: var(--ink); --hover: var(--white); }
.btn--white { --bg: var(--white); --fg: var(--ink); }
.btn--glass { --bg: rgba(255, 255, 255, .12); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); --hover: var(--white); }
.btn--sm { padding: 13px 20px; font-size: 14px; }
.btn--full { width: 100%; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* ============ PRELOADER ============ */
.loader {
  position: fixed; inset: 0; z-index: 1000; background: var(--paper);
  display: grid; place-items: center; color: var(--ink);
}
.loader__inner { display: grid; justify-items: center; gap: 22px; }
.loader__mark { width: min(240px, 50vw); clip-path: inset(0 100% 0 0); }
.loader__year { font: 800 clamp(64px, 12vw, 160px)/.8 var(--f-display); letter-spacing: -.05em; overflow: hidden; font-variant-numeric: tabular-nums; }
.loader__year span { display: block; }
.loader__tag { font: 600 12px/1 var(--f-body); letter-spacing: .3em; text-transform: uppercase; color: var(--red); }
.loader__bar { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 40px; height: 2px; background: var(--paper-2); }
.loader__bar i { display: block; height: 100%; width: 100%; background: var(--red); transform-origin: left; transform: scaleX(0); }

/* ============ CURSOR ============ */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 999; pointer-events: none;
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--yellow); mix-blend-mode: difference;
  display: grid; place-items: center; opacity: 0;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .3s;
}
.cursor__label { font: 700 11px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); opacity: 0; transition: opacity .2s; }
.cursor.is-hover { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.cursor.is-label { width: 96px; height: 96px; margin: -48px 0 0 -48px; mix-blend-mode: normal; }
.cursor.is-label .cursor__label { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ============ PROGRESO ============ */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; pointer-events: none; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--yellow)); transform-origin: left; transform: scaleX(0); }

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 110;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-block: 18px;
  /* En monitores anchos se alinea con el contenido (máx. 1480 px) en vez de pegarse al borde */
  padding-inline: max(var(--gutter), calc((100% - 1480px) / 2 + var(--gutter)));
  color: var(--white);
  transition: color .4s, background .4s, padding .4s var(--ease), transform .5s var(--ease);
}
.nav.is-scrolled { padding-block: 10px; background: rgba(8, 13, 28, .55); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.nav.is-light { color: var(--ink); }
.nav.is-light.is-scrolled { background: rgba(244, 241, 236, .75); }
.nav.is-hidden { transform: translateY(-110%); }
/* Sin placa (el usuario la prefiere así). Las dos versiones llevan la M azul: sobre fondo oscuro solo pasan a blanco
   el texto y el perfilado (logo-nav.png); sobre las secciones claras va el logo original. */
.nav__logo { position: relative; display: block; width: 180px; flex: none; }
.nav__marca { position: relative; display: block; }
.nav__logo img { display: block; width: 100%; height: auto; transition: opacity .4s; }
.nav__logo--light { position: absolute; inset: 0; opacity: 0; }
/* La franja del logo como texto legible: pastilla roja con letras blancas, se lee sobre vídeo y sobre claro */
.nav__lema { display: block; margin-top: 5px; padding: 3px 0 2px; background: var(--red); color: var(--white); font: 700 10.5px/1.2 var(--f-body); letter-spacing: .1em; text-transform: uppercase; text-align: center; white-space: nowrap; border-radius: 2px; }
/* Acceso a la zona de clientes (mismas claves que la app) */
.nav__clientes { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 14px; font-weight: 600; border-radius: 999px; box-shadow: inset 0 0 0 1px currentColor; transition: background .3s; white-space: nowrap; }
.nav__clientes:hover { background: rgba(127, 127, 127, .16); }
.nav__clientes .i { width: 18px; height: 18px; }
.nav.is-light .nav__logo--light { opacity: 1; }
.nav.is-light .nav__logo--dark { opacity: 0; }
.nav__links { display: flex; gap: 4px; }
.nav__links a { position: relative; padding: 10px 14px; font-size: 14px; font-weight: 500; border-radius: 999px; transition: background .3s; }
.nav__links a:hover { background: rgba(127, 127, 127, .16); }
.nav__links a.is-active::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--yellow); }
.nav__right { display: flex; align-items: center; gap: 12px; }

.lang { position: relative; display: flex; padding: 4px; border-radius: 999px; box-shadow: inset 0 0 0 1px currentColor; }
.lang button { position: relative; z-index: 1; width: 42px; height: 32px; font: 700 12px/1 var(--f-body); letter-spacing: .08em; border-radius: 999px; transition: color .4s; }
.lang button[aria-pressed="true"] { color: var(--ink); }
.lang__pill { position: absolute; top: 4px; left: 4px; width: 42px; height: 32px; border-radius: 999px; background: var(--yellow); transition: transform .5s var(--ease); }
.lang[data-active="eu"] .lang__pill { transform: translateX(42px); }

.burger { display: none; width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px currentColor; position: relative; }
.burger span:not(.sr) { position: absolute; left: 13px; right: 13px; height: 2px; background: currentColor; transition: transform .4s var(--ease); }
.burger span:nth-child(1) { top: 18px; }
.burger span:nth-child(2) { top: 24px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

.menu { position: fixed; inset: 0; z-index: 105; background: var(--red); color: var(--white); display: grid; align-items: end; padding: 120px var(--gutter) 48px; }
.menu nav { display: grid; gap: 6px; }
.menu a { font: 700 clamp(38px, 11vw, 64px)/1 var(--f-display); letter-spacing: -.04em; }

.menu a.menu__clientes { margin-top: 18px; font: 600 20px/1.2 var(--f-body); letter-spacing: 0; text-decoration: underline; text-underline-offset: 5px; }

/* Con los enlaces a la vista no cabe el texto: solo el icono */
@media (max-width: 1440px) and (min-width: 1101px) {
  .nav__clientes { padding: 10px; }
  .nav__clientes span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 1100px) {
  .nav__links { display: none; }
  .burger { display: block; }
}
@media (max-width: 560px) {
  .nav .btn--sm, .nav__clientes { display: none; }
  .nav__logo { width: 150px; }
  .nav__lema { font-size: 8.5px; letter-spacing: .06em; }
}

/* ============ WHATSAPP FLOTANTE ============ */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: #25d366; color: var(--white); box-shadow: 0 12px 30px -8px rgba(37, 211, 102, .6);
  transform: scale(0); transition: transform .5s var(--ease);
}
.wa-float.is-visible { transform: scale(1); }
.wa-float:hover { transform: scale(1.08) rotate(-8deg); }
.wa-float svg { width: 28px; height: 28px; fill: currentColor; }

/* ============ LIGHTBOX ============ */
.lightbox { position: fixed; inset: 0; z-index: 900; background: rgba(4, 7, 16, .94); display: grid; place-items: center; padding: 72px var(--gutter) 24px; }
.lightbox video { max-height: calc(100vh - 110px); max-width: 100%; border-radius: 16px; background: #000; }
.lightbox__close { position: absolute; top: 18px; right: var(--gutter); display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }

/* ============ MODAL (campos propios de un seguro, dentro del formulario de #contacto) ============ */
.modal { position: fixed; inset: 0; z-index: 900; background: rgba(4, 7, 16, .7); display: grid; place-items: center; padding: 24px var(--gutter); overflow-y: auto; }
.modal__panel { position: relative; width: 100%; max-width: 480px; margin-block: auto; padding: clamp(28px, 4vw, 40px); border-radius: 28px; background: var(--paper); color: var(--ink); box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .55); }
.modal__close { position: absolute; top: 16px; right: 16px; display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 13px; padding: 9px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(8, 13, 28, .16); }
.modal__close span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.modal__titulo { font: 800 24px/1.1 var(--f-display); letter-spacing: -.03em; margin: 2px 40px 20px 0; }
.modal__campos { display: grid; gap: 12px; }

/* ============ MOVIMIENTO REDUCIDO ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
