/* LinkTIC: tokens y componentes compartidos por el formulario y el panel.
   Colores tomados de linktic.com; los pares de texto se midieron contra WCAG 2.2 AA. */

@font-face { font-family: "Satoshi"; src: url("fonts/satoshi-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("fonts/satoshi-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("fonts/satoshi-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Clash Display"; src: url("fonts/clash-display-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Clash Display"; src: url("fonts/clash-display-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;

  /* Primitivos (no usar directamente en componentes) */
  --blue-50: #f2f8ff;
  --blue-100: #e8f4ff;
  --blue-500: #0094ff;   /* azul LinkTIC: gráficos e indicadores, 3,14:1 sobre blanco */
  --blue-700: #015b9d;   /* texto y botones, 7,04:1 con blanco */
  --blue-800: #01497e;
  --navy-900: #001d33;
  --cyan-400: #01d9ff;
  --green-500: #1cce02;
  --green-700: #117a02;  /* 5,51:1 sobre blanco */
  --green-50: #eefbea;
  --red-700: #b42318;    /* 6,57:1 sobre blanco */
  --red-50: #fdeeec;
  --ink-900: #171725;
  --gray-600: #5a5d66;   /* 6,15:1 sobre el fondo */
  --gray-500: #7b8597;   /* bordes de controles, 3,72:1 sobre blanco */
  --gray-300: #d9dce3;
  --white: #ffffff;

  /* Semánticos */
  --color-bg-page: var(--blue-50);
  --color-bg-surface: var(--white);
  --color-bg-selected: var(--blue-100);
  --color-bg-inverse: var(--navy-900);
  --color-text: var(--ink-900);
  --color-text-secondary: var(--gray-600);
  --color-text-inverse: var(--white);
  --color-text-link: var(--blue-700);
  --color-accent-solid: var(--blue-700);
  --color-accent-solid-hover: var(--blue-800);
  --color-accent-graphic: var(--blue-500);
  --color-accent-on-inverse: var(--cyan-400);
  --color-border: var(--gray-300);
  --color-border-control: var(--gray-500);
  --color-focus: var(--blue-700);
  --color-success-text: var(--green-700);
  --color-success-bg: var(--green-50);
  --color-success-graphic: var(--green-500);
  --color-danger-text: var(--red-700);
  --color-danger-bg: var(--red-50);

  --font-display: "Clash Display", "Satoshi", system-ui, sans-serif;
  --font-body: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-card: 20px;
  --radius-control: 14px;
  --shadow-ticket: 4px 4px 35px 12px rgba(164, 192, 234, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-page);
  color: var(--color-text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
main { flex: 1 0 auto; width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--color-text-link); }
.oculto { display: none !important; }
.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; }

/* Foco visible: 2px, 7:1 sobre blanco y 6,6:1 sobre el fondo */
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

.saltar {
  position: absolute; left: 16px; top: -48px; z-index: 20;
  background: var(--color-bg-surface); color: var(--color-text-link);
  padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.saltar:focus { top: 12px; }

/* Encabezado */
.sitio-header { background: var(--color-bg-surface); border-bottom: 1px solid var(--color-border); }
.sitio-header .contenedor { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.sitio-header img { display: block; height: 20px; width: auto; }
.sitio-header .seccion { color: var(--color-text-secondary); font-size: 14px; font-weight: 500; }

.contenedor { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .contenedor { padding: 0 24px; } }

/* Pie con el logo LinkTIC */
.sitio-footer { background: var(--color-bg-inverse); color: var(--color-text-inverse); margin-top: 64px; }
.sitio-footer .contenedor { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 28px; }
.sitio-footer img { display: block; width: 108px; height: auto; }
.sitio-footer p { color: #b8c4d6; font-size: 14px; } /* 9,7:1 sobre navy */

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px;
  font: 500 16px/1.2 var(--font-display); letter-spacing: .01em;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  background: var(--color-accent-solid); color: var(--color-text-inverse);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--color-accent-solid-hover); }
.btn.sec { background: var(--color-bg-surface); color: var(--color-text-link); border-color: var(--color-border-control); }
.btn.sec:hover { background: var(--color-bg-selected); border-color: var(--color-accent-solid); }
.btn[aria-disabled="true"] { opacity: .6; cursor: progress; }

/* Ticket: muescas laterales y línea perforada, el motivo del reto */
.ticket {
  position: relative;
  background: var(--color-bg-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-ticket);
}
.ticket > .parte { padding: 28px 24px; }
@media (min-width: 640px) { .ticket > .parte { padding: 32px; } }
.ticket > .corte { position: relative; height: 0; border-top: 2px dashed var(--color-border); margin: 0 24px; }
.ticket > .corte::before, .ticket > .corte::after {
  content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--color-bg-page);
}
.ticket > .corte::before { left: -36px; }
.ticket > .corte::after { right: -36px; }

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