/* ==========================================================================
   PURIAN · Sistema de diseño del sitio público
   70% banca privada · 30% fintech. Azul noche + dorado champagne.
   CSS nativo moderno: @layer, custom properties, nesting, container queries.
   ========================================================================== */

@layer reset, tokens, base, layout, components, sections, utilities;

/* ── Tipografías auto-hospedadas ───────────────────────────────────────── */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("../fonts/cormorant-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("../fonts/cormorant-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("../fonts/cormorant-500-italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: none; text-size-adjust: none; }
  body { min-height: 100dvh; line-height: 1.6; -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; }
  img, svg, video { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  p, h1, h2, h3, h4 { overflow-wrap: break-word; }
  h1, h2, h3, h4 { text-wrap: balance; line-height: 1.1; }
  p { text-wrap: pretty; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
}

@layer tokens {
  :root {
    /* Color */
    --navy-950: #070d1a;
    --navy-900: #0b1424;
    --navy-850: #0f1b30;
    --navy-800: #13223b;
    --navy-700: #1c2f4f;
    --navy-600: #2a4068;
    --gold-300: #ead9b5;
    --gold-400: #d9c08f;
    --gold-500: #c6a76b;
    --gold-600: #a98a51;
    --ivory: #f7f4ee;
    --ivory-2: #efeae0;
    --white: #ffffff;
    --ink: #0e1626;
    --ink-2: #3b4658;
    --ink-3: #6b7587;
    --line-light: #e3ddd1;
    --line-dark: rgb(255 255 255 / 0.09);
    --electric: #5b8cff;
    --success: #2f9e6e;
    --danger: #c0392b;

    /* Tipografía */
    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Cormorant", "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --fs-xs: 0.78rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    --fs-2xl: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
    --fs-3xl: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);
    --fs-hero: clamp(2.75rem, 1.8rem + 4.2vw, 5.25rem);

    /* Espaciado y forma */
    --space-section: clamp(4.5rem, 3rem + 6vw, 8.5rem);
    --container: 1200px;
    --gutter: clamp(1.25rem, 0.75rem + 2vw, 2.5rem);
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow-soft: 0 1px 2px rgb(14 22 38 / 0.04), 0 12px 32px -12px rgb(14 22 38 / 0.12);
    --shadow-lift: 0 2px 4px rgb(14 22 38 / 0.04), 0 24px 48px -16px rgb(14 22 38 / 0.22);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --header-h: 84px;
  }
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); color-scheme: light; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  }
  body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    color: var(--ink);
    background: var(--ivory);
    font-feature-settings: "ss01", "cv11";
  }
  h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
  h2 { font-size: var(--fs-3xl); }
  h3 { font-size: var(--fs-xl); }
  h4 { font-weight: 600; font-size: var(--fs-base); }
  a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
  :focus-visible { outline: 2px solid var(--gold-500); outline-offset: 3px; border-radius: 4px; }
  ::selection { background: var(--gold-300); color: var(--navy-900); }
  .icon {
    width: 1.25em; height: 1.25em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  }
}

@layer layout {
  .container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
  .container--narrow { --container: 820px; }
  .section { padding-block: var(--space-section); position: relative; }
  .section--tight { padding-block: calc(var(--space-section) * 0.6); }
  .section--dark { background: var(--navy-900); color: var(--ivory); }
  .section--deep { background: var(--navy-950); color: var(--ivory); }
  .section--white { background: var(--white); }
  .section--ivory2 { background: var(--ivory-2); }
  .grid { display: grid; gap: clamp(1rem, 0.5rem + 1.5vw, 2rem); }
  .grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
  .grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
  .grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
  .split { display: grid; gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; grid-template-columns: 1fr; }
  @media (min-width: 960px) {
    .split { grid-template-columns: 1fr 1fr; }
    .split--form { grid-template-columns: 5fr 6fr; }
    .split--center { align-items: center; }
  }
  .stack > * + * { margin-top: var(--stack, 1rem); }
}

/* ==========================================================================
   Componentes
   ========================================================================== */
@layer components {

  /* ── Skip link ── */
  .skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 100;
    background: var(--gold-500); color: var(--navy-950); padding: 0.6rem 1rem; border-radius: var(--radius-sm);
    &:focus { top: 1rem; }
  }

  /* ── Marca ── */
  .brand {
    display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1; gap: 0.35rem;
    & .brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.65rem; letter-spacing: 0.32em; margin-right: -0.32em; }
    & .brand__tag { white-space: nowrap; font-size: 0.56rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold-400); font-weight: 500; }
  }
  .brand__logo {
    --logo-w: 190px;
    display: inline-grid; justify-items: center; gap: 0.3rem; width: max-content;
    & img { display: block; width: var(--logo-w); height: auto; }
    & .brand__slogan {
      display: flex; align-items: center; gap: 0.5rem; white-space: nowrap;
      font-family: var(--font-sans); font-size: calc(var(--logo-w) * 0.05); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-400);
      &::before, &::after { content: ""; width: 1.1em; height: 1px; background: currentColor; opacity: 0.8; }
    }
  }
  .brand--sm .brand__logo { --logo-w: 168px; }
  .brand--lg .brand__logo { --logo-w: 250px; }

  /* ── Botones ── */
  .btn {
    --btn-bg: var(--gold-500);
    --btn-fg: var(--navy-950);
    --btn-bd: var(--gold-500);
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
    padding: 0.85rem 1.5rem; min-height: 48px;
    background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
    border-radius: 999px; font-weight: 550; font-size: var(--fs-sm); letter-spacing: 0.02em;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
    & .icon { transition: transform 0.25s var(--ease); }
    &:hover { --btn-bg: var(--gold-400); --btn-bd: var(--gold-400); box-shadow: 0 10px 30px -10px rgb(198 167 107 / 0.6); }
    &:hover .icon--move { transform: translateX(3px); }
    &:active { transform: translateY(1px); }
    &[disabled] { opacity: 0.6; cursor: progress; }
  }
  .btn--ghost { --btn-bg: transparent; --btn-fg: currentColor; --btn-bd: currentColor;
    &:hover { --btn-bg: rgb(198 167 107 / 0.12); --btn-bd: var(--gold-500); --btn-fg: inherit; box-shadow: none; }
  }
  .btn--navy { --btn-bg: var(--navy-900); --btn-fg: var(--ivory); --btn-bd: var(--navy-900);
    &:hover { --btn-bg: var(--navy-700); --btn-bd: var(--navy-700); box-shadow: var(--shadow-soft); }
  }
  .btn--whatsapp { --btn-bg: #1f8f5f; --btn-fg: #fff; --btn-bd: #1f8f5f;
    &:hover { --btn-bg: #18774e; --btn-bd: #18774e; box-shadow: none; }
  }
  .btn--sm { padding: 0.55rem 1.1rem; min-height: 40px; }
  .btn--block { width: 100%; }

  .link-arrow {
    display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 550; font-size: var(--fs-sm);
    text-decoration: none; color: var(--gold-600); letter-spacing: 0.02em;
    & .icon { transition: transform 0.25s var(--ease); }
    &:hover .icon { transform: translateX(4px); }
    .section--dark &, .section--deep & { color: var(--gold-400); }
  }

  /* ── Encabezados de sección ── */
  .eyebrow {
    display: inline-flex; align-items: center; gap: 0.75rem;
    font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-600);
    &::before { content: ""; width: 28px; height: 1px; background: currentColor; }
    .section--dark &, .section--deep &, .hero &, .page-hero & { color: var(--gold-400); }
  }
  .section-head {
    max-width: 720px; margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
    & h2 { font-size: var(--fs-3xl); margin-top: 1rem; }
    & p { margin-top: 1.1rem; font-size: var(--fs-lg); color: var(--ink-2); }
    .section--dark & p, .section--deep & p { color: rgb(247 244 238 / 0.72); }
  }
  .section-head--center { margin-inline: auto; text-align: center; & .eyebrow { justify-content: center; } }
  .section-head--row {
    max-width: none; display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: end; justify-content: space-between;
    & > div { max-width: 680px; }
  }
  .lead { font-size: var(--fs-lg); color: var(--ink-2);
    .section--dark &, .section--deep & { color: rgb(247 244 238 / 0.72); }
  }
  em.accent { font-style: italic; color: var(--gold-500); }

  /* ── Badges ── */
  .badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.7rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
    background: rgb(198 167 107 / 0.14); color: var(--gold-600); border: 1px solid rgb(198 167 107 / 0.35);
    .section--dark &, .section--deep &, .page-hero & { color: var(--gold-300); }
  }
  .badge--soon::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2.2s infinite; }
  @keyframes pulse { 50% { opacity: 0.3; } }

  /* ── Cabecera ── */
  .site-header {
    position: sticky; top: 0; z-index: 50; height: var(--header-h);
    color: var(--ivory);
    background: rgb(7 13 26 / 0.82);
    backdrop-filter: saturate(150%) blur(16px);
    -webkit-backdrop-filter: saturate(150%) blur(16px);
    border-bottom: 1px solid var(--line-dark);
    & .container { height: 100%; display: flex; align-items: center; gap: 1.5rem; }
  }
  .nav { display: none; margin-inline: auto; }
  .nav__list { display: flex; gap: 0.25rem; list-style: none; padding: 0; }
  .nav__link {
    display: block; padding: 0.5rem 0.55rem; font-size: var(--fs-sm); white-space: nowrap;
    @media (min-width: 1440px) { padding-inline: 0.7rem; } text-decoration: none; color: rgb(247 244 238 / 0.75);
    border-radius: 999px; transition: color 0.2s, background 0.2s;
    &:hover { color: var(--white); background: rgb(255 255 255 / 0.05); }
    &[aria-current="page"] { color: var(--gold-400); }
  }
  .header-actions { display: none; align-items: center; gap: 0.6rem; margin-left: auto; }
  .header-actions .btn { min-height: 40px; padding: 0.5rem 1.1rem; }
  .menu-toggle {
    margin-left: auto; display: grid; place-items: center; width: 44px; height: 44px;
    background: transparent; border: 1px solid var(--line-dark); border-radius: 50%; color: inherit; cursor: pointer;
  }
  @media (min-width: 1340px) {
    .nav, .header-actions { display: flex; }
    .header-actions { margin-left: 0; }
    .menu-toggle { display: none; }
  }

  /* Menú móvil (Popover API nativa) */
  .mobile-nav {
    inset: 0 0 0 auto; width: min(100%, 420px); height: 100dvh; max-height: none; margin: 0;
    padding: 1.5rem var(--gutter) 2rem; border: 0;
    background: var(--navy-950); color: var(--ivory);
    display: none; flex-direction: column; gap: 2rem;
    &:popover-open { display: flex; animation: slide-in 0.35s var(--ease); }
    &::backdrop { background: rgb(7 13 26 / 0.6); backdrop-filter: blur(4px); }
    & ul { list-style: none; padding: 0; display: grid; }
    & a:not(.btn) { display: block; padding: 0.9rem 0; font-family: var(--font-display); font-size: 1.6rem; text-decoration: none; border-bottom: 1px solid var(--line-dark); }
    & .mobile-nav__top { display: flex; justify-content: space-between; align-items: center; }
    & .mobile-nav__actions { display: grid; gap: 0.75rem; margin-top: auto; }
  }
  @keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }

  /* ── Tarjetas ── */
  .card {
    position: relative; display: flex; flex-direction: column; gap: 0.85rem;
    padding: clamp(1.5rem, 1.2rem + 1vw, 2.2rem);
    background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius-lg);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
    & h3 { font-size: var(--fs-xl); font-family: var(--font-display); font-weight: 600; }
    & p { color: var(--ink-2); font-size: 0.95rem; }
    & .card__icon {
      display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
      background: var(--navy-900); color: var(--gold-400);
      & .icon { width: 24px; height: 24px; }
    }
    & .card__foot { margin-top: auto; padding-top: 0.5rem; }
    &.card--link:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: rgb(198 167 107 / 0.5); }
    & a.card__cover { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
    .section--dark &, .section--deep & {
      background: rgb(255 255 255 / 0.03); border-color: var(--line-dark); color: var(--ivory);
      & p { color: rgb(247 244 238 / 0.7); }
      & .card__icon { background: rgb(198 167 107 / 0.12); }
      &.card--link:hover { background: rgb(255 255 255 / 0.05); border-color: rgb(198 167 107 / 0.45); box-shadow: none; }
    }
  }

  /* ── Listas con check ── */
  .checklist {
    list-style: none; padding: 0; display: grid; gap: 0.85rem;
    & li { display: grid; grid-template-columns: auto 1fr; gap: 0.85rem; align-items: start; }
    & .icon { color: var(--gold-500); margin-top: 0.2rem; }
    & strong { display: block; font-weight: 600; }
    & span { color: var(--ink-2); font-size: 0.95rem; }
    .section--dark & span, .section--deep & span { color: rgb(247 244 238 / 0.7); }
  }

  /* ── Formularios ── */
  .form-card {
    background: var(--white); color: var(--ink); border-radius: var(--radius-lg); border: 1px solid var(--line-light);
    padding: clamp(1.5rem, 1rem + 2vw, 2.75rem); box-shadow: var(--shadow-lift);
    & h3 { font-size: var(--fs-2xl); }
    & .form-card__intro { color: var(--ink-3); margin-top: 0.4rem; font-size: 0.95rem; }
  }
  .form-grid { display: grid; gap: 1.1rem 1rem; grid-template-columns: 1fr; margin-top: 1.75rem;
    @media (min-width: 640px) { grid-template-columns: 1fr 1fr; }
  }
  .field { display: grid; gap: 0.4rem; align-content: start;
    &.field--full { grid-column: 1 / -1; }
    & > label, & > .field__label { font-size: var(--fs-sm); font-weight: 550; color: var(--ink); }
    & .req { color: var(--gold-600); }
    & .field__error { color: var(--danger); font-size: var(--fs-xs); font-weight: 500; }
  }
  .input, .select, .textarea {
    width: 100%; min-height: 48px; padding: 0.7rem 0.95rem;
    background: var(--ivory); border: 1px solid var(--line-light); border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    &:hover { border-color: #cfc6b5; }
    &:focus { outline: none; border-color: var(--gold-500); background: var(--white); box-shadow: 0 0 0 4px rgb(198 167 107 / 0.18); }
    &[aria-invalid="true"] { border-color: var(--danger); }
    &::placeholder { color: #a3a9b4; }
  }
  .select {
    appearance: none; padding-right: 2.5rem; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
    background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%;
    background-size: 5px 5px; background-repeat: no-repeat;
  }
  .textarea { min-height: 120px; resize: vertical; field-sizing: content; }
  .choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .choice {
    position: relative; display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
    padding: 0.6rem 1rem; border: 1px solid var(--line-light); border-radius: 999px; background: var(--ivory);
    font-size: var(--fs-sm); transition: all 0.2s;
    & input { position: absolute; opacity: 0; pointer-events: none; }
    &:hover { border-color: var(--gold-500); }
    &:has(input:checked) { background: var(--navy-900); color: var(--ivory); border-color: var(--navy-900); }
    &:has(input:focus-visible) { outline: 2px solid var(--gold-500); outline-offset: 2px; }
  }
  .choices--cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    & .choice { border-radius: var(--radius-sm); padding: 0.9rem 1rem; }
  }
  .consent {
    display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer;
    & input { width: 18px; height: 18px; margin-top: 0.15rem; accent-color: var(--navy-900); }
  }
  .form-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1.75rem;
    & small { color: var(--ink-3); font-size: var(--fs-xs); display: inline-flex; align-items: center; gap: 0.4rem; }
  }
  .alert {
    display: flex; gap: 0.75rem; align-items: start; padding: 0.9rem 1.1rem; border-radius: var(--radius-sm);
    background: #fbeeee; color: #7c241b; border: 1px solid #f1cdc9; font-size: var(--fs-sm); margin-top: 1.25rem;
  }
  .hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

  /* ── Pie ── */
  .site-footer {
    background: var(--navy-950); color: rgb(247 244 238 / 0.7); padding-block: 4.5rem 2rem; font-size: var(--fs-sm);
    & a { text-decoration: none; transition: color 0.2s; &:hover { color: var(--gold-400); } }
    & h4 { color: var(--ivory); font-size: var(--fs-xs); letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 1.1rem; }
    & ul { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
    & .brand { color: var(--ivory); }
  }
  .footer-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    & > :first-child { grid-column: 1 / -1; max-width: 360px;
      @media (min-width: 900px) { grid-column: auto / span 2; }
    }
  }
  .footer-bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
    margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-dark); font-size: var(--fs-xs);
  }
  .social { display: flex; gap: 0.6rem; margin-top: 1.5rem;
    & a { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-dark); border-radius: 50%; }
  }

  /* ── Botón flotante de WhatsApp ── */
  .wa-float {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40;
    display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
    background: #1f8f5f; color: #fff; box-shadow: 0 12px 30px -8px rgb(0 0 0 / 0.35);
    transition: transform 0.25s var(--ease);
    & .icon { width: 28px; height: 28px; }
    &:hover { transform: scale(1.06); }
  }
}

/* ==========================================================================
   Secciones
   ========================================================================== */
@layer sections {

  /* Fondo arquitectónico: líneas finas doradas que evocan estructura y solidez. */
  .architect-bg {
    position: absolute; inset: 0; pointer-events: none; overflow: hidden;
    &::before {
      content: ""; position: absolute; inset: -10% -5% -10% 35%;
      background:
        repeating-linear-gradient(90deg, rgb(198 167 107 / 0.10) 0 1px, transparent 1px 88px),
        repeating-linear-gradient(0deg, rgb(198 167 107 / 0.06) 0 1px, transparent 1px 88px);
      transform: perspective(900px) rotateY(-28deg) rotateX(8deg);
      mask-image: radial-gradient(ellipse 60% 60% at 60% 50%, #000 20%, transparent 75%);
    }
    &::after {
      content: ""; position: absolute; width: 900px; height: 900px; right: -250px; top: -300px;
      background: radial-gradient(circle, rgb(198 167 107 / 0.16), transparent 60%);
    }
  }

  /* ── Hero de inicio ── */
  .hero {
    position: relative; overflow: hidden; color: var(--ivory);
    background: radial-gradient(120% 90% at 85% 10%, var(--navy-800) 0%, var(--navy-950) 60%);
    padding-block: clamp(5rem, 3rem + 8vw, 9.5rem) clamp(4rem, 3rem + 4vw, 6rem);
    margin-top: calc(var(--header-h) * -1); padding-top: calc(var(--header-h) + clamp(4rem, 3rem + 7vw, 8.5rem));
    & .container { position: relative; }
    & h1 { font-size: var(--fs-hero); max-width: 14ch; margin-top: 1.5rem; }
    & .hero__lead { font-size: var(--fs-xl); max-width: 40ch; margin-top: 1.5rem; color: rgb(247 244 238 / 0.75); font-weight: 300; }
    & .hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.5rem; }
  }
  /* Foto de fondo: se funde con el azul hacia la izquierda y hacia abajo para que el texto se lea siempre. */
  .hero__media {
    position: absolute; inset: 0; pointer-events: none;
    @media (min-width: 900px) { inset: 0 0 0 auto; width: min(76%, 1500px); }
    & img {
      display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; opacity: 0.35;
      mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
      @media (min-width: 900px) {
        opacity: 0.92;
        mask-image: linear-gradient(to right, transparent 0%, #000 42%), linear-gradient(to bottom, #000 60%, transparent 98%);
        mask-composite: intersect;
      }
    }
    /* Tono crepuscular para integrarla con el azul de la marca. */
    &::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(7 13 26 / 0.35), rgb(7 13 26 / 0.15) 40%, rgb(7 13 26 / 0.5)); }
  }
  .hero--photo .hero__paths { position: relative; }
  .hero__paths {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    margin-top: clamp(3.5rem, 2rem + 5vw, 6rem);
    border-top: 1px solid var(--line-dark);
  }
  .path {
    position: relative; display: grid; gap: 0.5rem; padding: 1.75rem 1.5rem 0.5rem 0; text-decoration: none;
    & + .path { @media (min-width: 840px) { padding-left: 1.75rem; border-left: 1px solid var(--line-dark); } }
    & .path__num { font-size: var(--fs-xs); color: var(--gold-400); letter-spacing: 0.2em; }
    & h3 { font-size: 1.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
    & h3 .icon { color: var(--gold-400); transition: transform 0.3s var(--ease); }
    & p { color: rgb(247 244 238 / 0.6); font-size: var(--fs-sm); }
    &:hover h3 .icon { transform: translateX(6px); }
  }

  /* ── Nuestras soluciones: segmentación horizontal ── */
  .solutions {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    border: 1px solid var(--line-light); border-radius: var(--radius-lg); overflow: hidden; background: var(--white);
  }
  .solution {
    position: relative; display: flex; flex-direction: column; gap: 0.75rem; padding: 2rem 1.75rem; min-height: 220px;
    text-decoration: none; border-right: 1px solid var(--line-light); border-bottom: 1px solid var(--line-light);
    margin: 0 -1px -1px 0;
    transition: background 0.35s var(--ease), color 0.35s var(--ease);
    & .solution__icon { color: var(--gold-600); }
    & .solution__icon .icon { width: 32px; height: 32px; stroke-width: 1.25; }
    & h3 { font-size: 1.55rem; font-weight: 600; margin-top: auto; }
    & p { font-size: var(--fs-sm); color: var(--ink-3); }
    & .solution__go { position: absolute; top: 1.75rem; right: 1.5rem; opacity: 0; transform: translateX(-6px); transition: all 0.3s var(--ease); color: var(--gold-500); }
    &:hover { background: var(--navy-900); color: var(--ivory);
      & p { color: rgb(247 244 238 / 0.65); }
      & .solution__icon { color: var(--gold-400); }
      & .solution__go { opacity: 1; transform: none; }
    }
  }
  .more-services {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; margin-top: 1.5rem;
  }
  .service-chip {
    display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; border-radius: var(--radius);
    background: var(--navy-900); color: var(--ivory); text-decoration: none; transition: background 0.3s;
    & .icon { color: var(--gold-400); width: 26px; height: 26px; }
    & strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }
    & .badge { margin-left: auto; color: var(--gold-300); }
    & .service-chip__go { margin-left: auto; color: var(--gold-400); }
    &:hover { background: var(--navy-700); }
  }

  /* ── Diferenciales ── */
  .pillars { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  .pillar {
    padding: 2.25rem 2rem 2.25rem 0; border-top: 1px solid var(--line-dark);
    & + .pillar { @media (min-width: 900px) { padding-left: 2rem; border-left: 1px solid var(--line-dark); } }
    & .pillar__num { font-family: var(--font-display); font-size: 3.25rem; color: var(--gold-500); line-height: 1; }
    & h3 { font-size: 1.65rem; margin-top: 1.25rem; }
    & p { margin-top: 0.75rem; color: rgb(247 244 238 / 0.68); }
  }

  /* ── Logos ── */
  .logos {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    border-top: 1px solid var(--line-light); border-left: 1px solid var(--line-light);
  }
  .logo-cell {
    display: grid; place-items: center; aspect-ratio: 16 / 9; padding: 1.5rem;
    border-right: 1px solid var(--line-light); border-bottom: 1px solid var(--line-light);
    & img { max-height: 48px; width: auto; filter: grayscale(1) contrast(0.9); opacity: 0.7; transition: all 0.3s; }
    &:hover img { filter: none; opacity: 1; }
    & span { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink-3); text-align: center; }
  }

  /* Empresas clientes: carrusel continuo, a color, con el nombre debajo. */
  .clients-section .section-head { margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
  .marquee {
    display: flex; overflow: hidden; padding-block: 0.75rem;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    &:hover .marquee__track, &:focus-within .marquee__track { animation-play-state: paused; }
  }
  .marquee__track {
    display: flex; flex-shrink: 0; gap: 1.25rem; padding: 0 0.625rem; margin: 0; list-style: none;
    animation: marquee linear infinite;
  }
  @keyframes marquee { to { transform: translateX(-100%); } }
  .client-card {
    display: grid; justify-items: center; align-content: start; gap: 0.9rem; width: 212px; padding: 1.5rem 1rem 1.25rem;
    background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius-lg);
    transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
    &:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); border-color: rgb(198 167 107 / 0.5); }
  }
  .client-card__logo { display: grid; place-items: center; height: 72px; width: 100%;
    & img { max-height: 72px; max-width: 150px; width: auto; object-fit: contain; }
  }
  .client-card__mono {
    display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, var(--navy-700, #1b2d4d), var(--navy-950)); color: var(--gold-400);
    font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; letter-spacing: 0.04em;
    box-shadow: inset 0 0 0 1px rgb(198 167 107 / 0.45), 0 8px 18px -10px rgb(7 13 26 / 0.6);
  }
  .client-card__name { text-align: center; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-900); line-height: 1.5; }
  @media (prefers-reduced-motion: reduce) {
    .marquee { mask-image: none; }
    .marquee__track { animation: none; flex-wrap: wrap; justify-content: center; flex-shrink: 1; row-gap: 1.25rem;
      & + .marquee__track, & [aria-hidden="true"] { display: none; }
    }
  }

  /* Aseguradoras: texto a la izquierda, tarjetas grandes con asistencia 24 h. */
  .insurers-section { background: linear-gradient(180deg, var(--ivory) 0%, var(--ivory-2) 100%); position: relative; overflow: hidden; }
  .insurers { display: grid; gap: clamp(2rem, 1.5rem + 3vw, 4rem); align-items: center;
    @media (min-width: 960px) { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  }
  .insurers__intro { display: grid; gap: 1.1rem; justify-items: start;
    & h2 { font-size: var(--fs-3xl); }
    & p { color: var(--ink-2); font-size: var(--fs-lg); max-width: 46ch; }
  }
  .insurer-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
  .insurer-card {
    position: relative; display: grid; grid-template-rows: 1fr auto; min-height: 230px; overflow: hidden;
    background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
    transition: transform 0.35s var(--ease), box-shadow 0.35s;
    &::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--gold-500), var(--gold-300)); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
    &:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); &::before { transform: scaleX(1); } }
  }
  .insurer-card__logo { display: grid; place-items: center; padding: 2.5rem 2rem;
    & img { max-height: 64px; max-width: 100%; width: auto; }
  }
  .insurer-card__name { font-family: var(--font-display); font-size: 1.8rem; color: var(--navy-900); }
  .insurer-card__foot {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.95rem 1.25rem;
    border-top: 1px solid var(--line-light); background: var(--ivory); font-size: var(--fs-sm);
    & span { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink-3); & .icon { width: 16px; height: 16px; color: var(--gold-600); } }
    & a { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; color: var(--navy-900); text-decoration: none; font-variant-numeric: tabular-nums; &:hover { color: var(--gold-600); } & .icon { width: 14px; height: 14px; } }
  }

  /* ── Mi PURIAN (teaser) ── */
  .portal-preview {
    border-radius: var(--radius-lg); background: var(--navy-850); border: 1px solid var(--line-dark); padding: 1.5rem;
    box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.6);
    & .pp-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 1rem; border-bottom: 1px solid var(--line-dark); font-size: var(--fs-sm); }
    & .pp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 1.25rem; }
    & .pp-stat { background: rgb(255 255 255 / 0.04); border-radius: var(--radius); padding: 1rem;
      & b { display: block; font-family: var(--font-display); font-size: 2rem; color: var(--gold-400); line-height: 1; }
      & small { color: rgb(247 244 238 / 0.6); font-size: var(--fs-xs); }
    }
    & .pp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
    & .pp-action { display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 1rem; border-radius: var(--radius); border: 1px solid var(--line-dark); font-size: var(--fs-sm);
      & .icon { color: var(--gold-400); }
    }
  }

  /* ── Banda de llamado a la acción ── */
  .cta-band {
    position: relative; overflow: hidden; border-radius: var(--radius-lg);
    background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); color: var(--ivory);
    padding: clamp(2.5rem, 2rem + 3vw, 4.5rem);
    display: grid; gap: 2rem; align-items: center;
    @media (min-width: 900px) { grid-template-columns: 1.4fr 1fr; }
    & h2 { font-size: var(--fs-3xl); }
    & p { color: rgb(247 244 238 / 0.72); margin-top: 1rem; font-size: var(--fs-lg); }
    & .cta-band__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; @media (min-width: 900px) { justify-content: flex-end; } }
  }

  /* ── Hero de páginas internas ── */
  .page-hero {
    position: relative; overflow: hidden; color: var(--ivory);
    background: radial-gradient(120% 120% at 90% 0%, var(--navy-800), var(--navy-950) 65%);
    margin-top: calc(var(--header-h) * -1);
    padding-block: calc(var(--header-h) + clamp(3.5rem, 2rem + 5vw, 6.5rem)) clamp(3.5rem, 2.5rem + 4vw, 6rem);
    & .container { position: relative; }
    & h1 { font-size: var(--fs-3xl); max-width: 18ch; margin-top: 1.25rem; }
    & .page-hero__lead { font-size: var(--fs-lg); max-width: 56ch; margin-top: 1.25rem; color: rgb(247 244 238 / 0.72); }
    & .page-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
    & .breadcrumb { display: flex; gap: 0.5rem; font-size: var(--fs-xs); color: rgb(247 244 238 / 0.5); margin-bottom: 1.75rem; letter-spacing: 0.06em;
      & a { text-decoration: none; &:hover { color: var(--gold-400); } }
    }
  }
  .page-hero--invest { background: radial-gradient(120% 120% at 90% 0%, #1a2a4a, #060b16 65%); }
  .page-hero--token { background: radial-gradient(110% 120% at 85% 10%, #1d2640, #070b15 60%); }
  .page-hero--comex { background: radial-gradient(120% 120% at 90% 0%, #183041, #06101a 65%); }

  /* ── Página de ramo ── */
  .coverage-list { display: grid; gap: 1px; background: var(--line-light); border: 1px solid var(--line-light); border-radius: var(--radius); overflow: hidden;
    & li { list-style: none; background: var(--white); padding: 1.1rem 1.25rem; display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; }
    & .icon { color: var(--gold-500); margin-top: 0.2rem; }
    & strong { display: block; }
    & span { color: var(--ink-3); font-size: var(--fs-sm); }
  }
  .steps { counter-reset: step; display: grid; gap: 1rem; list-style: none; padding: 0;
    & li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
    & li::before {
      content: counter(step, decimal-leading-zero); font-family: var(--font-display); font-size: 1.6rem; color: var(--gold-500);
      width: 2.5rem; line-height: 1.1;
    }
    & strong { display: block; }
    & span { color: var(--ink-3); font-size: var(--fs-sm); }
    .section--dark & span, .section--deep & span { color: rgb(247 244 238 / 0.65); }
  }
  .sticky-col { @media (min-width: 960px) { position: sticky; top: calc(var(--header-h) + 2rem); } }

  /* ── Sectores ── */
  .sector {
    container-type: inline-size;
    & .sector__lines { display: flex; flex-wrap: wrap; gap: 0.4rem; }
    & .sector__lines a { font-size: var(--fs-xs); padding: 0.35rem 0.7rem; border: 1px solid var(--line-light); border-radius: 999px; text-decoration: none; position: relative; z-index: 2;
      &:hover { border-color: var(--gold-500); color: var(--gold-600); }
    }
    & .sector__extra { font-size: var(--fs-sm); color: var(--gold-600); display: flex; gap: 0.5rem; }
  }

  /* ── Centro de asistencia ── */
  .assist-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
  .assist {
    display: flex; flex-direction: column; gap: 0.75rem; padding: 1.75rem; border-radius: var(--radius-lg);
    background: rgb(255 255 255 / 0.04); border: 1px solid var(--line-dark); color: var(--ivory); text-decoration: none;
    transition: background 0.3s, border-color 0.3s;
    & .icon { width: 32px; height: 32px; color: var(--gold-400); stroke-width: 1.25; }
    & h3 { font-size: 1.5rem; }
    & p { font-size: var(--fs-sm); color: rgb(247 244 238 / 0.65); }
    &:hover { background: rgb(255 255 255 / 0.07); border-color: rgb(198 167 107 / 0.5); }
  }
  .phone-list { list-style: none; padding: 0; display: grid; gap: 0.75rem;
    & li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.4rem; background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius); }
    & img { max-height: 32px; width: auto; }
    & a { font-weight: 600; font-size: var(--fs-lg); text-decoration: none; display: inline-flex; gap: 0.5rem; align-items: center; color: var(--navy-900); }
  }

  /* ── Cinta de mercados (inicio) ── */
  .ticker { display: block; background: var(--navy-950); color: var(--ivory); border-block: 1px solid var(--line-dark); overflow: hidden; text-decoration: none;
    & .ticker__track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
    &:hover .ticker__track, &:focus-visible .ticker__track { animation-play-state: paused; }
    & .ticker__group { display: flex; gap: 2.75rem; padding: 0.85rem 1.375rem; font-size: var(--fs-sm); }
    & span { display: inline-flex; gap: 0.55rem; align-items: baseline; color: rgb(247 244 238 / 0.6); white-space: nowrap; }
    & b { color: var(--ivory); font-weight: 500; font-variant-numeric: tabular-nums; }
    & em { font-style: normal; font-size: var(--fs-xs); }
    & .up { color: #4cc38a; }
    & .down { color: #e5735f; }
    @media (prefers-reduced-motion: reduce) {
      overflow-x: auto;
      & .ticker__track { animation: none; }
      & .ticker__group[aria-hidden] { display: none; }
    }
  }
  @keyframes ticker { to { transform: translateX(-50%); } }

  .notice {
    display: flex; gap: 0.9rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); font-size: var(--fs-sm);
    background: rgb(198 167 107 / 0.1); border: 1px solid rgb(198 167 107 / 0.3); color: var(--ink-2);
    & .icon { color: var(--gold-600); margin-top: 0.1rem; }
    .section--dark &, .section--deep &, .page-hero & { color: rgb(247 244 238 / 0.75); & .icon { color: var(--gold-400); } }
  }

  /* ── Comercio exterior: precios de asesoría ── */
  .sessions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
    & div { text-align: center; padding: 1.25rem 0.5rem; border: 1px solid var(--line-dark); border-radius: var(--radius); }
    & b { display: block; font-family: var(--font-display); font-size: 2.25rem; color: var(--gold-400); line-height: 1; }
    & small { color: rgb(247 244 238 / 0.6); font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; }
    & a { display: grid; gap: 0.2rem; text-align: center; padding: 1.25rem 0.5rem; border: 1px solid var(--line-dark); border-radius: var(--radius); text-decoration: none; color: inherit; transition: border-color 0.2s;
      &:hover { border-color: rgb(198 167 107 / 0.6); }
      & span { font-size: var(--fs-sm); color: var(--ivory); margin-top: 0.4rem; }
      & .sessions__price { font-size: var(--fs-xs); color: var(--gold-400); margin-top: 0; }
    }
  }

  /* ── Gracias / mantenimiento / error ── */
  .center-screen { min-height: 70dvh; display: grid; place-items: center; text-align: center; padding-block: 6rem;
    & .container { max-width: 640px; }
    & h1 { font-size: var(--fs-3xl); margin-top: 1rem; }
    & p { margin-top: 1rem; color: var(--ink-2); font-size: var(--fs-lg); }
    & .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2rem; }
  }
  .seal { width: 76px; height: 76px; margin-inline: auto; border-radius: 50%; display: grid; place-items: center; background: var(--navy-900); color: var(--gold-400);
    & .icon { width: 34px; height: 34px; }
  }
  .ref { display: inline-block; margin-top: 1.25rem; padding: 0.5rem 1rem; border-radius: 999px; background: var(--white); border: 1px solid var(--line-light); font-size: var(--fs-sm); letter-spacing: 0.08em; }

  /* ── Mercados ── */
  .mkt-updated { display: inline-flex; gap: 0.5rem; align-items: center; margin-top: 1.25rem; font-size: var(--fs-sm); color: rgb(247 244 238 / 0.6); }
  .mkt-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
  .mkt-indicators { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
  .mkt-card { background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius); padding: 1.25rem 1.35rem; display: grid; gap: 0.35rem; align-content: start;
    .section--white & { background: var(--ivory); }
    & h3 { font-family: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); letter-spacing: 0.02em; & small { color: var(--ink-3); font-weight: 500; } }
    & .mkt-card__value { font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1.1; color: var(--navy-900); font-variant-numeric: lining-nums tabular-nums; & small { font-size: 1rem; color: var(--ink-3); } }
    & .mkt-card__meta { font-size: var(--fs-xs); color: var(--ink-3); }
  }
  .mkt-card--chart { grid-column: span 1; }
  .chg { font-weight: 600; color: var(--ink-3); white-space: nowrap; }
  .chg--up { color: #1f7a52; }
  .chg--down { color: #b3412f; }
  .spark { width: 100%; height: auto; margin-top: 0.25rem;
    & rect { fill: var(--navy-700, #1c3151); opacity: 0.35; }
    & rect.is-last { fill: var(--gold-500); opacity: 1; }
    & text { font-size: 9px; fill: var(--ink-3); }
  }
  .mkt-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius); overflow: hidden; font-variant-numeric: tabular-nums;
    & th { text-align: left; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); padding: 0.75rem 1rem; border-bottom: 1px solid var(--line-light); }
    & td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line-light); font-size: var(--fs-sm); & small { color: var(--ink-3); } }
    & tr:last-child td { border-bottom: 0; }
    & th:not(:first-child), & td:not(:first-child) { text-align: right; }
  }
  .mkt-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; text-decoration: none; color: inherit;
    & span { display: grid; gap: 0.15rem; padding: 1rem 1.1rem; border: 1px solid var(--line-dark); border-radius: var(--radius); background: rgb(255 255 255 / 0.03); transition: border-color 0.2s; }
    &:hover span { border-color: rgb(198 167 107 / 0.4); }
    & small { font-size: var(--fs-xs); color: rgb(247 244 238 / 0.6); }
    & b { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--gold-400); line-height: 1.1; font-variant-numeric: lining-nums; }
    & em { font-style: normal; font-size: var(--fs-xs); color: rgb(247 244 238 / 0.6); }
    & .up { color: #4cc38a; } & .down { color: #e5735f; }
  }
  .cta-inline { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; padding: 1.5rem 1.75rem; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line-light); }

  /* ── Reserva de asesorías ── */
  .page-hero--compact { padding-bottom: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
  .booking { display: grid; gap: 2rem; max-width: 960px; }
  .booking__steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: var(--fs-sm); color: var(--ink-3);
    & li { display: inline-flex; align-items: center; gap: 0.5rem; }
    & span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-light); background: var(--white); font-weight: 600; font-size: var(--fs-xs); }
    & .is-done span { background: var(--navy-900); border-color: var(--navy-900); color: var(--ivory); }
    & .is-current { color: var(--ink); font-weight: 600; & span { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-950); } }
  }
  .booking__block { display: grid; gap: 1rem; scroll-margin-top: calc(var(--header-h) + 1.5rem);
    & > h2 { font-size: var(--fs-xl); }
  }
  .session-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
  .session-card { display: grid; gap: 0.45rem; align-content: start; padding: 1.35rem 1.4rem; border-radius: var(--radius); background: var(--white); border: 1.5px solid var(--line-light); text-decoration: none; color: inherit; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
    &:hover { border-color: var(--gold-500); box-shadow: var(--shadow-soft); transform: translateY(-2px); }
    &.is-selected { border-color: var(--navy-900); box-shadow: 0 0 0 1px var(--navy-900), var(--shadow-soft); }
    & .session-card__time { font-size: var(--fs-sm); color: var(--ink-3); & b { font-family: var(--font-display); font-size: 2rem; color: var(--gold-600); font-weight: 600; } }
    & strong { font-size: var(--fs-lg); }
    & .session-card__desc { font-size: var(--fs-sm); color: var(--ink-2); }
    & .session-card__price { font-size: var(--fs-sm); font-weight: 600; color: var(--navy-900); margin-top: 0.25rem; }
  }
  /* Almanaque de turnos: mes con navegación + horarios del día elegido. */
  .booking-cal { display: grid; gap: 1.25rem; align-items: start;
    @media (min-width: 880px) { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  }
  .cal { background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius-lg); padding: clamp(1rem, 0.75rem + 1vw, 1.5rem); }
  .cal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem;
    & h3 { font-size: var(--fs-xl); }
  }
  .cal__nav { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-light); color: var(--navy-900); transition: border-color 0.2s, background 0.2s;
    &:hover { border-color: var(--gold-500); background: var(--ivory); }
    &.is-off { opacity: 0.3; }
    & .icon { width: 18px; height: 18px; }
  }
  .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.3rem; }
  .cal__dow { text-align: center; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); padding-bottom: 0.4rem; }
  .cal__day {
    position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--radius-sm);
    font-variant-numeric: tabular-nums; color: rgb(14 22 38 / 0.3); text-decoration: none; font-size: var(--fs-sm);
    &.is-today { box-shadow: inset 0 0 0 1px var(--line-light); }
    &.is-available { color: var(--navy-900); font-weight: 600; background: var(--ivory); transition: background 0.2s, color 0.2s;
      &::after { content: ""; position: absolute; bottom: 18%; width: 4px; height: 4px; border-radius: 50%; background: var(--gold-500); }
      &:hover { background: #efe6d3; }
    }
    &.is-selected { background: var(--navy-900); color: var(--ivory); &::after { background: var(--gold-400); } &:hover { background: var(--navy-900); } }
  }
  .cal__legend { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; font-size: var(--fs-xs); color: var(--ink-3); }
  .cal__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-500); }
  .cal-times { display: grid; gap: 0.75rem; align-content: start; background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius-lg); padding: clamp(1rem, 0.75rem + 1vw, 1.5rem);
    & h3 { font-size: var(--fs-xl); }
    & .time-chip { background: var(--ivory); }
  }
  .cal-times__empty { display: grid; justify-items: center; gap: 0.75rem; text-align: center; padding: 2rem 1rem; color: var(--ink-3); font-size: var(--fs-sm);
    & .icon { width: 32px; height: 32px; color: var(--gold-500); }
  }
  .time-picker { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .time-chip { text-align: center; padding: 0.7rem 0.5rem; border-radius: 99px; background: var(--white); border: 1.5px solid var(--line-light); text-decoration: none; color: inherit; font-weight: 600; font-variant-numeric: tabular-nums; transition: border-color 0.2s;
    &:hover { border-color: var(--gold-500); }
    &.is-selected { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-950); }
  }
  .booking__summary { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--navy-900); color: var(--ivory);
    & > .icon { width: 28px; height: 28px; color: var(--gold-400); }
    & div { display: grid; gap: 0.15rem; flex: 1; }
    & span { font-size: var(--fs-sm); color: rgb(247 244 238 / 0.75); }
    & .link { color: var(--gold-400); font-size: var(--fs-sm); font-weight: 600; }
  }
  .booking-status { padding-top: calc(var(--header-h) + 3rem);
    & h1 { font-size: var(--fs-2xl); margin-top: 1rem; }
    & .lead { margin-top: 1rem; }
  }
  .booking-status__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
  .booking-dl { display: grid; grid-template-columns: minmax(100px, 30%) 1fr; gap: 0.6rem 1rem;
    & dt { color: var(--ink-3); font-size: var(--fs-sm); }
  }
  .status-pill { display: inline-block; padding: 0.3rem 0.8rem; border-radius: 99px; font-size: var(--fs-xs); font-weight: 600; background: #eef0f4; color: var(--ink-2); }
  .status-pill--pendiente { background: #fff4dc; color: #8a5a00; }
  .status-pill--confirmada, .status-pill--realizada { background: #e3f5ec; color: #1f7a52; }
  .status-pill--cancelada, .status-pill--no_asistio { background: #f3f1ee; color: #7a7266; }
  .btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
  .alert--ok { background: #e3f5ec; color: #1f6b49; border: 1px solid #c3e7d4; }

  /* ── Texto legal ── */
  .prose { max-width: 72ch;
    & h2 { font-size: var(--fs-2xl); margin-top: 2.5rem; }
    & p, & ul { margin-top: 1rem; color: var(--ink-2); }
    & li { margin-top: 0.4rem; }
  }
}

@layer utilities {
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
  .text-center { text-align: center; }
  .muted { color: var(--ink-3); }
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }
}

/* ── Modo mantenimiento ── */
@layer sections {
  .maintenance {
    min-height: 100dvh; margin-top: 0; display: grid; place-items: center; text-align: center;
    padding-block: 4rem;
    & .container { display: grid; justify-items: center; gap: 1rem; }
    & .hero__lead { margin-inline: auto; }
    & .hero__actions { justify-content: center; }
  }
  .maintenance__name { font-family: var(--font-display); font-weight: 600; font-size: clamp(3.5rem, 2rem + 9vw, 8rem); letter-spacing: 0.3em; margin-right: -0.3em; line-height: 1; margin-top: 1rem; }
}

/* ── Diagnóstico patrimonial y recomendaciones ── */
@layer sections {
  .diag { display: grid; gap: 1.25rem; }
  .diag__q {
    border: 1px solid var(--line-light); border-radius: var(--radius); background: var(--white); padding: 1.35rem 1.5rem 1.5rem; margin: 0; min-width: 0;
    & legend { float: left; width: 100%; display: flex; gap: 0.85rem; align-items: baseline; font-weight: 600; font-size: var(--fs-lg); margin-bottom: 1rem; padding: 0; }
    & legend + * { clear: both; }
    & .field__error { display: block; margin-top: 0.6rem; color: var(--danger); font-size: var(--fs-xs); font-weight: 500; }
    &:has(.field__error) { border-color: #f1cdc9; }
    &:has(input:checked) .diag__num { background: var(--navy-900); color: var(--gold-400); border-color: var(--navy-900); }
  }
  .diag__num {
    display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%;
    border: 1px solid var(--line-light); font-size: var(--fs-sm); color: var(--ink-2); transition: all 0.2s;
  }
  /* Preguntas condicionales: se ocultan según respuestas previas (sin JavaScript). */
  .diag:has(input[name="vivienda"][value="otra"]:checked) [data-q="hogar"],
  .diag:has(input[name="vehiculos"][value="cero"]:checked) [data-q="auto"],
  .diag:has(input[name="actividad"][value="empleado"]:checked) [data-q="negocio"],
  .diag:has(input[name="actividad"][value="ninguna"]:checked) [data-q="negocio"] { display: none; }
  .diag__submit { display: grid; gap: 0.75rem; justify-items: start; margin-top: 0.5rem; }

  .diag-result { display: grid; gap: 2.5rem; align-items: center; position: relative;
    @media (min-width: 900px) { grid-template-columns: 1fr 260px; }
  }
  .score { width: min(240px, 60vw); height: auto; justify-self: center; overflow: visible; }
  .score__track { fill: none; stroke: rgb(255 255 255 / 0.1); stroke-width: 9; }
  .score__bar { fill: none; stroke: var(--gold-400); stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray 1s var(--ease); }
  .score__value { fill: var(--ivory); font-family: var(--font-display); font-size: 40px; font-weight: 600; }
  .score__label { fill: rgb(247 244 238 / 0.6); font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; }
  .score--ok .score__bar { stroke: #4fc08d; }
  .score--warn .score__bar { stroke: var(--gold-400); }
  .score--risk .score__bar { stroke: #e0705f; }

  .diag-areas { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
  .diag-area {
    --tone: var(--success); --tone-bg: #e8f5ee;
    display: grid; gap: 0.6rem; align-content: start; padding: 1.4rem 1.5rem; border-radius: var(--radius);
    background: var(--white); border: 1px solid var(--line-light); border-top: 3px solid var(--tone);
    & h3 { font-size: var(--fs-xl); }
    & p { color: var(--ink-2); font-size: var(--fs-sm); }
  }
  .diag-area--warn { --tone: var(--gold-500); --tone-bg: #f7efdf; }
  .diag-area--risk { --tone: var(--danger); --tone-bg: #fbeeee; }
  .diag-area__status {
    justify-self: start; padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--tone-bg); color: var(--tone);
    font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; filter: saturate(1.1) brightness(0.85);
  }

  .diag-band {
    display: grid; gap: 1.5rem; align-items: center; padding: clamp(1.75rem, 1.25rem + 2vw, 2.75rem); border-radius: var(--radius-lg);
    background: radial-gradient(120% 140% at 100% 0%, var(--navy-800), var(--navy-950) 70%); color: var(--ivory);
    @media (min-width: 860px) { grid-template-columns: 1fr auto; }
    & h2 { font-size: var(--fs-2xl, 2rem); margin-top: 0.6rem; }
    & p { margin-top: 0.6rem; color: rgb(247 244 238 / 0.72); max-width: 56ch; }
    & .eyebrow { color: var(--gold-400); }
  }

  .referral-note {
    display: inline-flex; gap: 0.6rem; align-items: center; margin-top: 1.5rem; padding: 0.7rem 1.1rem; border-radius: 999px;
    background: rgb(198 167 107 / 0.14); border: 1px solid rgb(198 167 107 / 0.35); font-size: var(--fs-sm);
    & .icon { color: var(--gold-400); flex: none; }
  }
}
