/*!
 * Opina · © 2026 Matías Exequiel Oyola — OM Soluciones Bioquímicas. Todos los derechos reservados.
 * Obra protegida por la Ley 11.723 (Argentina).
 */
/* ===== Kiosco de satisfacción — tablet Android, pantalla completa ===== */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #4a505c;
  --ink-3: #7b8190;
  --line: #e3e6eb;
  --green: #17a34a;  --green-press: #128a3d;
  --amber: #f0b400;  --amber-press: #d29e00;  --amber-ink: #2d2300;
  --red: #dc2626;    --red-press: #b91c1c;
  --blue: #2457d6;
  --radius: 28px;
  --gap: clamp(12px, 2vw, 28px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: var(--font);
  overscroll-behavior: none;          /* sin "tirar para recargar" */
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;          /* sin zoom por doble toque */
  overflow: hidden;
}
body {
  display: flex; flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 4px solid var(--blue); outline-offset: 4px; }
.sr-only { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

/* ----- Cabecera ----- */
.brand {
  display: flex; align-items: center; gap: 16px;
  min-height: 56px; flex: 0 0 auto;
}
.logo { max-height: clamp(44px, 9vh, 88px); max-width: 32vw; object-fit: contain; }
.lab-name { font-size: clamp(18px, 2.2vw, 28px); font-weight: 600; color: var(--ink-2); }

main { flex: 1 1 auto; display: flex; min-height: 0; }
.screen {
  flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0;
  animation: fade .18s ease-out;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ----- Inicio ----- */
.question {
  margin: clamp(8px, 2vh, 24px) 0 clamp(16px, 3vh, 36px);
  font-size: clamp(28px, 4.4vw, 60px); line-height: 1.12; font-weight: 750; letter-spacing: -0.01em;
  text-wrap: balance;
}
.faces {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap);
}
.face {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh;
  border-radius: var(--radius); color: #fff;
  box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 10px 24px -12px rgba(0,0,0,.35);
  transition: transform .08s ease, filter .2s ease, opacity .2s ease;
}
.face--buena   { background: var(--green); }
.face--regular { background: var(--amber); color: var(--amber-ink); }
.face--mala    { background: var(--red); }
.face.pressed  { transform: scale(.97); }
.face--buena.pressed   { background: var(--green-press); }
.face--regular.pressed { background: var(--amber-press); }
.face--mala.pressed    { background: var(--red-press); }
.face-svg { width: clamp(84px, 14vw, 200px); height: clamp(84px, 14vw, 200px); filter: drop-shadow(0 4px 6px rgba(0,0,0,.18)); }
.face-label { font-size: clamp(24px, 3.2vw, 44px); font-weight: 750; }
.faces.cooldown .face { opacity: .45; filter: saturate(.6); }

.home-extras {
  display: flex; justify-content: center; gap: var(--gap); flex-wrap: wrap;
  margin-top: clamp(12px, 2.5vh, 28px);
}
.ghost {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; min-height: 60px;
  border-radius: 999px; background: var(--surface); border: 2px solid var(--line);
  font-size: clamp(17px, 1.8vw, 22px); font-weight: 600; color: var(--ink-2);
}
.ghost.pressed { background: #eceef2; }
.ghost-icon { font-size: 1.2em; }
.privacy { text-align: center; color: var(--ink-3); font-size: 14px; margin: 10px 0 0; }

/* ----- Pantallas secundarias ----- */
.subq {
  font-size: clamp(26px, 3.6vw, 48px); font-weight: 750; margin: clamp(8px, 2vh, 20px) 0 clamp(16px, 3vh, 32px);
  text-align: center; text-wrap: balance;
}
.options {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: var(--gap);
}
.option {
  flex: 1 1 260px; max-width: 380px;
  min-height: clamp(76px, 13vh, 130px); padding: 12px 18px;
  border-radius: 20px; background: var(--surface); border: 2px solid var(--line);
  font-size: clamp(20px, 2.3vw, 30px); font-weight: 650; text-align: center;
  box-shadow: 0 6px 16px -12px rgba(0,0,0,.4);
}
.option.pressed { background: #e8eefc; border-color: var(--blue); transform: scale(.98); }
.kinds { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.kind {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  border-radius: var(--radius); font-size: clamp(26px, 3.4vw, 44px); font-weight: 750;
  background: var(--surface); border: 3px solid var(--line);
}
.kind.pressed { background: #e8eefc; border-color: var(--blue); }
.kind-icon {
  display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 1.2em;
}
.kind--queja .kind-icon { background: var(--red); }
.kind--sugerencia .kind-icon { background: var(--blue); }

.skip {
  align-self: center; margin-top: clamp(12px, 2.5vh, 28px);
  padding: 14px 34px; min-height: 60px; border-radius: 999px;
  font-size: clamp(18px, 1.9vw, 24px); font-weight: 600; color: var(--ink-2);
  background: transparent; border: 2px solid var(--line);
}
.skip.pressed { background: #eceef2; }
.timer { height: 6px; background: var(--line); border-radius: 3px; margin-top: 16px; overflow: hidden; }
.timer-bar { height: 100%; width: 100%; background: var(--ink-3); transform-origin: left; }
.timer-bar.run { animation-name: shrink; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.qr {
  align-self: center; width: min(52vh, 70vw); height: min(52vh, 70vw);
  background: #fff; padding: 16px; border-radius: 20px; border: 2px solid var(--line);
  image-rendering: pixelated;
}
.hint { text-align: center; color: var(--ink-2); font-size: clamp(16px, 1.8vw, 22px); }

/* ----- Gracias ----- */
.thanks { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.thanks-check {
  display: grid; place-items: center; width: clamp(110px, 18vh, 180px); height: clamp(110px, 18vh, 180px);
  border-radius: 50%; background: var(--green); color: #fff; font-size: clamp(64px, 11vh, 110px); font-weight: 800;
  animation: pop .35s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.thanks-text { font-size: clamp(32px, 5vw, 68px); font-weight: 750; margin: 0; text-align: center; }

/* ----- Vinculación y mantenimiento ----- */
.admin-ish { max-width: 900px; margin: 0 auto; width: 100%; justify-content: center; font-size: 18px; }
.admin-ish h2 { font-size: 30px; margin: 0 0 8px; }
.admin-ish input {
  width: 100%; font: inherit; font-size: 22px; padding: 16px; border-radius: 14px;
  border: 2px solid var(--line); background: #fff; -webkit-user-select: text; user-select: text;
  font-family: ui-monospace, "Roboto Mono", monospace; letter-spacing: .02em;
}
.row { display: flex; gap: 12px; margin-top: 16px; }
.row.wrap { flex-wrap: wrap; }
.primary, .secondary { padding: 14px 22px; border-radius: 12px; font-weight: 650; min-height: 54px; }
.primary { background: var(--blue); color: #fff; }
.secondary { background: #fff; border: 2px solid var(--line); }
.error { color: var(--red); font-weight: 600; min-height: 1.4em; }
.maint-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0; }
.maint-grid dt { color: var(--ink-3); }
.maint-grid dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ----- Indicador discreto de sincronización ----- */
.status {
  position: fixed; right: 10px; bottom: 8px; min-width: 10px; height: 10px; border-radius: 5px;
  background: #b9c0cc; font-size: 11px; line-height: 10px; color: #fff; padding: 0; opacity: .7;
}
.status.ok { background: var(--green); }
.status.pending { background: var(--amber); }
.status.problem { background: var(--red); }

/* ----- Vertical: caritas apiladas ----- */
@media (orientation: portrait) {
  .faces { grid-template-columns: 1fr; grid-template-rows: repeat(3, 1fr); }
  .face { flex-direction: row; gap: 5vw; }
  .face-svg { width: clamp(70px, 14vh, 150px); height: clamp(70px, 14vh, 150px); }
  .kinds { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .screen, .thanks-check { animation: none; }
  .face, .option, .kind { transition: none; }
}

/* ----- Marca y sello de autoría ----- */
.seal {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 10px; font-size: 12px; color: var(--ink-3); line-height: 1.2; flex: 0 0 auto;
}
.seal b { color: var(--ink-2); font-weight: 700; }
.seal-om { height: 14px; width: auto; opacity: .85; }
.setup-logo { width: min(260px, 60vw); height: auto; display: block; margin: 0 0 18px; }
.about-logos { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-bottom: 8px; }
.about-logos img:first-child { height: 64px; width: auto; }
.about-logos img:last-child { height: 40px; width: auto; }
.about-pie { font-weight: 700; color: var(--ink-2); margin: 6px 0; }
.about-lic {
  white-space: pre-wrap; font: 14px/1.5 var(--font); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; max-height: 48vh; overflow: auto; margin: 6px 0 0;
  -webkit-user-select: text; user-select: text;
}

/* ===== Mascota y globos en las pantallas del kiosco ===== */
.talk--home { margin: clamp(4px, 1.5vh, 16px) 0 clamp(14px, 2.6vh, 30px); --opi-size: clamp(96px, 17vh, 170px); }
.talk--home .question { margin: 0; font-size: clamp(26px, 4vw, 54px); }
.talk--sub { justify-content: center; margin: clamp(4px, 1.5vh, 16px) 0 clamp(14px, 2.6vh, 28px); --opi-size: clamp(80px, 13vh, 130px); }
.talk--sub .subq { margin: 0; text-align: left; }
.thanks .talk--stack { --opi-size: clamp(150px, 30vh, 280px); gap: clamp(16px, 3vh, 30px); max-width: min(900px, 92vw); }
.thanks .say { padding: clamp(16px, 2.6vh, 28px) clamp(22px, 3.4vw, 44px); }
.thanks-text { font-size: clamp(28px, 4.4vw, 58px); line-height: 1.15; text-wrap: balance; }
.thanks-bye { margin-top: .35em !important; font-size: clamp(20px, 2.6vw, 32px); font-weight: 650; color: var(--opi-blue); }
.thanks-bye:empty { display: none; }
body:not(.no-mascot) .thanks-check { display: none; }
.no-mascot .thanks-bye { color: var(--ink-2); }
@media (orientation: portrait) {
  .talk--home { --opi-size: clamp(80px, 12vh, 140px); }
  .talk--home .question { font-size: clamp(24px, 5.6vw, 48px); }
}
@media (max-width: 560px) {
  .talk--sub { justify-content: flex-start; }
  .talk--sub .subq { font-size: clamp(20px, 5.4vw, 30px); }
}

/* ===== Pantallas chicas (celulares, tablets en vertical de poca altura) ===== */
.faces { grid-template-rows: minmax(0, 1fr); }
.face { min-height: 0; min-width: 0; overflow: hidden; }
@media (orientation: portrait) {
  .faces { grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .face-svg { width: clamp(44px, min(11vh, 24vw), 150px); height: clamp(44px, min(11vh, 24vw), 150px); }
  .face-label { font-size: clamp(26px, 4.6vw, 46px); }
}
/* En un celular, la pantalla no alcanza para todo: la página se desplaza en vez de encimarse */
@media (max-width: 600px), (max-height: 560px) {
  html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  main { flex: none; flex-direction: column; }
  .screen { flex: none; min-width: 0; }
  .faces { flex: none; grid-template-rows: none; grid-auto-rows: clamp(76px, 13vh, 110px); }
  .face { flex-direction: row; gap: 18px; }
  .face-svg { width: 54px; height: 54px; }
  .face-label { font-size: 26px; }
  .talk--home { --opi-size: 78px; }
  .talk--home .question { font-size: clamp(20px, 6vw, 28px); }
  .say { border-radius: 20px; }
  .ghost { min-height: 52px; padding: 10px 18px; font-size: 16px; }
  .options { flex: none; }
  .option { min-height: 64px; font-size: 19px; }
  .kinds { flex: none; grid-auto-rows: 120px; }
  .thanks { padding-block: 24px; }
  .thanks .talk--stack { --opi-size: 140px; }
  .thanks-text { font-size: clamp(24px, 7vw, 34px); }
}

/* Cuenta suspendida: la tablet no toma opiniones (el acceso a mantenimiento sigue igual) */
.service-off { margin: auto; text-align: center; font-size: clamp(22px, 3vw, 34px); font-weight: 700; color: #4a505c; padding: 24px; }
.service-off small { font-weight: 500; font-size: .7em; }
body.service-suspended #screen-home .faces,
body.service-suspended #screen-home .home-extras,
body.service-suspended #screen-home .talk { display: none !important; }
