
    /* ---------- Tipografía (en la carpeta «fuentes», junto a este archivo) ---------- */

    @font-face {
      font-family: "Public Sans";
      src: url("fuentes/public-sans-latin-wght-normal.woff2") format("woff2");
      font-weight: 100 900;
      font-style: normal;
      font-display: swap;
    }

    /* Solo para el nombre en la constancia: mide lo mismo que la Arial de la plantilla. */
    @font-face {
      font-family: "Arimo";
      src: url("fuentes/arimo-latin-700-normal.woff2") format("woff2");
      font-weight: 700;
      font-style: normal;
      font-display: swap;
    }

    /* ---------- Valores base ----------
       Guinda y oro salen de la constancia. Para cambiarlos basta con tocar estas variables. */

    :root {
      --vp-narrow: 375px;
      --vp-medium: 768px;
      --vp-wide: 1280px;

      --fondo: #5e1c25;         /* fondo de la página */
      --guinda: #74252e;        /* título, marco y acción principal */
      --guinda-fuerte: #5a1c24; /* acción principal al pasar el cursor */
      --oro: #b98a52;           /* línea interior del marco y sello sin estampar */
      --hoja: #ffffff;          /* el papel */
      --tinta: #241a1c;         /* texto */
      --tinta-suave: #5f5557;   /* texto de apoyo */
      --linea: #8a7f81;         /* borde de los campos */
      --velo: #f7f0e6;          /* opción resaltada en la lista */
      --error: #b3261e;         /* mensajes de error */
      --error-velo: #fdf1ef;    /* fondo de los avisos de error */
      --foco: #2d6cdf;          /* anillo de foco */
      --sobre-fondo: #f3e6d8;   /* texto sobre el fondo */

      --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

      --e1: 0.25rem;
      --e2: 0.5rem;
      --e3: 0.75rem;
      --e4: 1rem;
      --e5: 1.5rem;
      --e6: 2rem;
      --e7: 3rem;

      --alto-control: 3.25rem;
      --radio: 6px;
    }

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

    [hidden] {
      display: none !important;
    }

    html {
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
    }

    body {
      margin: 0;
      min-height: 100vh;
      min-height: 100dvh;
      background: var(--fondo);
      color: var(--tinta);
      font: 400 1rem/1.5 var(--sans);
    }

    :focus-visible {
      outline: 2px solid var(--foco);
      outline-offset: 2px;
    }

    /* ---------- Página y hoja ---------- */

    .pagina {
      width: 100%;
      max-width: var(--vp-wide);
      margin-inline: auto;
      padding: var(--e2) var(--e2) var(--e7);
    }

    .hoja {
      position: relative;
      max-width: 32.5rem;
      margin-inline: auto;
      padding: 2.25rem 1.75rem 2rem;
      background: var(--hoja);
    }

    /* Marco doble, como el de un diploma: guinda por fuera, oro por dentro. */
    .hoja::before,
    .hoja::after {
      content: "";
      position: absolute;
      pointer-events: none;
    }

    .hoja::before {
      inset: 7px;
      border: 2px solid var(--guinda);
    }

    .hoja::after {
      inset: 12px;
      border: 1px solid var(--oro);
    }

    @media (min-width: 768px) {
      .pagina {
        padding-block: var(--e7);
      }

      .hoja {
        padding: 3.25rem 3rem 3rem;
      }
    }

    /* ---------- Encabezado y sello ---------- */

    .encabezado {
      margin-bottom: var(--e5);
      text-align: center;
    }

    .sello {
      display: block;
      width: 4.5rem;
      height: 4.5rem;
      margin: 0 auto var(--e4);
      color: var(--oro);
      transition: color 0.3s ease;
    }

    .sello path {
      fill: none;
      stroke: currentColor;
      stroke-width: 0.6;
    }

    .sello .palomita {
      stroke-width: 3;
      stroke-linecap: round;
      stroke-linejoin: round;
      opacity: 0;
      transition: opacity 0.2s ease 0.15s;
    }

    .sellado .sello {
      color: var(--guinda);
    }

    .sellado .sello .palomita {
      opacity: 1;
    }

    @media (min-width: 768px) {
      .encabezado {
        margin-bottom: var(--e6);
      }

      .sello {
        width: 5.5rem;
        height: 5.5rem;
      }
    }

    h1 {
      margin: 0 0 var(--e3);
      color: var(--guinda);
      font: 800 clamp(1.75rem, 1.3rem + 2.2vw, 2.375rem) / 1.1 var(--sans);
      letter-spacing: -0.01em;
      text-wrap: balance;
    }

    h2 {
      margin: 0 0 var(--e4);
      font: 700 1.375rem/1.2 var(--sans);
      text-wrap: balance;
    }

    .entrada {
      max-width: 34ch;
      margin: 0 auto;
      color: var(--tinta-suave);
      text-wrap: pretty;
    }

    /* ---------- Campos ---------- */

    .campo {
      margin-bottom: var(--e5);
    }

    .campo > label {
      display: block;
      margin-bottom: var(--e2);
      font-weight: 600;
    }

    input[type="text"] {
      width: 100%;
      min-height: var(--alto-control);
      padding: 0 0.875rem;
      border: 1px solid var(--linea);
      border-radius: var(--radio);
      background: var(--hoja);
      color: var(--tinta);
      font: inherit;
      appearance: none;
    }

    input[type="text"]::placeholder {
      color: var(--tinta-suave);
      opacity: 1;
    }

    input[type="text"][aria-invalid="true"] {
      border-color: var(--error);
      box-shadow: inset 0 0 0 1px var(--error);
    }

    .ayuda,
    .error {
      margin: var(--e2) 0 0;
      font-size: 0.875rem;
      line-height: 1.4;
    }

    .ayuda {
      color: var(--tinta-suave);
    }

    .error {
      display: flex;
      gap: 0.375rem;
      align-items: flex-start;
      color: var(--error);
      font-weight: 500;
    }

    .error::before {
      content: "!";
      flex: none;
      display: grid;
      place-items: center;
      width: 1.125rem;
      height: 1.125rem;
      margin-top: 0.0625rem;
      border-radius: 50%;
      background: var(--error);
      color: var(--hoja);
      font-size: 0.75rem;
      font-weight: 700;
      line-height: 1;
    }

    /* ---------- Dropdown con búsqueda ---------- */

    .combo {
      position: relative;
    }

    .combo input {
      padding-right: 3.25rem;
      text-overflow: ellipsis;
    }

    .combo-boton {
      position: absolute;
      top: 0;
      right: 0;
      display: grid;
      place-items: center;
      width: 3rem;
      height: var(--alto-control);
      padding: 0;
      border: 0;
      border-radius: var(--radio);
      background: none;
      color: var(--tinta);
      cursor: pointer;
    }

    .combo-boton svg {
      width: 1.25rem;
      height: 1.25rem;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.75;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .combo input[aria-expanded="true"] + .combo-boton svg {
      transform: rotate(180deg);
    }

    .combo-panel {
      position: absolute;
      z-index: 10;
      top: calc(100% + 4px);
      left: 0;
      right: 0;
      overflow: hidden;
      border: 1px solid var(--tinta);
      border-radius: var(--radio);
      background: var(--hoja);
      box-shadow: 0 14px 28px -10px rgb(36 26 28 / 0.45);
    }

    .combo-panel ul {
      max-height: min(15rem, 45vh);
      margin: 0;
      padding: var(--e1) 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      list-style: none;
    }

    .combo-panel ul:empty,
    .combo-aviso:empty {
      display: none;
    }

    .combo-panel li {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--e3);
      min-height: 3rem;
      padding: var(--e2) 0.875rem;
      line-height: 1.3;
      cursor: pointer;
    }

    .combo-panel li.activa {
      background: var(--velo);
      box-shadow: inset 3px 0 0 var(--guinda);
    }

    .combo-panel li[aria-selected="true"] {
      font-weight: 600;
    }

    .combo-panel li[aria-selected="true"]::after {
      content: "✓" / "";
    }

    .combo-aviso {
      margin: 0;
      padding: var(--e3) 0.875rem;
      color: var(--tinta-suave);
      font-size: 0.9375rem;
      line-height: 1.4;
    }

    /* ---------- Botones y avisos ---------- */

    .boton {
      display: block;
      width: 100%;
      min-height: var(--alto-control);
      padding: 0 var(--e5);
      border: 1px solid var(--guinda);
      border-radius: var(--radio);
      background: var(--guinda);
      color: var(--hoja);
      font: 600 1.0625rem/1.2 var(--sans);
      cursor: pointer;
    }

    .boton:active {
      transform: translateY(1px);
    }

    .boton[aria-busy="true"] {
      cursor: progress;
    }

    .boton-secundario {
      background: transparent;
      color: var(--guinda);
    }

    .aviso {
      margin: 0 0 var(--e4);
      padding: var(--e3) var(--e4);
      border-left: 3px solid var(--error);
      background: var(--error-velo);
      font-size: 0.9375rem;
      line-height: 1.45;
    }

    .aviso p {
      margin: 0;
    }

    .enlace {
      min-height: 2.75rem;
      padding: 0;
      border: 0;
      background: none;
      color: var(--tinta);
      font: inherit;
      font-weight: 600;
      text-align: left;
      text-decoration: underline;
      text-underline-offset: 0.15em;
      cursor: pointer;
    }

    /* ---------- Resultado ---------- */

    .resultado h2 {
      text-align: center;
    }

    /* El título recibe el foco para que los lectores de pantalla lo anuncien; no es un control. */
    .resultado h2:focus-visible {
      outline: none;
    }

    .constancia {
      display: block;
      width: 100%;
      height: auto;
      margin-bottom: var(--e4);
      border: 1px solid var(--linea);
      background: var(--hoja);
    }

    .resultado .boton + .boton {
      margin-top: var(--e3);
    }

    /* ---------- Aviso emergente: sin registro ---------- */

    .dialogo {
      width: min(26rem, calc(100vw - 2rem));
      padding: 0;
      border: 0;
      border-top: 4px solid var(--error);
      background: var(--hoja);
      color: var(--tinta);
      box-shadow: 0 24px 48px -12px rgb(20 8 10 / 0.6);
    }

    .dialogo::backdrop {
      background: rgb(36 12 16 / 0.72);
    }

    .dialogo-contenido {
      padding: var(--e6) var(--e5) var(--e5);
    }

    .dialogo p {
      margin: 0 0 var(--e5);
      text-wrap: pretty;
    }

    /* ---------- Cursor y movimiento ---------- */

    @media (hover: hover) {
      input[type="text"]:hover {
        border-color: var(--tinta);
      }

      .combo-panel li:hover {
        background: var(--velo);
      }

      .boton:hover {
        background: var(--guinda-fuerte);
      }

      .boton-secundario:hover {
        background: var(--velo);
      }
    }

    @media (prefers-reduced-motion: no-preference) {
      /* Al cargar, el sello se traza una sola vez. */
      .sello .trazo {
        stroke-dasharray: 1;
        stroke-dashoffset: 1;
        animation: trazar 1.1s cubic-bezier(0.6, 0, 0.2, 1) forwards;
        animation-delay: calc(var(--i) * 45ms);
      }

      /* Al encontrar el registro, el sello se estampa. */
      .sellado .sello {
        animation: estampar 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
      }

      .combo-boton svg {
        transition: transform 0.15s ease;
      }

      .dialogo[open] {
        animation: aparecer 0.18s ease-out;
      }
    }

    @keyframes trazar {
      to {
        stroke-dashoffset: 0;
      }
    }

    @keyframes estampar {
      from {
        transform: scale(1.25) rotate(-8deg);
      }
    }

    @keyframes aparecer {
      from {
        opacity: 0;
        transform: translateY(8px);
      }
    }
  