/* ==========================================================================
   Sistema visual compartido · Registro de Ingreso
   Lo usan el kiosco (index.html), el panel (admin.html) y la validación (/v/).
   ========================================================================== */
:root {
  /* Neutros (una sola familia, fría) */
  --ink: #0b1220;
  --ink-2: #111a2b;
  --ink-3: #1b2638;
  --text: #0f172a;
  --muted: #566173;
  --faint: #8a94a6;
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e6e9ef;
  --line-strong: #d3d9e2;

  /* Acento único */
  --teal: #0f766e;
  --teal-2: #115e59;
  --teal-br: #2dd4bf;
  --teal-wash: #effaf8;
  --teal-ring: rgba(15, 118, 110, .16);
  --primary: var(--teal);
  --primary-50: var(--teal-wash);

  /* Semánticos */
  --verde: #047857; --verde-b: #10b981; --verde-bg: #ecfdf5; --verde-body: #064e3b; --verde-chip: #a7f3d0;
  --ambar: #b45309; --ambar-b: #f59e0b; --ambar-bg: #fffbeb; --ambar-body: #78350f; --ambar-chip: #fcd9a0;
  --rojo: #b91c1c; --rojo-b: #ef4444; --rojo-bg: #fef2f2; --rojo-body: #7f1d1d; --rojo-chip: #fbc4c4;

  /* Tipografía */
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sans: var(--font);
  --body: var(--font);

  /* Radios, sombras, movimiento */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 999px;
  --sh-xs: 0 1px 2px rgba(11, 18, 32, .05);
  --sh-sm: 0 1px 2px rgba(11, 18, 32, .04), 0 2px 8px -2px rgba(11, 18, 32, .06);
  --sh-md: 0 1px 2px rgba(11, 18, 32, .04), 0 12px 32px -12px rgba(11, 18, 32, .18);
  --sh-lg: 0 2px 4px rgba(11, 18, 32, .04), 0 28px 60px -24px rgba(11, 18, 32, .32);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: .18s var(--ease);

  /* Capas */
  --z-header: 20; --z-fab: 60; --z-modal: 100; --z-pop: 110; --z-top: 120;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(1200px 420px at 50% -180px, rgba(15, 118, 110, .07), transparent 70%),
    var(--canvas);
  background-attachment: fixed;
}
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--teal); }
img { max-width: 100%; }
::selection { background: rgba(45, 212, 191, .28); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

.oculto { display: none !important; }
.jak { font-family: var(--font); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--mono); }

/* ---------- Header ---------- */
header.top {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(11, 18, 32, .94);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.top-in { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 12px 28px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(45, 212, 191, .22), rgba(45, 212, 191, .06));
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .25);
}
.brand .t { color: #fff; font-weight: 600; font-size: 15px; line-height: 1.15; letter-spacing: -.01em; }
.brand .s { color: #8a94a6; font-size: 10.5px; letter-spacing: .14em; font-weight: 500; text-transform: uppercase; margin-top: 1px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.hlink {
  color: #aeb7c6; font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none;
  padding: 7px 12px; border-radius: var(--r-sm); transition: background var(--t), color var(--t);
}
.hlink:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.hlink.active { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .35); }
#logout {
  color: #aeb7c6; font-size: 13.5px; font-weight: 500; text-decoration: none; cursor: pointer;
  padding: 7px 12px; border-radius: var(--r-sm); transition: background var(--t), color var(--t);
}
#logout:hover { background: rgba(239, 68, 68, .12); color: #fca5a5; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 48px; padding: 0 20px; width: 100%;
  border-radius: var(--r-md); border: 1px solid transparent; cursor: pointer;
  font-family: var(--font); font-weight: 600; font-size: 15px; letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap; user-select: none;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t), transform .08s var(--ease), opacity var(--t);
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.995); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { flex: 0 0 auto; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 10px 22px -12px rgba(11, 18, 32, .7); }
.btn-primary:hover:not(:disabled) { background: var(--ink-3); }
.btn-verde { background: var(--teal); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 10px 22px -12px rgba(15, 118, 110, .75); }
.btn-verde:hover:not(:disabled) { background: var(--teal-2); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); background: var(--teal-wash); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: #c3cad6; }
.btn-danger { background: var(--rojo); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #991b1b; }

/* ---------- Campos ---------- */
.input, .fg input, .login-card input {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  font-size: 15px; outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.input:hover, .fg input:hover, .login-card input:hover { border-color: #bcc4d1; }
.input:focus, .fg input:focus, .login-card input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-ring); }
.input::placeholder, .fg input::placeholder { color: var(--faint); }
.field-label, .fg label, .login-card label {
  display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px;
}

/* ---------- Login ---------- */
#login {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: none; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(15, 118, 110, .10), transparent 70%),
    var(--canvas);
}
.login-card {
  width: 100%; max-width: 400px; padding: 36px 34px 30px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  animation: rise .35s var(--ease) both;
}
.login-card .lg, .login-card .badge {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 16px;
  background: var(--ink); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px -10px rgba(11, 18, 32, .6);
}
.login-card h1 { text-align: center; font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; }
.login-card p { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 26px; }
.login-card input { margin-bottom: 16px; }
.login-card button[type="submit"] { width: 100%; height: 46px; margin-top: 4px; }
.login-card .err {
  display: none; margin-top: 14px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--rojo-bg); color: var(--rojo); font-size: 13.5px; font-weight: 500; text-align: center;
}

/* ---------- Superficies ---------- */
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }

/* ---------- Animaciones ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 640px) {
  .top-in { padding: 10px 16px; gap: 12px; min-height: 56px; }
  .brand .s { display: none; }
}
