/* ═══════════════════════════════════════════════════════════════════════════
   SISTEMA DE VALORACIÓN — Hoja de estilos global
   Cubre: kiosk (index.php), login (admin.php) y panel admin (admin.php)
════════════════════════════════════════════════════════════════════════════ */

/* ── Reset & base ───────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Variables compartidas ──────────────────────────────────────────────── */
:root {
  --bg:          #080f1e;
  --surface:     #0e1929;
  --card-bg:     rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.08);
  --text-1:      #f0f4ff;
  --text-2:      #8899bb;
  --radius-lg:   22px;
  --radius-xl:   32px;

  /* Alias usados en admin */
  --card:   rgba(255,255,255,.04);
  --border: rgba(255,255,255,.08);
  --text1:  #f0f4ff;
  --text2:  #8899bb;
}


/* ══════════════════════════════════════════════════════════════════════════
   KIOSK — index.php
══════════════════════════════════════════════════════════════════════════ */

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  user-select: none;
}

/* Fondo animado con degradados */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(30,80,200,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 110%, rgba(0,200,120,.10) 0%, transparent 60%);
  pointer-events: none;
}

/* Pantalla principal */
#main-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.8vh, 36px);
  padding: 24px 20px 16px;
}

/* Cabecera / marca */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.brand-icon {
  width: 32px;
  height: 32px;
}

/* Bloque de pregunta */
.question-wrap {
  text-align: center;
}
#question-text {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-1);
  letter-spacing: -0.02em;
  transition: opacity .35s ease, transform .35s ease;
}
#question-text.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}
#question-text.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.subtitle {
  margin-top: 8px;
  font-size: clamp(0.78rem, 1.4vw, 0.95rem);
  color: var(--text-2);
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* Indicador de pregunta (puntitos) */
.question-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
}
.q-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card-border);
  transition: background .3s, transform .3s;
}
.q-dot.active {
  background: var(--text-2);
  transform: scale(1.4);
}

/* Cuadrícula de caras */
.faces-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 24px);
  justify-content: center;
  align-items: stretch;
}

/* Tarjeta de valoración */
.face-btn {
  --accent: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: clamp(16px, 2.5vh, 28px) clamp(14px, 2vw, 26px);
  cursor: pointer;
  transition:
    transform .22s cubic-bezier(.34,1.56,.64,1),
    box-shadow .22s ease,
    border-color .22s ease,
    background .22s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  position: relative;
  overflow: hidden;
}
.face-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, var(--accent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .25s ease;
}
.face-btn:hover {
  transform: translateY(-10px) scale(1.06);
  border-color: var(--accent);
  box-shadow:
    0 16px 48px -10px var(--accent),
    0 0 0 1px var(--accent);
}
.face-btn:hover::after {
  opacity: .06;
}
.face-btn:active {
  transform: scale(0.96);
}
.face-btn.selected {
  border-color: var(--accent);
  box-shadow: 0 0 60px -6px var(--accent);
}

/* SVG de la cara */
.face-svg {
  width:  clamp(90px, 12vw, 148px);
  height: clamp(90px, 12vw, 148px);
  transition: transform .22s ease;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
}
.face-btn:hover .face-svg {
  transform: scale(1.05) rotate(-3deg);
}

/* Etiqueta debajo de la cara */
.face-label {
  font-size: clamp(0.68rem, 1.3vw, 0.85rem);
  font-weight: 700;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* Animación de pulso en reposo */
@keyframes idle-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.0); }
  50%       { box-shadow: 0 0 18px 4px rgba(255,255,255,.04); }
}
.face-btn                { animation: idle-pulse 3.5s ease-in-out infinite; }
.face-btn:nth-child(2)   { animation-delay: .5s;  }
.face-btn:nth-child(3)   { animation-delay: 1s;   }
.face-btn:nth-child(4)   { animation-delay: 1.5s; }
.face-btn:nth-child(5)   { animation-delay: 2s;   }
.face-btn:nth-child(6)   { animation-delay: 2.5s; }

/* Link discreto al admin */
.footer-link {
  position: fixed;
  bottom: 10px;
  right: 16px;
  font-size: 0.7rem;
  color: rgba(255,255,255,.12);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color .2s;
}
.footer-link:hover {
  color: rgba(255,255,255,.35);
}

/* Overlay de agradecimiento */
#thanks-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
  --thanks-color: #4caf50;
  background: radial-gradient(ellipse 80% 70% at 50% 40%,
    color-mix(in srgb, var(--thanks-color) 22%, #080f1e) 0%,
    #080f1e 70%);
}
#thanks-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.check-circle {
  width:  clamp(80px, 14vw, 120px);
  height: clamp(80px, 14vw, 120px);
  border-radius: 50%;
  background: var(--thanks-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(36px, 7vw, 60px);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 0 60px 10px color-mix(in srgb, var(--thanks-color) 50%, transparent);
  animation: pop-in .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes pop-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

#thanks-overlay h2 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}
#thanks-overlay p {
  font-size: clamp(0.85rem, 1.8vw, 1.1rem);
  color: var(--text-2);
  font-weight: 400;
}

.progress-bar {
  width: min(300px, 70vw);
  height: 5px;
  background: rgba(255,255,255,.12);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--thanks-color);
  border-radius: 99px;
}

@media (max-height: 500px) {
  #main-screen { gap: 10px; }
  .brand       { display: none; }
}


/* ══════════════════════════════════════════════════════════════════════════
   ADMIN LOGIN — showLogin() en admin.php
══════════════════════════════════════════════════════════════════════════ */

/* body ya heredará font-family de arriba; aquí sobreescribimos overflow para admin */
body.page-login {
  min-height: 100vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 60% at 20% -10%, rgba(30,80,200,.18) 0%, transparent 60%);
}

.login-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  padding: 48px 44px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.login-card p {
  font-size: .85rem;
  color: var(--text-2);
  margin-bottom: 32px;
}
.login-card input {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text-1);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: .2s;
}
.login-card input:focus {
  border-color: rgba(100,180,255,.5);
  box-shadow: 0 0 0 3px rgba(100,180,255,.12);
}
.login-card button {
  margin-top: 16px;
  width: 100%;
  background: linear-gradient(135deg,#1565c0,#0d47a1);
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .2s;
}
.login-card button:hover {
  opacity: .88;
}
.login-card .err {
  margin-top: 16px;
  color: #ff5252;
  font-size: .85rem;
}
.login-card .back {
  display: inline-block;
  margin-top: 24px;
  font-size: .8rem;
  color: var(--text-2);
  text-decoration: none;
}
.login-card .back:hover {
  color: var(--text-1);
}


/* ══════════════════════════════════════════════════════════════════════════
   ADMIN PANEL — panel principal de admin.php
══════════════════════════════════════════════════════════════════════════ */

body.page-admin {
  min-height: 100vh;
  overflow: auto;
  background: var(--bg);
  background-image: radial-gradient(ellipse 70% 50% at 15% -5%, rgba(30,80,200,.15) 0%, transparent 55%);
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Contenido principal */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: .18s;
  white-space: nowrap;
}
.btn-ghost {
  background: transparent;
  color: var(--text2);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.06);
  color: var(--text1);
}
.btn-primary {
  background: linear-gradient(135deg,#1565c0,#0d47a1);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover {
  opacity: .88;
}
.btn-danger {
  background: transparent;
  border-color: rgba(255,82,82,.3);
  color: #ff5252;
}
.btn-danger:hover {
  background: rgba(255,82,82,.1);
}

/* Tarjetas de estadísticas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-card .val {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.04em;
}
.stat-card .lbl {
  font-size: .78rem;
  color: var(--text2);
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Secciones */
.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 28px;
}
.section-title {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 20px;
}

/* Distribución de barras */
.dist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dist-row {
  display: grid;
  grid-template-columns: 100px 1fr 48px;
  align-items: center;
  gap: 12px;
}
.dist-lbl {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text1);
}
.dist-bar-wrap {
  height: 10px;
  background: rgba(255,255,255,.08);
  border-radius: 99px;
  overflow: hidden;
}
.dist-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.dist-count {
  font-size: .82rem;
  color: var(--text2);
  text-align: right;
}

/* Filtro de fechas */
.filter-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .78rem;
  color: var(--text2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.filter-form input[type=date] {
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  color: var(--text1);
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  transition: .18s;
  color-scheme: dark;
}
.filter-form input[type=date]:focus {
  border-color: rgba(100,180,255,.4);
  box-shadow: 0 0 0 3px rgba(100,180,255,.1);
}

/* Tabla de registros */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}
thead th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s;
}
tbody tr:hover {
  background: rgba(255,255,255,.03);
}
tbody td {
  padding: 10px 14px;
  vertical-align: middle;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
}
.empty {
  text-align: center;
  padding: 48px;
  color: var(--text2);
  font-size: .9rem;
}
.truncate {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
