/* ==========================================================================
   HSG Design System
   Lenguaje de diseño: humanista-clínico (retícula, escala y patrones
   inspirados en Philips Healthcare), con identidad cromática de HSG.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Neutrales */
  --c-ink:        #15191E;
  --c-ink-soft:   #46525D;
  --c-ink-mute:   #616C76;
  --c-line:       #E4E9EC;
  --c-line-soft:  #EFF3F5;
  --c-surface:    #F6F8F9;
  --c-surface-2:  #EAEFF2;
  --c-white:      #FFFFFF;

  /* Marca HSG */
  --c-deep:       #013763;
  --c-deep-2:     #01253F;
  --c-primary:    #0A6ABF;
  --c-primary-dk: #07558F;
  --c-accent:     #00CDDA;

  /* Estado */
  --c-ok:         #15754F;
  --c-no:         #B4243A;

  /* Tipografía */
  --f-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI",
            Roboto, Helvetica, Arial, sans-serif;

  --t-display: clamp(2.5rem,  1.55rem + 3.8vw, 4rem);
  --t-h1:      clamp(2.125rem, 1.5rem + 2.5vw, 3rem);
  --t-h2:      clamp(1.75rem,  1.33rem + 1.7vw, 2.5rem);
  --t-h3:      clamp(1.375rem, 1.2rem + .7vw,  1.75rem);
  --t-h4:      1.25rem;
  --t-lead:    clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  --t-body:    1.0625rem;
  --t-small:   .9375rem;
  --t-micro:   .8125rem;
  --t-eyebrow: .875rem;

  --lh-tight: 1.06;
  --lh-head:  1.15;
  --lh-body:  1.6;

  /* Espaciado */
  --s-1:4px;  --s-2:8px;   --s-3:12px; --s-4:16px; --s-5:24px;
  --s-6:32px; --s-7:40px;  --s-8:48px; --s-9:64px; --s-10:80px;
  --s-11:96px; --s-12:120px;

  --section-y: clamp(64px, 7vw, 120px);

  /* Layout */
  --container: 1366px;
  --container-prose: 72ch;
  --gutter: 24px;
  --header-h: 72px;

  /* Radios */
  --r-pill: 999px;
  --r-card: 12px;
  --r-sm:   6px;

  /* Sombras */
  --sh-1: 0 1px 2px rgba(1,55,99,.05), 0 2px 8px rgba(1,55,99,.05);
  --sh-2: 0 4px 12px rgba(1,55,99,.07), 0 14px 34px rgba(1,55,99,.09);

  --ease: cubic-bezier(.2,.7,.3,1);
}

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

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

body {
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding: 0; list-style: none; }

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

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

/* --------------------------------------------------------------------------
   3. TIPOGRAFÍA
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: var(--lh-head);
  letter-spacing: -.02em;
  text-wrap: balance;
}

.t-display { font-size: var(--t-display); line-height: var(--lh-tight); letter-spacing: -.03em; }
h1, .t-h1   { font-size: var(--t-h1);   line-height: var(--lh-tight); letter-spacing: -.025em; }
h2, .t-h2   { font-size: var(--t-h2); }
h3, .t-h3   { font-size: var(--t-h3); }
h4, .t-h4   { font-size: var(--t-h4); letter-spacing: -.01em; }

.t-lead  { font-size: var(--t-lead);  line-height: 1.5; color: var(--c-ink-soft); }
.t-small { font-size: var(--t-small); }
.t-mute  { color: var(--c-ink-mute); }

/* Eyebrow: etiqueta corta sobre el titular */
.eyebrow {
  display: block;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: var(--s-3);
}
.on-dark .eyebrow { color: var(--c-accent); }

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 980px; }
.prose-width { max-width: var(--container-prose); }
.prose--center { margin-inline: auto; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * .6); }

/* Fondos de bloque completo */
.bg-surface { background: var(--c-surface); }
.bg-deep    { background: var(--c-deep); }
.bg-white   { background: var(--c-white); }

.on-dark { color: rgba(255,255,255,.88); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4, .on-dark strong { color: #fff; }
.on-dark .t-lead { color: rgba(255,255,255,.82); }
.on-dark a:not(.btn) { color: #fff; }

/* Retícula */
.grid { display: grid; gap: var(--s-6); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--sidebar { grid-template-columns: 1.15fr .85fr; align-items: center; gap: var(--s-10); }

@media (max-width: 960px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--sidebar { grid-template-columns: 1fr; gap: var(--s-7); }
}
@media (max-width: 620px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* Cabecera de sección */
.section-head {
  max-width: 760px;
  margin-inline: auto;
  margin-bottom: var(--s-9);
  text-align: center;
}
.section-head .t-lead { margin-top: var(--s-4); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--left { margin-inline: 0; text-align: left; }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

/* --------------------------------------------------------------------------
   5. BOTONES  (relleno = sin borde · fantasma = con borde)
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--c-primary);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 12px 28px;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .15s var(--ease);
}
.btn:hover { background: var(--c-primary-dk); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  color: var(--c-ink);
  border: 2px solid var(--c-ink);
  padding: 10px 26px;
}
.btn--ghost:hover { background: var(--c-ink); color: #fff; }

.on-dark .btn--ghost { color: #fff; border-color: rgba(255,255,255,.7); }
.on-dark .btn--ghost:hover { background: #fff; color: var(--c-deep); }

.btn--light { background: #fff; color: var(--c-deep); }
.btn--light:hover { background: rgba(255,255,255,.88); color: var(--c-deep); }
.on-dark .btn--light, .on-dark .btn--light:hover { color: var(--c-deep); }

.btn--lg { min-height: 56px; padding: 14px 34px; font-size: 1.0625rem; }
.btn--full { width: 100%; }

/* Enlace con flecha */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: none;
}
.link-arrow::after {
  content: "→";
  transition: transform .2s var(--ease);
}
.link-arrow:hover { text-decoration: underline; }
.link-arrow:hover::after { transform: translateX(4px); }

/* Botón circular de flecha (patrón de tarjeta) */
.arrow-dot {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--r-pill);
  background: var(--c-primary);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  flex: none;
  transition: background .2s var(--ease), transform .2s var(--ease);
}

/* --------------------------------------------------------------------------
   6. CABECERA
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  min-height: var(--header-h);
}
.site-logo { flex: none; display: flex; align-items: center; }
.site-logo svg { width: 150px; height: auto; }
.site-logo svg path { fill: var(--c-deep); }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: var(--s-6); }
.site-nav a {
  display: inline-block;
  padding: 6px 0;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--c-ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--c-primary); border-bottom-color: var(--c-primary); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--c-primary); border-bottom-color: var(--c-primary); }

.nav-toggle { display: none; align-items: center; gap: var(--s-2); margin-left: auto;
  font-weight: 700; font-size: .9375rem; }
.nav-toggle__bars { display: grid; gap: 4px; }
.nav-toggle__bars span { display: block; width: 22px; height: 2px; background: var(--c-ink); }

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: #fff; border-bottom: 1px solid var(--c-line);
    padding: var(--s-5) var(--gutter) var(--s-7);
    display: none; box-shadow: var(--sh-2);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a { padding: var(--s-4) 0; border-bottom: 1px solid var(--c-line-soft); font-size: 1.0625rem; }
}

/* --------------------------------------------------------------------------
   7. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--c-deep);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  /* Degradado decorativo (radiales de marca). Sin color de base opaco:
     así la imagen del hero (.hero__media, z-index:-2) queda visible debajo.
     El fondo sólido de respaldo lo aporta .hero { background: var(--c-deep) }
     cuando no hay imagen. */
  background:
    radial-gradient(90% 120% at 15% 0%, rgba(10,106,191,.45) 0%, transparent 60%),
    radial-gradient(70% 100% at 100% 100%, rgba(0,205,218,.18) 0%, transparent 65%);
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img, .hero__media video { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(1,37,63,.55) 0%, rgba(1,37,63,.80) 100%),
    rgba(1,37,63,.30);
}
.hero__inner {
  position: relative;
  padding-block: clamp(72px, 10vw, 148px);
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}
.hero__title { font-size: var(--t-display); line-height: var(--lh-tight); letter-spacing: -.03em; color: #fff; }
.hero__lead {
  margin-top: var(--s-5);
  max-width: 62ch;
  margin-inline: auto;
  font-size: var(--t-lead);
  line-height: 1.5;
  color: rgba(255,255,255,.85);
}
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-4); margin-top: var(--s-8); }

/* Hero compacto para páginas interiores */
.hero--page .hero__inner { padding-block: clamp(56px, 7vw, 104px); }
.hero--page .hero__title { font-size: var(--t-h1); }

/* --------------------------------------------------------------------------
   8. TARJETAS
   -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  height: 100%;
  padding: var(--s-7);
  background: var(--c-surface);
  border-radius: var(--r-card);
  color: inherit;
  text-decoration: none;
  transition: background .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
a.card:hover { background: var(--c-surface-2); text-decoration: none; transform: translateY(-3px); box-shadow: var(--sh-2); }

/* Sobre fondo de superficie, una tarjeta con ese mismo fondo es invisible:
   pasa a blanco con borde y una sombra suave que la despegue. */
.bg-surface .card:not(.card--outline) {
  background: #fff;
  border: 1px solid var(--c-line);
  box-shadow: var(--sh-1);
}
.bg-surface a.card:not(.card--outline):hover {
  background: #fff;
  border-color: var(--c-primary);
}
a.card:hover .arrow-dot { background: var(--c-primary-dk); transform: translateX(3px); }

.card__icon {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: var(--r-sm);
  background: var(--c-deep);
  margin-bottom: var(--s-2);
}
.card__icon svg { width: 28px; height: 28px; fill: #fff; }
.card__title { font-size: var(--t-h4); }
.card__text { font-size: var(--t-small); color: var(--c-ink-soft); }
.card__foot { margin-top: auto; padding-top: var(--s-4); display: flex; justify-content: flex-end; }

.card--outline { background: #fff; border: 1px solid var(--c-line); }
a.card--outline:hover { background: #fff; border-color: var(--c-primary); }

/* --------------------------------------------------------------------------
   9. CIFRAS / BANDA DE DATOS
   -------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s-8); text-align: center; }
.stat__num { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.stat__label { margin-top: var(--s-3); font-size: var(--t-small); color: rgba(255,255,255,.78); }
.bg-white .stat__label, .bg-surface .stat__label { color: var(--c-ink-soft); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; gap: var(--s-7); } }

/* Muro de logos */
.logo-wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--s-8) var(--s-9);
}
.logo-wall img {
  /* Los archivos miden 197x87: ese es su tamaño nativo, no los ampliamos más */
  width: 197px;
  max-width: 44vw;
  height: auto;
  filter: grayscale(1);
  opacity: .7;
  transition: filter .25s var(--ease), opacity .25s var(--ease);
}
.logo-wall img:hover { filter: none; opacity: 1; }

/* --------------------------------------------------------------------------
   10. LISTAS
   -------------------------------------------------------------------------- */
.list-check > li, .list-cross > li {
  position: relative;
  padding-left: 34px;
  margin-bottom: var(--s-4);
}
.list-check > li::before, .list-cross > li::before {
  position: absolute; left: 0; top: .1em;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: var(--r-pill);
  font-size: .75rem; font-weight: 700;
}
.list-check > li::before { content: "✓"; background: rgba(30,138,95,.12); color: var(--c-ok); }
.list-cross > li::before { content: "✕"; background: rgba(180,36,58,.10); color: var(--c-no); }
.on-dark .list-check > li::before { background: rgba(0,205,218,.18); color: var(--c-accent); }

.list-plain > li { margin-bottom: var(--s-3); }

/* --------------------------------------------------------------------------
   11. ACORDEÓN / FAQ
   -------------------------------------------------------------------------- */
.accordion { border-top: 1px solid var(--c-line); }
.accordion__item { border-bottom: 1px solid var(--c-line); }
.accordion__head {
  display: flex; align-items: flex-start; gap: var(--s-4);
  width: 100%; padding: var(--s-5) 0;
  font-size: var(--t-h4); font-weight: 700; line-height: 1.3;
  text-align: left; color: var(--c-ink);
}
.accordion__head::after {
  content: "+"; margin-left: auto; flex: none;
  font-size: 1.5rem; font-weight: 400; line-height: 1; color: var(--c-primary);
  transition: transform .25s var(--ease);
}
.accordion__item.is-open .accordion__head::after { transform: rotate(45deg); }
.accordion__panel { display: none; padding-bottom: var(--s-6); max-width: var(--container-prose); color: var(--c-ink-soft); }
.accordion__item.is-open .accordion__panel { display: block; }

/* --------------------------------------------------------------------------
   12. FORMULARIOS
   -------------------------------------------------------------------------- */
.field { margin-bottom: var(--s-5); }
.field label { display: block; margin-bottom: var(--s-2); font-size: var(--t-small); font-weight: 600; }
.input, .textarea, .select select {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  color: var(--c-ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.textarea { min-height: 130px; resize: vertical; }
.input:focus, .textarea:focus, .select select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(10,106,191,.15);
}
.input::placeholder, .textarea::placeholder { color: var(--c-ink-mute); }
.select { position: relative; }
.select::after {
  content: "▾"; position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%); pointer-events: none; color: var(--c-ink-mute);
}
.select select { appearance: none; }
.check { display: flex; align-items: flex-start; gap: var(--s-3); font-size: var(--t-small); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--c-primary); flex: none; }

.form-card { padding: var(--s-8); background: #fff; border-radius: var(--r-card); box-shadow: var(--sh-2); }

/* El formulario es bastante más alto que el texto que lo acompaña. En escritorio
   el texto se queda fijo bajo la cabecera mientras se rellena, en lugar de
   perderse por arriba. Por debajo de 961px las dos columnas ya se apilan. */
@media (min-width: 961px) {
  .banner__intro {
    position: sticky;
    top: calc(var(--header-h) + var(--s-8));
    align-self: start;
  }
}
@media (max-width: 620px) { .form-card { padding: var(--s-5); } }

/* --------------------------------------------------------------------------
   13. PIE
   -------------------------------------------------------------------------- */
.site-footer { background: var(--c-deep); color: rgba(255,255,255,.78); }
.site-footer a { color: rgba(255,255,255,.78); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer h3 { font-size: 1rem; color: #fff; margin-bottom: var(--s-4); letter-spacing: 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: var(--s-8); }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4);
  margin-top: var(--s-9); padding-top: var(--s-5);
  border-top: 1px solid rgba(255,255,255,.16);
  font-size: var(--t-micro);
}
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: var(--s-5); }

/* --------------------------------------------------------------------------
   14. MIGAS / BLOG / PROSA
   -------------------------------------------------------------------------- */
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); font-size: var(--t-micro); color: var(--c-ink-mute); margin-bottom: var(--s-5); }
.crumbs a { color: var(--c-ink-mute); }
.crumbs li + li::before { content: "/"; margin-right: var(--s-2); color: var(--c-line); }
.on-dark .crumbs, .on-dark .crumbs a { color: rgba(255,255,255,.7); }
.hero__inner .crumbs { justify-content: center; }

.post-card { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-card); overflow: hidden; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.post-card:hover { box-shadow: var(--sh-2); transform: translateY(-3px); }
.post-card__img { aspect-ratio: 16/10; width: 100%; object-fit: cover; }
.post-card__body { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-6); flex: 1; }
.post-card__title { font-size: var(--t-h4); }
.post-card__title a { color: var(--c-ink); text-decoration: none; }
.post-card__title a:hover { color: var(--c-primary); }
.tag {
  display: inline-block; padding: 4px 12px; border-radius: var(--r-pill);
  background: rgba(10,106,191,.10); color: var(--c-primary);
  font-size: var(--t-micro); font-weight: 600; letter-spacing: .02em;
}

.prose { max-width: var(--container-prose); }
.prose > * + * { margin-top: var(--s-5); }
.prose h2 { margin-top: var(--s-10); margin-bottom: calc(var(--s-4) * -1 + var(--s-5)); font-size: var(--t-h2); }
.prose h3 { margin-top: var(--s-8); font-size: var(--t-h3); }
.prose h2 + *, .prose h3 + * { margin-top: var(--s-4); }
.prose ul { list-style: disc; padding-left: 1.3em; }
.prose ol { list-style: decimal; padding-left: 1.3em; }
.prose li + li { margin-top: var(--s-2); }
.prose img { border-radius: var(--r-card); margin-block: var(--s-8); }
.prose blockquote {
  margin-block: var(--s-9);
  padding: var(--s-6) var(--s-7);
  background: var(--c-surface);
  border-left: 4px solid var(--c-primary);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--t-lead);
}
.prose blockquote > * + * { margin-top: var(--s-3); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.prose th, .prose td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-line); text-align: left; }
.prose th { background: var(--c-surface); font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--c-line); margin-block: var(--s-9); }

/* --------------------------------------------------------------------------
   15. UTILIDADES
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); }
.mt-10 { margin-top: var(--s-10); }
.mt-auto { margin-top: auto; }
.mb-4 { margin-bottom: var(--s-4); }
.mb-6 { margin-bottom: var(--s-6); }
.mb-8 { margin-bottom: var(--s-8); }
.mb-10 { margin-bottom: var(--s-10); }
.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-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 200;
  padding: var(--s-3) var(--s-5); background: var(--c-primary); color: #fff;
  border-radius: var(--r-sm); font-weight: 700;
}
.skip-link:focus { top: var(--s-4); }

/* Botón flotante de WhatsApp */
.wa-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: grid; place-items: center;
  width: 54px; height: 54px;
  border-radius: var(--r-pill);
  background: #25D366;
  box-shadow: var(--sh-2);
  transition: transform .2s var(--ease);
}
.wa-fab:hover { transform: scale(1.06); }
.wa-fab svg { width: 30px; height: 30px; fill: #fff; }
.wa-fab svg path { fill: #fff; }

/* Aparición suave */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   14. SOLICITUD DE ALTA
   -------------------------------------------------------------------------- */
.steps {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-bottom: var(--s-9); padding: 0; list-style: none;
  font-size: var(--t-small); font-weight: 600;
}
.steps__item {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  background: var(--c-surface); color: var(--c-ink-mute);
}
.steps__item > span {
  display: grid; place-items: center;
  width: 22px; height: 22px; flex: none;
  border-radius: var(--r-pill);
  background: var(--c-line); color: var(--c-ink-soft);
  font-size: var(--t-micro);
}
.steps__item.is-current { background: var(--c-deep); color: #fff; }
.steps__item.is-current > span { background: var(--c-accent); color: var(--c-deep-2); }
.steps__item.is-done { background: #E7F1EC; color: var(--c-ok); }
.steps__item.is-done > span { background: var(--c-ok); color: #fff; }

.alta__step { display: none; border: 0; padding: 0; margin: 0; }
.alta__step.is-active { display: block; }
.alta__step legend { padding: 0; }
.alta__nav {
  display: flex; flex-wrap: wrap; gap: var(--s-4);
  margin-top: var(--s-9); padding-top: var(--s-7);
  border-top: 1px solid var(--c-line);
}

.alta__msg { margin-top: var(--s-6); font-weight: 600; }
.alta__msg--no { color: var(--c-no); }
.alta__msg--wait { color: var(--c-ink-mute); }

.alta__done { max-width: var(--container-prose); }

/* Tarjetas de elección (autónomo / sociedad) */
.pick { position: relative; display: block; cursor: pointer; }
.pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick__body {
  display: block; height: 100%;
  padding: var(--s-7);
  border: 2px solid var(--c-line); border-radius: var(--r-card);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.pick__title { display: block; font-size: var(--t-h4); font-weight: 700; color: var(--c-ink); }
.pick__text { display: block; margin-top: var(--s-2); color: var(--c-ink-soft); }
.pick:hover .pick__body { border-color: var(--c-primary); }
.pick input:checked + .pick__body { border-color: var(--c-primary); background: var(--c-surface); }
.pick input:focus-visible + .pick__body { outline: 3px solid var(--c-accent); outline-offset: 2px; }

/* Lista de documentos */
.docs { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-8); }
.doc {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6);
  border: 1px solid var(--c-line); border-radius: var(--r-card);
  background: #fff;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.doc__info { min-width: 0; flex: 1 1 15rem; }
.doc__name { display: block; font-weight: 600; color: var(--c-ink); cursor: pointer; }
.doc__opt { font-weight: 400; color: var(--c-ink-mute); }
.doc__hint { margin-top: 2px; font-size: var(--t-small); color: var(--c-ink-mute); }
.doc__action { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.doc__input { position: absolute; opacity: 0; width: 0; height: 0; }
.doc__input:focus-visible + label { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.doc__state { font-size: var(--t-small); color: var(--c-ink-mute); }
.doc__state--ok { color: var(--c-ok); font-weight: 600; }
.doc__state--no { color: var(--c-no); font-weight: 600; }
.doc.is-done { border-color: var(--c-ok); background: #F4FAF7; }
.doc.is-busy { opacity: .7; }
.doc.is-missing { border-color: var(--c-no); }
@media (max-width: 620px) {
  .doc { flex-direction: column; align-items: stretch; }
  .doc__action { justify-content: space-between; }
}

.btn--sm { min-height: 40px; padding: 8px 20px; font-size: var(--t-small); }
.btn--ghost.btn--sm { padding: 6px 18px; }

.alta-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s-6); margin-bottom: var(--s-8);
  padding: var(--s-7);
  background: var(--c-deep); color: #fff;
  border-radius: var(--r-card);
}
.alta-cta h3 { color: #fff; }
.alta-cta p { color: rgba(255,255,255,.85); }

/* --------------------------------------------------------------------------
   15. CARRUSEL DE LOGOS
   -------------------------------------------------------------------------- */
/* Dos pasadas idénticas de la misma lista. La animación desplaza el carril
   justo la mitad, así que al reiniciar el fotograma coincide con el inicial y
   no se ve el corte. */
.marquee {
  overflow: hidden;
  /* Los logos se desvanecen en los bordes en vez de cortarse en seco */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 45s linear infinite;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: var(--s-10);
  padding: 0 calc(var(--s-10) / 2);
  margin: 0;
  list-style: none;
}
.marquee__group > li { flex: none; }
.marquee__group img {
  display: block;
  width: 197px;
  height: auto;
  filter: grayscale(1);
  opacity: .7;
  transition: filter .25s var(--ease), opacity .25s var(--ease);
}
.marquee__group img:hover { filter: none; opacity: 1; }

@keyframes marquee { to { transform: translateX(-50%); } }

/* Se detiene al pasar el ratón, para poder mirar un logo concreto */
.marquee:hover .marquee__track { animation-play-state: paused; }

/* En escritorio los logos crecen hasta donde da el archivo sin perder nitidez */
@media (min-width: 961px) {
  .marquee__group img { width: 240px; }
  .marquee__group { gap: var(--s-11); padding: 0 calc(var(--s-11) / 2); }
}

/* Sin animación para quien la ha desactivado: se puede desplazar a mano */
@media (prefers-reduced-motion: reduce) {
  .marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .marquee__track { animation: none; }
}

/* --------------------------------------------------------------------------
   16. DESTACADO, DIAGRAMA DE FLUJO Y LÍNEA DE TIEMPO
   -------------------------------------------------------------------------- */
/* Destacado tipográfico: rompe el ritmo de tarjetas sin añadir otra caja */
.pull {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  text-align: center;
}
.pull__text {
  /* El ancho va aquí, donde la fuente ya es grande: en .pull la unidad ch
     se calcularía sobre los 16px heredados y saldría una columna estrecha. */
  max-width: 20ch;
  margin-inline: auto;
  font-size: var(--t-h1);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--c-ink);
  text-wrap: balance;
}
.pull__text em { font-style: normal; color: var(--c-primary); }
.pull__foot {
  max-width: 46ch;
  margin-inline: auto;
  margin-top: var(--s-6);
  font-size: var(--t-lead);
  color: var(--c-ink-soft);
}

/* Diagrama del recorrido del dinero */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--s-4);
}
.flow__node {
  flex: 1 1 200px;
  padding: var(--s-6);
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  background: #fff;
}
.flow__node--mid { border-color: var(--c-primary); box-shadow: var(--sh-1); }
.flow__tag {
  display: block;
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.flow__text { margin-top: var(--s-3); color: var(--c-ink-soft); }
.flow__node--mid .flow__text strong { color: var(--c-ink); }
.flow__link {
  flex: 0 1 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  text-align: center;
}
.flow__label { font-size: var(--t-micro); color: var(--c-ink-mute); line-height: 1.3; }
.flow__arrow { font-size: 1.5rem; color: var(--c-accent); line-height: 1; }
.flow__nota {
  max-width: 62ch;
  margin-top: var(--s-7);
  padding-left: var(--s-5);
  border-left: 3px solid var(--c-accent);
  color: var(--c-ink-soft);
}
@media (max-width: 860px) {
  .flow { flex-direction: column; }
  .flow__link { flex: none; }
  .flow__arrow { transform: rotate(90deg); }
}

/* Línea de tiempo numerada: cuatro pasos sin cuatro cajas iguales */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-7);
  counter-reset: paso;
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline__item {
  position: relative;
  counter-increment: paso;
  padding-top: var(--s-8);
}
/* La línea que une los pasos */
.timeline__item::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 0;
  right: calc(var(--s-7) * -1);
  height: 2px;
  background: var(--c-line);
}
.timeline__item:last-child::before { right: 0; }
.timeline__item::after {
  content: counter(paso);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--c-deep);
  color: #fff;
  font-size: var(--t-small);
  font-weight: 700;
}
.timeline__title { font-size: var(--t-h4); }
.timeline__text { margin-top: var(--s-3); color: var(--c-ink-soft); font-size: var(--t-small); }
@media (max-width: 860px) {
  .timeline { grid-template-columns: 1fr; gap: var(--s-6); }
  .timeline__item { padding-top: 0; padding-left: 56px; }
  .timeline__item::before { top: 36px; bottom: calc(var(--s-6) * -1); left: 17px; right: auto; width: 2px; height: auto; }
  .timeline__item:last-child::before { display: none; }
}

/* --------------------------------------------------------------------------
   17. SIMULADOR DE CUOTA
   -------------------------------------------------------------------------- */
.sim {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: var(--s-8);
  align-items: start;
}
.sim__controls {
  display: flex;
  flex-direction: column;
  gap: var(--s-7);
  padding: var(--s-7);
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
}
.sim__field { display: grid; gap: var(--s-2); }
.sim__field label { font-weight: 600; color: var(--c-ink); }
.sim__value {
  font-size: var(--t-h3);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--c-primary);
}
.sim__hint { font-size: var(--t-small); color: var(--c-ink-mute); }

.sim input[type="range"] {
  width: 100%;
  height: 6px;
  margin: var(--s-2) 0;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.sim input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 26px; height: 26px;
  border: 3px solid #fff;
  border-radius: var(--r-pill);
  background: var(--c-primary);
  box-shadow: var(--sh-1);
}
.sim input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border: 3px solid #fff;
  border-radius: var(--r-pill);
  background: var(--c-primary);
}
.sim input[type="range"]:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 4px; }

.sim__tae { display: flex; align-items: center; gap: var(--s-2); }
.sim__tae .input { max-width: 7rem; }
.sim__tae span { font-weight: 600; color: var(--c-ink-soft); }

.sim__out {
  padding: var(--s-7);
  border-radius: var(--r-card);
  background: var(--c-deep);
  color: rgba(255,255,255,.88);
}
.sim__out-label {
  display: block;
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.sim__cuota {
  margin-top: var(--s-2);
  font-size: clamp(2.5rem, 1.6rem + 3.4vw, 3.75rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: #fff;
}
.sim__detalle {
  margin: var(--s-7) 0 0;
  padding-top: var(--s-5);
  border-top: 1px solid rgba(255,255,255,.18);
  font-size: var(--t-small);
}
.sim__detalle > div {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-2) 0;
}
.sim__detalle dt { color: rgba(255,255,255,.72); margin: 0; }
.sim__detalle dd { margin: 0; font-weight: 700; color: #fff; }
.sim__aviso {
  margin-top: var(--s-6);
  font-size: var(--t-micro);
  line-height: 1.5;
  color: rgba(255,255,255,.65);
}
.sim__aviso a { color: #fff; }

@media (max-width: 860px) { .sim { grid-template-columns: 1fr; } }
