/* ---- Tótem MedicalCare — kiosk styles ---- */

:root {
  --t-bg: #0A0F1E;
  --t-bg-2: #0E1530;
  --t-surface: rgba(255,255,255,0.04);
  --t-surface-strong: rgba(255,255,255,0.08);
  --t-border: rgba(255,255,255,0.10);
  --t-border-strong: rgba(255,255,255,0.18);
  --t-text: #FFFFFF;
  --t-muted: #8A93A6;
  --t-muted-2: #5A6275;
  --t-primary: #1E90FF;
  --t-primary-2: #0066CC;
  --t-primary-soft: rgba(30,144,255,0.14);
  --t-success: #4CAF50;
  --t-warn: #FFB547;
  --t-error: #FF6B6B;
  --t-accent: #5DD3FF;
  --kiosk-w: 1280px;
  --kiosk-h: 800px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #060912;
  color: var(--t-text);
  overflow: hidden;
  height: 100vh;
}

/* ---- Stage: scale kiosk to viewport ---- */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 800px at 30% 20%, rgba(30,144,255,0.08), transparent 60%),
    radial-gradient(1000px 700px at 80% 90%, rgba(93,211,255,0.05), transparent 60%),
    #050810;
}

.tablet {
  position: absolute;
  width: var(--kiosk-w);
  height: var(--kiosk-h);
  border-radius: 36px;
  background: #0a0a0a;
  padding: 22px;
  box-shadow:
    0 60px 120px -40px rgba(0,0,0,0.8),
    0 0 0 2px rgba(255,255,255,0.04),
    inset 0 0 0 1px rgba(255,255,255,0.05);
  transform-origin: top left;
}

.tablet::before {
  /* camera dot */
  content: '';
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #1a1a1a;
  box-shadow: inset 0 0 0 1px #2a2a2a;
}

.kiosk {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(30,144,255,0.10), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(93,211,255,0.06), transparent 60%),
    linear-gradient(180deg, #0B1224 0%, #070B17 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Subtle grain */
.kiosk::after {
  content:'';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
  opacity: 0.6;
}

/* ---- Top bar inside kiosk ---- */
.topbar {
  position: relative;
  z-index: 5;
  height: 72px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--t-border);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(12px);
}

.topbar .brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 16px; font-weight: 600; letter-spacing: 0.02em;
}
.topbar .brand .logo {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1E90FF, #5DD3FF);
  display: grid; place-items: center;
  box-shadow: 0 4px 16px -4px rgba(30,144,255,0.6);
}
.topbar .brand .org {
  color: var(--t-muted); font-weight: 500; margin-left: 4px;
}
.topbar .meta {
  display: flex; align-items: center; gap: 24px;
  color: var(--t-muted); font-size: 14px; font-variant-numeric: tabular-nums;
}
.topbar .meta .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--t-success);
  box-shadow: 0 0 12px var(--t-success);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%,100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---- Main content area ---- */
.main {
  position: relative;
  z-index: 4;
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

/* ---- Bottom bar ---- */
.bottombar {
  position: relative;
  z-index: 5;
  height: 64px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-top: 1px solid var(--t-border);
  background: rgba(255,255,255,0.02);
  color: var(--t-muted);
  font-size: 13px;
}
.bottombar .step-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--t-primary-soft);
  border: 1px solid rgba(30,144,255,0.3);
  color: #BFE0FF;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bottombar .secondary-actions {
  display: flex; gap: 12px;
}

/* ---- Generic typography ---- */
.h-display { font-size: 64px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.h-title   { font-size: 48px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.h-section { font-size: 36px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
.h-body    { font-size: 22px; font-weight: 400; line-height: 1.4; color: #C7CCD9; }
.h-label   { font-size: 14px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-muted); }

/* ---- Buttons ---- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease, background 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  height: 72px;
  font-size: 22px;
  padding: 0 36px;
  color: white;
  background: linear-gradient(135deg, var(--t-primary) 0%, var(--t-primary-2) 100%);
  box-shadow:
    0 14px 30px -10px rgba(30,144,255,0.55),
    inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover:not([disabled]) {
  filter: brightness(1.08);
  transform: scale(1.01);
}

.btn-secondary {
  height: 72px;
  font-size: 22px;
  padding: 0 36px;
  background: var(--t-surface-strong);
  color: var(--t-text);
  border: 1px solid var(--t-border-strong);
}
.btn-secondary:hover:not([disabled]) {
  background: rgba(255,255,255,0.12);
}

.btn-ghost {
  height: 44px;
  font-size: 14px;
  padding: 0 18px;
  background: transparent;
  color: var(--t-muted);
  border: 1px solid var(--t-border);
  border-radius: 999px;
}
.btn-ghost:hover { color: white; border-color: var(--t-border-strong); }

.btn-danger-ghost {
  height: 44px; font-size: 14px; padding: 0 18px;
  background: transparent; color: var(--t-error);
  border: 1px solid rgba(255,107,107,0.3);
  border-radius: 999px;
}
.btn-danger-ghost:hover { background: rgba(255,107,107,0.08); }

.btn-block { width: 100%; }
.btn-xl { height: 96px; font-size: 28px; border-radius: 20px; }

/* ---- Cards ---- */
.card {
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: 20px;
  padding: 28px;
  transition: all 0.2s;
}
.card-tap {
  cursor: pointer;
}
.card-tap:hover {
  background: var(--t-surface-strong);
  border-color: var(--t-border-strong);
  transform: translateY(-2px);
}
.card-selected {
  border-color: var(--t-primary);
  background: var(--t-primary-soft);
  box-shadow: 0 0 0 3px rgba(30,144,255,0.18), 0 12px 40px -10px rgba(30,144,255,0.4);
}

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.fade-up { animation: fadeUp 0.4s ease both; }
.fade-in { animation: fadeIn 0.3s ease both; }
.scale-in { animation: scaleIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.shake { animation: shake 0.4s ease; }

/* ---- Demo helper ----
   Arranca plegado (.demo-tip-chip): una etiqueta chica que no tapa nada del
   fondo. Sólo al tocarla se abre el panel completo (.demo-tip-expanded, el
   mismo look que tenía antes fijo en pantalla) — pensado para que grabar un
   video del tótem no muestre la lista de DNIs de prueba tapando el "Toque la
   pantalla para comenzar" de atrás. */
.demo-tip {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 200;
  color: #C7CCD9;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.demo-tip-chip {
  background: rgba(20,25,40,0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-accent, #C7CCD9);
  cursor: pointer;
  line-height: 1.4;
}
.demo-tip-expanded {
  background: rgba(20,25,40,0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 12px;
  max-width: 320px;
  max-height: min(60vh, 360px);
  overflow-y: auto;
  line-height: 1.6;
}
.demo-tip h4 {
  margin: 0 0 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t-accent);
  font-weight: 600;
}
.demo-tip code {
  color: #FFD479;
  background: rgba(255,212,121,0.08);
  padding: 1px 6px;
  border-radius: 4px;
}
.demo-tip .tip-row { display: flex; justify-content: space-between; gap: 8px; }
.demo-tip .tip-row + .tip-row { margin-top: 2px; }
.demo-tip .tip-row span:last-child { color: #8A93A6; font-family: 'Inter'; font-size: 11px; }

/* ---- Print styles for ticket ---- */
#print-ticket {
  position: fixed;
  left: -10000px; top: 0;
  width: 80mm;
  background: white;
  color: black;
  padding: 6mm;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11pt;
}
@media print {
  html, body { background: white !important; }
  body > *:not(#print-ticket) { display: none !important; }
  #print-ticket {
    position: static !important;
    left: auto !important;
    display: block !important;
    width: 80mm !important;
    margin: 0 !important;
    padding: 6mm !important;
    background: white !important;
    color: black !important;
  }
  #print-ticket * {
    color: black !important;
    background: white !important;
    box-shadow: none !important;
  }
  #print-ticket .t-muted { color: #444 !important; }
  #print-ticket .t-divider { border-top: 1px solid #999 !important; }
  #print-ticket .t-divider-dashed { border-top: 1px dashed #555 !important; }
  @page { size: 80mm auto; margin: 0; }
}
