/* ==================================================================
   LEGIS PERU — Design System
   Firma Legal & Consultoría · www.legisperu.com
   ------------------------------------------------------------------
   00. Tokens
   01. Reset y base
   02. Layout y utilidades
   03. Fondos y capas decorativas
   04. Tipografía
   05. Botones
   06. Header y navegación
   07. Hero
   08. Buscador
   09. Cards (servicio, categoría, institución)
   10. Secciones de contenido
   11. Filtros y catálogo
   12. Ficha de servicio
   13. Timeline y proceso
   14. Wizard / Asistente
   15. Acordeón y FAQ
   16. Formularios
   17. Dashboard (Mi Portal)
   18. Footer
   19. Botón flotante de WhatsApp
   20. Animaciones
   21. Responsive
   ================================================================== */

/* ==================================================================
   00. TOKENS
   ================================================================== */
:root {
  /* --- Paleta institucional (tomada del logotipo) --------------- */
  --color-primary:        #16243A;   /* Azul marino institucional  */
  --color-primary-deep:   #0C1523;   /* Navy profundo              */
  --color-primary-soft:   #1E3252;
  --color-primary-light:  #2C4972;

  --color-secondary:      #DE7A0C;   /* Naranja de acción          */
  --color-secondary-warm: #F0900F;
  --color-secondary-deep: #B45F05;

  --color-accent:         #C9A227;   /* Dorado muy sutil           */

  --color-background:     #FFFFFF;
  --color-surface:        #FFFFFF;
  --color-surface-alt:    #F4F7FB;
  --color-surface-sunken: #EDF2F8;

  --color-text:           #16243A;
  --color-muted:          #5B6C86;
  --color-border:         #E2E9F2;
  --color-border-strong:  #CBD6E4;

  --color-success:        #1F8A5B;
  --color-warning:        #C2790A;
  --color-danger:         #C0392B;
  --color-info:           #2C6BB3;

  /* --- Superficies sobre fondo oscuro --------------------------- */
  --on-dark-text:         #F2F6FB;
  --on-dark-muted:        #A9BAD2;
  --on-dark-border:       rgba(255, 255, 255, .14);
  --on-dark-glass:        rgba(255, 255, 255, .06);

  /* --- Tipografía ----------------------------------------------- */
  --font-display: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --fs-xs:   0.75rem;    /* 12 */
  --fs-sm:   0.8125rem;  /* 13 */
  --fs-base: 0.9375rem;  /* 15 */
  --fs-md:   1rem;       /* 16 */
  --fs-lg:   1.125rem;   /* 18 */
  --fs-xl:   1.375rem;   /* 22 */
  --fs-2xl:  1.75rem;    /* 28 */
  --fs-3xl:  2.25rem;    /* 36 */
  --fs-4xl:  2.75rem;    /* 44 */
  --fs-5xl:  3.5rem;     /* 56 */

  /* --- Espaciado ------------------------------------------------- */
  --sp-1: .25rem;  --sp-2: .5rem;   --sp-3: .75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;    --sp-7: 2.5rem;  --sp-8: 3rem;
  --sp-9: 4rem;    --sp-10: 5rem;   --sp-11: 6.5rem;

  /* --- Radios ---------------------------------------------------- */
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  /* --- Sombras --------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(12, 21, 35, .06);
  --shadow-sm: 0 2px 8px rgba(12, 21, 35, .06), 0 1px 2px rgba(12, 21, 35, .04);
  --shadow:    0 8px 24px rgba(12, 21, 35, .08), 0 2px 6px rgba(12, 21, 35, .04);
  --shadow-lg: 0 18px 44px rgba(12, 21, 35, .12), 0 4px 12px rgba(12, 21, 35, .06);
  --shadow-xl: 0 32px 72px rgba(12, 21, 35, .18);
  --shadow-brand: 0 10px 30px rgba(222, 122, 12, .28);

  /* --- Layout ---------------------------------------------------- */
  --container: 1200px;
  --container-wide: 1340px;
  --container-narrow: 820px;
  --header-h: 76px;

  /* --- Transiciones ---------------------------------------------- */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: .16s var(--ease);
  --t:      .26s var(--ease);
  --t-slow: .5s var(--ease-out);
}

/* ==================================================================
   01. RESET Y BASE
   ================================================================== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.2; font-weight: 700; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

::selection { background: rgba(222, 122, 12, .22); }

.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; top: -60px; left: var(--sp-4); z-index: 999;
  background: var(--color-secondary); color: #fff;
  padding: var(--sp-3) var(--sp-5); border-radius: var(--radius-sm);
  font-weight: 600; transition: top var(--t);
}
.skip-link:focus { top: var(--sp-3); }

/* ==================================================================
   02. LAYOUT Y UTILIDADES
   ================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.container--wide   { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--sp-9); position: relative; }
.section--tight { padding-block: var(--sp-8); }
.section--alt { background: var(--color-surface-alt); }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

.stack   { display: flex; flex-direction: column; gap: var(--sp-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.center  { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--sp-5); } .mt-6 { margin-top: var(--sp-6); }
.hide { display: none !important; }

/* Contenedor para tablas o bloques anchos */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ==================================================================
   03. FONDOS Y CAPAS DECORATIVAS
   ------------------------------------------------------------------
   Identidad visual propia: degradados navy, iluminación ambiental
   radial, retícula hexagonal y trazos diagonales que evocan las
   tres barras del isotipo. Sin fotografías de stock.
   ================================================================== */
.bg-dark {
  position: relative;
  color: var(--on-dark-text);
  background:
    radial-gradient(1100px 620px at 78% -8%,  rgba(222, 122, 12, .20), transparent 62%),
    radial-gradient(900px  560px at 8%  12%,  rgba(44, 73, 114, .58),  transparent 66%),
    radial-gradient(760px  520px at 52% 108%, rgba(201, 162, 39, .12), transparent 68%),
    linear-gradient(168deg, #16243A 0%, #101C2E 46%, #0C1523 100%);
  overflow: hidden;
  isolation: isolate;
}

.bg-dark::before {
  /* Retícula hexagonal muy sutil */
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='96' viewBox='0 0 56 96'%3E%3Cpath d='M28 0 L56 16 L56 48 L28 64 L0 48 L0 16 Z' fill='none' stroke='%23ffffff' stroke-opacity='0.045' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 56px 96px;
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 12%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 12%, transparent 78%);
  pointer-events: none;
}

.bg-dark::after {
  /* Trazos diagonales — eco de las tres barras del isotipo */
  content: '';
  position: absolute;
  right: -8%; top: -18%;
  width: 620px; height: 620px; z-index: -1;
  background:
    linear-gradient(118deg, transparent 45.4%, rgba(222,122,12,.20) 45.4%, rgba(222,122,12,.20) 46.5%, transparent 46.5%),
    linear-gradient(118deg, transparent 56.6%, rgba(222,122,12,.13) 56.6%, rgba(222,122,12,.13) 57.7%, transparent 57.7%),
    linear-gradient(118deg, transparent 67.8%, rgba(201,162,39,.10) 67.8%, rgba(201,162,39,.10) 68.9%, transparent 68.9%);
  mask-image: linear-gradient(200deg, #000 8%, transparent 76%);
  -webkit-mask-image: linear-gradient(200deg, #000 8%, transparent 76%);
  pointer-events: none;
}

.bg-dark .container { position: relative; z-index: 1; }

/* Superficie de vidrio sobre fondo oscuro */
.glass {
  background: var(--on-dark-glass);
  border: 1px solid var(--on-dark-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}

/* Superficie clara con iluminación ambiental */
.bg-soft {
  position: relative;
  background:
    radial-gradient(680px 420px at 88% 4%,  rgba(222, 122, 12, .07), transparent 62%),
    radial-gradient(760px 460px at 4%  92%, rgba(44, 73, 114, .09),  transparent 64%),
    var(--color-surface-alt);
}

/* Divisor con degradado */
.rule {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, var(--color-border-strong), transparent);
}
.rule--dark {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
}

/* ==================================================================
   04. TIPOGRAFÍA
   ================================================================== */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.1;
}

.h1 { font-size: var(--fs-3xl); }
.h2 { font-size: var(--fs-2xl); }
.h3 { font-size: var(--fs-xl); }
.h4 { font-size: var(--fs-lg); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--color-secondary);
}
.eyebrow::before {
  content: ''; width: 26px; height: 2px;
  background: linear-gradient(90deg, var(--color-secondary), transparent);
  border-radius: 2px;
}
.bg-dark .eyebrow { color: var(--color-secondary-warm); }

.lead {
  font-size: var(--fs-lg);
  color: var(--color-muted);
  line-height: 1.6;
}
.bg-dark .lead { color: var(--on-dark-muted); }

.muted { color: var(--color-muted); }
.bg-dark .muted { color: var(--on-dark-muted); }

.section-head { max-width: 660px; margin-bottom: var(--sp-7); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head .h2 { margin-block: var(--sp-3) var(--sp-3); }

.text-accent { color: var(--color-secondary); }

/* ==================================================================
   05. BOTONES
   ================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  padding: .82rem 1.5rem;
  font-size: var(--fs-base); font-weight: 650;
  letter-spacing: .01em;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t), background var(--t), border-color var(--t), color var(--t);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { flex-shrink: 0; }

.btn--primary {
  background: linear-gradient(135deg, var(--color-secondary-warm), var(--color-secondary));
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-deep));
  box-shadow: 0 14px 34px rgba(222, 122, 12, .36);
  transform: translateY(-1px);
}

.btn--dark {
  background: var(--color-primary);
  color: #fff;
}
.btn--dark:hover { background: var(--color-primary-soft); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-border-strong);
}
.btn--ghost:hover { border-color: var(--color-primary); background: var(--color-surface-alt); }

.btn--outline-light {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-color: rgba(255,255,255,.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn--outline-light:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); }

.btn--sm { padding: .55rem 1.05rem; font-size: var(--fs-sm); }
.btn--lg { padding: 1rem 1.9rem; font-size: var(--fs-lg); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* Enlace con flecha */
.link-arrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-weight: 650; font-size: var(--fs-base);
  color: var(--color-secondary);
}
.link-arrow span { transition: transform var(--t); }
.link-arrow:hover span { transform: translateX(4px); }

/* ==================================================================
   06. HEADER Y NAVEGACIÓN
   ================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--t), background var(--t);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); background: rgba(255,255,255,.96); }

.header-inner {
  position: relative;   /* ancla del mega menú */
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--header-h);
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 42px; width: auto; }

.nav { display: none; }

.nav-list { display: flex; align-items: center; gap: var(--sp-1); }

.nav-link {
  position: relative;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .55rem .7rem;
  font-size: var(--fs-base); font-weight: 550;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover { color: var(--color-secondary); background: var(--color-surface-alt); }
.nav-link[aria-current="page"] { color: var(--color-secondary); font-weight: 650; }
.nav-link .caret { width: 10px; height: 10px; transition: transform var(--t); }
.nav-item.is-open > .nav-link .caret { transform: rotate(180deg); }

.header-actions { display: flex; align-items: center; gap: var(--sp-3); }
.header-actions .btn--ghost { display: none; }

/* --- Mega menú de trámites -------------------------------------
   Se posiciona respecto a .header-inner, no respecto al ítem del
   menú: centrado sobre el ítem se salía del viewport por la
   izquierda, porque "Trámites" está cerca del borde. */
.nav-item { position: relative; }
.nav-item.has-mega { position: static; }

.mega {
  position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(760px, 100%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-5);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.nav-item.is-open .mega {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.mega-link {
  display: flex; flex-direction: column; gap: 2px;
  padding: .6rem .7rem;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.mega-link:hover { background: var(--color-surface-alt); }
.mega-link strong { font-size: var(--fs-base); font-weight: 650; }
.mega-link span { font-size: var(--fs-xs); color: var(--color-muted); line-height: 1.4; }
.mega-foot {
  margin-top: var(--sp-4); padding-top: var(--sp-4);
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
  flex-wrap: wrap;
}

/* --- Botón hamburguesa ------------------------------------------ */
.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center;
  gap: 5px; width: 44px; height: 44px; padding: 0 10px;
  background: transparent; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--color-primary); border-radius: 2px;
  transition: transform var(--t), opacity var(--t-fast);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Panel móvil ------------------------------------------------- */
.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 99;
  background: var(--color-surface);
  padding: var(--sp-5);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--t-slow);
  border-top: 1px solid var(--color-border);
}
.mobile-nav.is-open { transform: translateX(0); }
body.nav-open { overflow: hidden; }

.mobile-nav a {
  display: block; padding: .95rem .25rem;
  font-size: var(--fs-lg); font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav a:active { color: var(--color-secondary); }
.mobile-nav .sub a {
  font-size: var(--fs-base); font-weight: 500;
  color: var(--color-muted); padding-left: var(--sp-4);
}
.mobile-nav .mobile-cta { margin-top: var(--sp-6); display: grid; gap: var(--sp-3); }
.mobile-nav .mobile-cta a { border: 0; padding: 0; }

/* ==================================================================
   07. HERO
   ================================================================== */
.hero { padding-block: var(--sp-9) var(--sp-10); }

.hero-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: .4rem .95rem .4rem .55rem;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--on-dark-border);
  font-size: var(--fs-sm); color: var(--on-dark-muted);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  margin-bottom: var(--sp-5);
}
.hero-badge b { color: #fff; font-weight: 650; }
.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-secondary-warm);
  box-shadow: 0 0 0 4px rgba(240, 144, 15, .2);
  margin-left: .35rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: #fff;
  margin-bottom: var(--sp-5);
  max-width: 16ch;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--color-secondary-warm), var(--color-accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero .lead { max-width: 56ch; margin-bottom: var(--sp-6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.hero-stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--on-dark-border);
}
.hero-stats .stat-value {
  font-family: var(--font-display);
  font-size: var(--fs-2xl); color: #fff; line-height: 1;
}
.hero-stats .stat-label {
  font-size: var(--fs-sm); color: var(--on-dark-muted);
  margin-top: .35rem; display: block;
}

/* ==================================================================
   08. BUSCADOR
   ================================================================== */
.search-card {
  padding: var(--sp-5);
  margin-top: var(--sp-7);
}
.search-card h2 {
  font-size: var(--fs-lg); color: #fff;
  margin-bottom: var(--sp-4);
}

.search-box { position: relative; }
.search-field {
  display: flex; align-items: center; gap: var(--sp-2);
  background: #fff;
  border-radius: var(--radius-pill);
  padding: .4rem .4rem .4rem 1.1rem;
  box-shadow: var(--shadow-lg);
}
.search-field svg { flex-shrink: 0; color: var(--color-muted); }
.search-field input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: var(--fs-md);
  color: var(--color-text);
  padding: .7rem 0;
}
.search-field input::placeholder { color: #93A3B8; }

.search-hints {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.search-hints .label {
  font-size: var(--fs-sm); color: var(--on-dark-muted);
  align-self: center; margin-right: var(--sp-1);
}
.chip {
  display: inline-flex; align-items: center;
  padding: .35rem .8rem;
  font-size: var(--fs-sm);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.08);
  border: 1px solid var(--on-dark-border);
  color: var(--on-dark-text);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.chip:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.34); }

/* --- Resultados en vivo ------------------------------------------ */
.search-results {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 40;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-height: 62vh; overflow-y: auto;
  padding: var(--sp-2);
  display: none;
}
.search-results.is-open { display: block; }

.result-item {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: .7rem .8rem;
  border-radius: var(--radius);
  transition: background var(--t-fast);
}
.result-item:hover, .result-item.is-active { background: var(--color-surface-alt); }
.result-item .r-body { min-width: 0; }
.result-item strong {
  display: block; font-size: var(--fs-base); font-weight: 650;
  color: var(--color-text);
}
.result-item small {
  display: block; font-size: var(--fs-xs); color: var(--color-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.result-item .r-tag {
  flex-shrink: 0; align-self: center;
  font-size: var(--fs-xs); font-weight: 650;
  color: var(--color-secondary);
  background: rgba(222,122,12,.1);
  padding: .2rem .55rem; border-radius: var(--radius-pill);
}
.result-empty { padding: var(--sp-5); text-align: center; color: var(--color-muted); font-size: var(--fs-base); }

/* ==================================================================
   09. CARDS
   ================================================================== */
.card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--color-border-strong); }

/* --- Card de categoría ------------------------------------------ */
.cat-card {
  display: flex; flex-direction: column; gap: var(--sp-3);
  min-height: 100%;
  overflow: hidden;
}
.cat-card::after {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(150deg, rgba(222,122,12,.08), transparent 46%);
  opacity: 0; transition: opacity var(--t);
}
.cat-card:hover::after { opacity: 1; }

.cat-card .cat-code {
  font-family: var(--font-display);
  font-size: var(--fs-sm); font-weight: 700;
  color: var(--color-secondary);
  letter-spacing: .08em;
}
.cat-card h3 { font-size: var(--fs-lg); }
.cat-card p { font-size: var(--fs-base); color: var(--color-muted); margin: 0; }
.cat-card .cat-foot {
  margin-top: auto; padding-top: var(--sp-3);
  display: flex; align-items: center; gap: .4rem;
  font-size: var(--fs-sm); font-weight: 650; color: var(--color-secondary);
}
.cat-card .cat-foot span { transition: transform var(--t); }
.cat-card:hover .cat-foot span { transform: translateX(4px); }

.icon-badge {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 13px;
  background: linear-gradient(140deg, rgba(44,73,114,.12), rgba(222,122,12,.12));
  border: 1px solid var(--color-border);
  color: var(--color-primary);
}
.icon-badge svg { width: 22px; height: 22px; }

/* --- Card de servicio -------------------------------------------- */
.service-card {
  display: flex; flex-direction: column; gap: var(--sp-3);
  height: 100%;
}
.service-card .sc-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
}
.tag {
  display: inline-flex; align-items: center;
  font-size: var(--fs-xs); font-weight: 650;
  letter-spacing: .04em;
  padding: .22rem .6rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface-sunken);
  color: var(--color-primary-light);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}
.tag--accent { background: rgba(222,122,12,.1); color: var(--color-secondary-deep); border-color: rgba(222,122,12,.2); }
.tag--soft   { background: transparent; color: var(--color-muted); }

.service-card h3 { font-size: var(--fs-lg); line-height: 1.3; }
.service-card h3 a { transition: color var(--t-fast); }
.service-card:hover h3 a { color: var(--color-secondary); }
.service-card p { font-size: var(--fs-base); color: var(--color-muted); margin: 0; }

.service-meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-4);
  margin-top: auto; padding-top: var(--sp-4);
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-sm);
}
.service-meta .m-item { display: flex; flex-direction: column; }
.service-meta .m-label { font-size: var(--fs-xs); color: var(--color-muted); text-transform: uppercase; letter-spacing: .07em; }
.service-meta .m-value { font-weight: 650; color: var(--color-text); }

.service-card .sc-actions { display: flex; gap: var(--sp-2); }

/* Distintivo para el trámite destacado */
.service-card.is-highlight { border-color: rgba(222,122,12,.36); }
.service-card.is-highlight::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
}

/* --- Card sobre fondo oscuro -------------------------------------- */
.card--dark {
  background: var(--on-dark-glass);
  border-color: var(--on-dark-border);
  color: var(--on-dark-text);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.card--dark:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.24); }
.card--dark p, .card--dark .muted { color: var(--on-dark-muted); }
.card--dark .icon-badge {
  background: rgba(255,255,255,.08);
  border-color: var(--on-dark-border);
  color: var(--color-secondary-warm);
}

/* ==================================================================
   10. SECCIONES DE CONTENIDO
   ================================================================== */
/* --- Pasos numerados --------------------------------------------- */
.steps { counter-reset: step; display: grid; gap: var(--sp-5); }
.step {
  position: relative;
  padding-left: 62px;
}
.step::before {
  counter-increment: step;
  content: '0' counter(step);
  position: absolute; left: 0; top: -2px;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  font-family: var(--font-display); font-size: var(--fs-base); font-weight: 700;
  color: var(--color-secondary);
  background: rgba(222,122,12,.09);
  border: 1px solid rgba(222,122,12,.24);
  border-radius: 13px;
}
.step h3 { font-size: var(--fs-lg); margin-bottom: .35rem; }
.step p { font-size: var(--fs-base); color: var(--color-muted); margin: 0; }
.bg-dark .step p { color: var(--on-dark-muted); }
.bg-dark .step::before { background: rgba(222,122,12,.14); color: var(--color-secondary-warm); }

/* --- Lista de beneficios ------------------------------------------ */
.checklist { display: grid; gap: var(--sp-3); }
.checklist li {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  font-size: var(--fs-base);
}
.checklist li::before {
  content: ''; flex-shrink: 0;
  width: 20px; height: 20px; margin-top: 2px;
  border-radius: 50%;
  background: rgba(31,138,91,.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F8A5B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.checklist--dark li::before {
  background-color: rgba(240,144,15,.16);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F0900F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

/* --- Lista de requisitos / documentos ----------------------------- */
.doc-list { display: grid; gap: var(--sp-2); }
.doc-list li {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: .7rem .9rem;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: var(--fs-base);
}
.doc-list li::before {
  content: ''; flex-shrink: 0; width: 16px; height: 16px; margin-top: 3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6C86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* --- Testimonios --------------------------------------------------- */
.quote { display: flex; flex-direction: column; gap: var(--sp-4); height: 100%; }
.quote-mark {
  font-family: var(--font-display); font-size: 2.6rem; line-height: .8;
  color: var(--color-secondary); opacity: .5;
}
.quote p { font-size: var(--fs-base); line-height: 1.7; margin: 0; }
.quote-author { margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--color-border); }
.quote-author strong { display: block; font-size: var(--fs-base); }
.quote-author small { color: var(--color-muted); font-size: var(--fs-sm); }

/* --- Banda de instituciones ---------------------------------------- */
.inst-strip {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  justify-content: center;
}
.inst-pill {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: .55rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: var(--fs-base); font-weight: 650;
  color: var(--color-primary);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t);
}
.inst-pill:hover { border-color: var(--color-secondary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* --- Bloque CTA final ---------------------------------------------- */
.cta-band {
  border-radius: var(--radius-xl);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
}
.cta-band h2 {
  font-family: var(--font-display);
  font-size: var(--fs-2xl); color: #fff;
  margin-bottom: var(--sp-3);
}
.cta-band .lead { max-width: 52ch; margin-inline: auto; margin-bottom: var(--sp-6); }
.cta-band .cluster { justify-content: center; }

/* --- Aviso legal / disclaimer -------------------------------------- */
.notice {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius);
  background: rgba(44,107,179,.06);
  border: 1px solid rgba(44,107,179,.18);
  font-size: var(--fs-base);
  color: var(--color-text);
}
.notice::before {
  content: ''; flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232C6BB3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.notice--warn { background: rgba(194,121,10,.07); border-color: rgba(194,121,10,.22); }
.notice--warn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C2790A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}

/* ==================================================================
   11. FILTROS Y CATÁLOGO
   ================================================================== */
.page-head { padding-block: var(--sp-8) var(--sp-8); }
.page-head h1 {
  font-family: var(--font-display);
  font-size: var(--fs-3xl); color: #fff;
  margin-block: var(--sp-3);
  max-width: 20ch;
}

.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  font-size: var(--fs-sm); color: var(--on-dark-muted);
}
.breadcrumbs a:hover { color: #fff; text-decoration: underline; }
.breadcrumbs .sep { opacity: .5; }
.breadcrumbs [aria-current] { color: #fff; }

.catalog-layout { display: grid; gap: var(--sp-6); align-items: start; }

.filters {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}
.filters h2 {
  font-size: var(--fs-base); text-transform: uppercase;
  letter-spacing: .1em; color: var(--color-muted);
  margin-bottom: var(--sp-4);
}
.filter-group { margin-bottom: var(--sp-5); }
.filter-group > h3 {
  font-size: var(--fs-sm); font-weight: 700;
  margin-bottom: var(--sp-3);
}
.filter-options { display: grid; gap: .45rem; }

.filter-option {
  display: flex; align-items: center; gap: var(--sp-3);
  font-size: var(--fs-base); color: var(--color-muted);
  cursor: pointer; padding: .25rem 0;
  transition: color var(--t-fast);
}
.filter-option:hover { color: var(--color-text); }
.filter-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.filter-option .box {
  flex-shrink: 0; width: 18px; height: 18px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 5px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.filter-option input:checked ~ .box {
  background: var(--color-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
  border-color: var(--color-secondary);
}
.filter-option input:checked ~ .txt { color: var(--color-text); font-weight: 600; }
.filter-option input:focus-visible ~ .box { outline: 2px solid var(--color-secondary); outline-offset: 2px; }

.catalog-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.catalog-count { font-size: var(--fs-base); color: var(--color-muted); }
.catalog-count b { color: var(--color-text); }

.filter-toggle { display: inline-flex; }

.select {
  appearance: none; -webkit-appearance: none;
  padding: .6rem 2.2rem .6rem .9rem;
  font-family: inherit; font-size: var(--fs-base);
  color: var(--color-text);
  background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6C86' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right .8rem center / 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.active-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.chip-clear {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .5rem .3rem .8rem;
  font-size: var(--fs-sm); font-weight: 600;
  background: rgba(222,122,12,.1); color: var(--color-secondary-deep);
  border: 1px solid rgba(222,122,12,.22);
  border-radius: var(--radius-pill);
}
.chip-clear button {
  display: grid; place-items: center;
  width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(222,122,12,.2); color: inherit;
  font-size: 13px; line-height: 1;
}
.chip-clear button:hover { background: var(--color-secondary); color: #fff; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center; padding: var(--sp-9) var(--sp-5);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-alt);
}
.empty-state h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.empty-state p { color: var(--color-muted); max-width: 46ch; margin-inline: auto; margin-bottom: var(--sp-5); }

/* ==================================================================
   12. FICHA DE SERVICIO
   ================================================================== */
.service-hero { padding-block: var(--sp-8); }
.service-hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-3xl); color: #fff;
  line-height: 1.1; margin-block: var(--sp-4) var(--sp-4);
}
.service-hero .lead { max-width: 62ch; }

.service-facts {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  margin-top: var(--sp-6);
  padding: var(--sp-5);
}
.fact .f-label {
  display: block; font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--on-dark-muted); margin-bottom: .25rem;
}
.fact .f-value {
  font-family: var(--font-display);
  font-size: var(--fs-xl); color: #fff; line-height: 1.2;
}
.fact .f-value.is-small { font-family: var(--font-body); font-size: var(--fs-base); font-weight: 650; }

.service-layout { display: grid; gap: var(--sp-7); align-items: start; }

.service-body h2 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  margin-bottom: var(--sp-4);
}
.service-block { margin-bottom: var(--sp-8); }
.service-block:last-child { margin-bottom: 0; }

.service-aside { position: static; }
.aside-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow);
}
.aside-card .price {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  line-height: 1;
}
.aside-card .price small { display: block; font-family: var(--font-body); font-size: var(--fs-sm); color: var(--color-muted); font-weight: 500; margin-bottom: .3rem; }
.aside-divider { height: 1px; background: var(--color-border); margin-block: var(--sp-4); }
.aside-meta { display: grid; gap: var(--sp-3); font-size: var(--fs-base); }
.aside-meta .row { display: flex; justify-content: space-between; gap: var(--sp-3); }
.aside-meta .row span:first-child { color: var(--color-muted); }
.aside-meta .row span:last-child { font-weight: 650; text-align: right; }

/* ==================================================================
   13. TIMELINE Y PROCESO
   ================================================================== */
.timeline { position: relative; display: grid; gap: var(--sp-5); padding-left: 34px; }
.timeline::before {
  content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px;
  width: 2px; background: var(--color-border);
  border-radius: 2px;
}
.tl-item { position: relative; }
.tl-item::before {
  content: ''; position: absolute; left: -34px; top: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border-strong);
}
.tl-item h3 { font-size: var(--fs-base); font-weight: 650; margin-bottom: .2rem; }
.tl-item p { font-size: var(--fs-sm); color: var(--color-muted); margin: 0; }

.tl-item.is-done::before {
  background: var(--color-success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
  border-color: var(--color-success);
}
.tl-item.is-current::before {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 5px rgba(222,122,12,.18);
}
.tl-item.is-current h3 { color: var(--color-secondary-deep); }

/* ==================================================================
   14. WIZARD / ASISTENTE
   ================================================================== */
.wizard {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.wizard-head {
  padding: var(--sp-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}
.wizard-progress {
  height: 6px; border-radius: 3px;
  background: var(--color-surface-sunken);
  overflow: hidden; margin-bottom: var(--sp-3);
}
.wizard-progress .bar {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-secondary-warm));
  border-radius: inherit;
  transition: width var(--t-slow);
}
.wizard-step-label {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
  font-size: var(--fs-sm); color: var(--color-muted);
}
.wizard-step-label b { color: var(--color-text); }

.wizard-body { padding: var(--sp-6) var(--sp-5); }
.wizard-question {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  margin-bottom: var(--sp-2);
}
.wizard-help { font-size: var(--fs-base); color: var(--color-muted); margin-bottom: var(--sp-5); }

.option-grid { display: grid; gap: var(--sp-3); }
.option {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; text-align: left;
  padding: var(--sp-4);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.option:hover { border-color: var(--color-secondary); background: rgba(222,122,12,.04); transform: translateX(2px); }
.option.is-selected { border-color: var(--color-secondary); background: rgba(222,122,12,.07); }
.option .o-mark {
  flex-shrink: 0; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--color-border-strong);
}
.option.is-selected .o-mark {
  background: var(--color-secondary); border-color: var(--color-secondary);
}
.option.is-selected .o-mark::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff;
}
.option .o-text strong { display: block; font-size: var(--fs-base); font-weight: 650; }
.option .o-text small { font-size: var(--fs-sm); color: var(--color-muted); }

.wizard-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}

.wizard-result { display: grid; gap: var(--sp-4); }

/* ==================================================================
   15. ACORDEÓN Y FAQ
   ================================================================== */
.accordion { display: grid; gap: var(--sp-3); }
.acc-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t);
}
.acc-item.is-open { border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); }

.acc-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  width: 100%; text-align: left;
  padding: var(--sp-4) var(--sp-5);
  background: transparent; border: 0;
  font-size: var(--fs-base); font-weight: 650;
  transition: color var(--t-fast);
}
.acc-trigger:hover { color: var(--color-secondary); }
.acc-icon {
  position: relative; flex-shrink: 0;
  width: 20px; height: 20px;
}
.acc-icon::before, .acc-icon::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  background: var(--color-secondary); border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform var(--t);
}
.acc-icon::before { width: 13px; height: 2px; }
.acc-icon::after  { width: 2px; height: 13px; }
.acc-item.is-open .acc-icon::after { transform: translate(-50%, -50%) rotate(90deg); }

.acc-panel {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-slow);
}
.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel > div { overflow: hidden; }
.acc-panel p {
  padding: 0 var(--sp-5) var(--sp-5);
  font-size: var(--fs-base); color: var(--color-muted); margin: 0;
}

/* ==================================================================
   16. FORMULARIOS
   ================================================================== */
.form { display: grid; gap: var(--sp-4); }
.form-row { display: grid; gap: var(--sp-4); }

.field { display: grid; gap: .4rem; }
.field label { font-size: var(--fs-sm); font-weight: 650; }
.field .hint { font-size: var(--fs-xs); color: var(--color-muted); }
.field .req { color: var(--color-secondary); }

.input, .textarea, .field .select {
  width: 100%;
  padding: .8rem 1rem;
  font-family: inherit; font-size: var(--fs-base);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field .select { border-radius: var(--radius); padding-right: 2.2rem; }
.input:focus, .textarea:focus, .field .select:focus {
  outline: 0;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(222,122,12,.14);
}
.textarea { min-height: 130px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #93A3B8; }

.field.has-error .input, .field.has-error .textarea, .field.has-error .select { border-color: var(--color-danger); }
.field .error-msg { font-size: var(--fs-xs); color: var(--color-danger); display: none; }
.field.has-error .error-msg { display: block; }

.consent {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  font-size: var(--fs-sm); color: var(--color-muted);
}
.consent input { margin-top: 3px; flex-shrink: 0; width: 17px; height: 17px; accent-color: var(--color-secondary); }
.consent a { color: var(--color-secondary); text-decoration: underline; }

.form-status {
  padding: var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  display: none;
}
.form-status.is-visible { display: block; }
.form-status.is-ok {
  background: rgba(31,138,91,.08);
  border: 1px solid rgba(31,138,91,.24);
  color: #145E3E;
}

/* ==================================================================
   17. DASHBOARD (MI PORTAL)
   ================================================================== */
.dash-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, 1fr); }

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}
.stat-card .s-label {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .09em;
  color: var(--color-muted);
}
.stat-card .s-value {
  font-family: var(--font-display);
  font-size: var(--fs-3xl); line-height: 1;
  margin-top: .4rem;
}
.stat-card .s-value.is-accent { color: var(--color-secondary); }

.tramite-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: grid; gap: var(--sp-4);
}
.tramite-card .t-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap;
}
.tramite-card h3 { font-size: var(--fs-lg); }

.status {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: var(--fs-sm); font-weight: 650;
  padding: .25rem .7rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--proceso   { background: rgba(194,121,10,.1);  color: var(--color-warning); }
.status--completo  { background: rgba(31,138,91,.1);   color: var(--color-success); }
.status--pendiente { background: rgba(192,57,43,.09);  color: var(--color-danger); }
.status--revision  { background: rgba(44,107,179,.09); color: var(--color-info); }

.progress {
  height: 8px; border-radius: 4px;
  background: var(--color-surface-sunken);
  overflow: hidden;
}
.progress .bar {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-secondary-warm));
  border-radius: inherit;
}
.progress-meta {
  display: flex; justify-content: space-between; gap: var(--sp-3);
  font-size: var(--fs-sm); color: var(--color-muted);
  margin-top: .45rem;
}

.next-action {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(222,122,12,.06);
  border: 1px solid rgba(222,122,12,.18);
  border-radius: var(--radius);
  font-size: var(--fs-base);
}
.next-action b { color: var(--color-secondary-deep); }

.doc-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}
.doc-row .d-info { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.doc-row .d-info strong { display: block; font-size: var(--fs-base); }
.doc-row .d-info small { color: var(--color-muted); font-size: var(--fs-sm); }

.demo-banner {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius);
  background: rgba(44,107,179,.07);
  border: 1px solid rgba(44,107,179,.2);
  font-size: var(--fs-base);
  margin-bottom: var(--sp-6);
}

/* ==================================================================
   18. FOOTER
   ================================================================== */
.site-footer { padding-block: var(--sp-8) var(--sp-6); }

.footer-grid { display: grid; gap: var(--sp-7); }

.footer-brand-mark {
  display: inline-block;
  background: #fff;
  padding: .7rem 1rem;
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}
.footer-brand-mark img { height: 38px; width: auto; }

.footer-about p { color: var(--on-dark-muted); font-size: var(--fs-base); max-width: 42ch; }

.footer-col h3 {
  font-size: var(--fs-sm); font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: #fff; margin-bottom: var(--sp-4);
}
.footer-col ul { display: grid; gap: .6rem; }
.footer-col a {
  font-size: var(--fs-base); color: var(--on-dark-muted);
  transition: color var(--t-fast);
}
.footer-col a:hover { color: var(--color-secondary-warm); }

.footer-contact { display: grid; gap: var(--sp-3); }
.footer-contact .c-item { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-base); }
.footer-contact .c-item svg { flex-shrink: 0; margin-top: 3px; color: var(--color-secondary-warm); width: 18px; height: 18px; }
.footer-contact .c-item span { color: var(--on-dark-muted); }
.footer-contact .c-item a { color: #fff; font-weight: 600; }
.footer-contact .c-item a:hover { color: var(--color-secondary-warm); }

.footer-bottom {
  margin-top: var(--sp-7); padding-top: var(--sp-5);
  border-top: 1px solid var(--on-dark-border);
  display: flex; flex-direction: column; gap: var(--sp-3);
  font-size: var(--fs-sm); color: var(--on-dark-muted);
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.footer-bottom a:hover { color: #fff; }

.footer-legal {
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--on-dark-border);
  font-size: var(--fs-sm); color: var(--on-dark-muted);
  line-height: 1.6;
}

/* ==================================================================
   19. BOTÓN FLOTANTE DE WHATSAPP
   ------------------------------------------------------------------
   Presente en todas las páginas. El número se lee de config.js.
   ================================================================== */
.wa-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  display: flex; align-items: center; gap: var(--sp-3);
}

.wa-btn {
  position: relative;
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(140deg, #34C759, #1FA84A);
  color: #fff;
  box-shadow: 0 10px 28px rgba(31, 168, 74, .38), 0 2px 6px rgba(12,21,35,.2);
  transition: transform var(--t), box-shadow var(--t);
}
.wa-btn:hover { transform: scale(1.06); box-shadow: 0 14px 34px rgba(31,168,74,.46); }
.wa-btn svg { width: 28px; height: 28px; }

.wa-btn::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%; border: 2px solid rgba(52, 199, 89, .55);
  animation: wa-pulse 2.8s ease-out infinite;
  pointer-events: none;
}

.wa-tooltip {
  display: none;
  align-items: center; gap: var(--sp-3);
  padding: .7rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  opacity: 0; transform: translateX(10px);
  transition: opacity var(--t), transform var(--t);
}
.wa-tooltip small { display: block; font-weight: 500; color: var(--color-muted); font-size: var(--fs-xs); }
.wa-float:hover .wa-tooltip { opacity: 1; transform: translateX(0); }

@keyframes wa-pulse {
  0%   { transform: scale(1);    opacity: .8; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* ==================================================================
   20. ANIMACIONES
   ================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .07s; }
.reveal[data-delay="2"] { transition-delay: .14s; }
.reveal[data-delay="3"] { transition-delay: .21s; }
.reveal[data-delay="4"] { transition-delay: .28s; }

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

/* ==================================================================
   21. RESPONSIVE
   ------------------------------------------------------------------
   Mobile first. Puntos de control: 375 / 390 / 430 / 768 / 1024 /
   1280 / 1440.
   ================================================================== */

/* --- ≥430px ------------------------------------------------------ */
@media (min-width: 430px) {
  .hero h1 { font-size: var(--fs-4xl); }
  .wa-float { right: 20px; bottom: 20px; }
}

/* --- ≥768px (tablet) --------------------------------------------- */
@media (min-width: 768px) {
  :root { --header-h: 84px; }

  .container { padding-inline: var(--sp-6); }
  .section { padding-block: var(--sp-10); }
  .section--tight { padding-block: var(--sp-8); }

  .h1 { font-size: var(--fs-4xl); }
  .h2 { font-size: var(--fs-3xl); }
  .h3 { font-size: var(--fs-2xl); }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .brand img { height: 46px; }

  .hero { padding-block: var(--sp-10) var(--sp-11); }
  .hero h1 { font-size: var(--fs-4xl); }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }

  .search-card { padding: var(--sp-6); }

  .page-head { padding-block: var(--sp-9); }
  .page-head h1 { font-size: var(--fs-4xl); }

  .service-hero { padding-block: var(--sp-9); }
  .service-hero h1 { font-size: var(--fs-4xl); }
  .service-facts { grid-template-columns: repeat(4, 1fr); }

  .form-row { grid-template-columns: repeat(2, 1fr); }

  .dash-grid { grid-template-columns: repeat(4, 1fr); }

  .cta-band { padding: var(--sp-10) var(--sp-8); }
  .cta-band h2 { font-size: var(--fs-3xl); }

  .footer-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; }

  .wa-tooltip { display: flex; }
}

/* --- ≥1024px (desktop) ------------------------------------------- */
@media (min-width: 1024px) {
  .nav { display: block; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none; }

  /* Entre 1024 y 1279 px la barra va justa: se comprimen los enlaces y
     "Mi Portal" se reserva para ≥1280 (sigue accesible en el footer). */
  .nav-link { padding: .55rem .55rem; font-size: var(--fs-base); }
  .brand img { height: 42px; }

  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }

  .hero { padding-block: var(--sp-11) var(--sp-11); }
  .hero h1 { font-size: var(--fs-5xl); }

  .hero-layout {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    gap: var(--sp-8);
    align-items: center;
  }
  .search-card { margin-top: 0; }

  .catalog-layout { grid-template-columns: 268px 1fr; }
  .filters { position: sticky; top: calc(var(--header-h) + 20px); }
  .filter-toggle { display: none; }
  .filters[hidden] { display: block !important; }

  .service-layout { grid-template-columns: 1fr 340px; gap: var(--sp-9); }
  .service-aside { position: sticky; top: calc(var(--header-h) + 20px); }

  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; }

  .wizard-body { padding: var(--sp-8) var(--sp-7); }
  .option-grid--2 { grid-template-columns: repeat(2, 1fr); }
}

/* --- ≥1280px ------------------------------------------------------ */
@media (min-width: 1280px) {
  .nav-link { padding: .55rem .8rem; }
  .brand img { height: 46px; }
  .header-actions .btn--ghost { display: inline-flex; }
  .section { padding-block: var(--sp-11); }
  .hero-layout { gap: var(--sp-9); }
}

/* --- ≥1440px ------------------------------------------------------ */
@media (min-width: 1440px) {
  :root { --container: 1280px; }
  .hero h1 { font-size: 3.9rem; }
}

/* --- Impresión ---------------------------------------------------- */
@media print {
  .site-header, .site-footer, .wa-float, .mobile-nav, .btn { display: none !important; }
  body { color: #000; background: #fff; }
  .bg-dark { background: #fff !important; color: #000 !important; }
  .bg-dark h1, .bg-dark .lead { color: #000 !important; }
}
