/* NutriCor — estilos futuristas sobre Tailwind */

/* ------------------------------------------------------------ Rendimiento móvil */
/* Los desenfoques (backdrop-filter) y los orbes con blur de 110px son muy
   caros en GPU móvil y hacían lenta la navegación: fuera en pantallas pequeñas. */
@media (max-width: 768px) {
  .orb { display: none; }
  .glass, .modal-back, .ticket {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .glass { background: rgba(13, 19, 35, 0.88); }
  header { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(9, 13, 26, 0.97) !important; }
  #gen-widget { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: #0b1122 !important; }
  .glass-hover:hover { transform: none; box-shadow: none; }
}

/* ------------------------------------------------------------ Responsive base */
/* Los ítems de grid tienen min-width:auto y el contenido ancho (tablas,
   pestañas, nombres largos) estiraba columnas enteras en móvil. */
.grid > * { min-width: 0; }
html, body { overflow-x: clip; }
img { max-width: 100%; }

/* Fondo: rejilla tecnológica sutil */
.grid-bg {
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* Orbes de luz ambiente */
.orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(110px);
  opacity: 0.35;
  animation: orbita 24s ease-in-out infinite alternate;
}
.orb-cyan   { width: 480px; height: 480px; top: -160px; right: -120px; background: radial-gradient(circle, #0e7490, transparent 70%); }
.orb-violet { width: 420px; height: 420px; bottom: -140px; left: -120px; background: radial-gradient(circle, #6d28d9, transparent 70%); animation-delay: -12s; }

@keyframes orbita {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-60px, 40px) scale(1.15); }
}

/* Tarjeta de cristal */
.glass {
  background: linear-gradient(160deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.glass-hover { transition: border-color .25s, transform .25s, box-shadow .25s; }
.glass-hover:hover {
  border-color: rgba(34,211,238,0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(34,211,238,0.12);
}

/* Botón principal con brillo */
.btn-neon {
  background: linear-gradient(120deg, #22d3ee, #a78bfa);
  color: #05070f;
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 0.65rem 1.4rem;
  transition: box-shadow .25s, transform .15s, filter .2s;
}
.btn-neon:hover  { box-shadow: 0 0 28px rgba(34,211,238,.45); filter: brightness(1.08); }
.btn-neon:active { transform: scale(.97); }
.btn-neon:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.75rem;
  padding: 0.6rem 1.2rem;
  color: #cbd5e1;
  transition: border-color .2s, color .2s, background .2s;
}
.btn-ghost:hover { border-color: rgba(34,211,238,.5); color: #22d3ee; background: rgba(34,211,238,.06); }

/* Inputs */
.input-tech {
  width: 100%;
  background: rgba(5,7,15,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.7rem;
  padding: 0.6rem 0.9rem;
  color: #e2e8f0;
  font-size: 0.9rem;
  transition: border-color .2s, box-shadow .2s;
}
.input-tech:focus {
  outline: none;
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}
.input-tech::placeholder { color: #475569; }
select.input-tech option { background: #0e1526; }

/* Los input de fecha en WebKit móvil tienen ancho intrínseco fijo y se salían
   del contenedor: forzar apariencia propia y ancho fluido. */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 2.75rem;      /* iOS colapsa la altura cuando está vacío */
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }

/* Texto degradado */
.text-grad {
  background: linear-gradient(100deg, #22d3ee 10%, #a78bfa 60%, #f472b6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Anillo de progreso / métricas */
.stat-ring { position: relative; }
.stat-ring svg { transform: rotate(-90deg); }

/* Ticket estilo recibo */
.ticket {
  background: rgba(5,7,15,0.7);
  border: 1px dashed rgba(34,211,238,0.35);
  border-radius: 1rem;
  font-variant-numeric: tabular-nums;
}
.ticket .ticket-linea { border-bottom: 1px dashed rgba(255,255,255,0.07); }
.ticket .ticket-linea:last-child { border-bottom: 0; }

/* Escáner animado para estados de carga IA */
.scanline {
  position: relative;
  overflow: hidden;
}
.scanline::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(34,211,238,0.18) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: scan 1.6s linear infinite;
}
@keyframes scan { to { transform: translateX(100%); } }

/* Tablas */
.tabla-tech th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #67e8f9;
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(34,211,238,0.2);
  white-space: nowrap;
}
.tabla-tech td { padding: 0.7rem 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.tabla-tech tr:hover td { background: rgba(34,211,238,0.04); }

/* Barras de macros */
.barra { height: 7px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; }
.barra > div { height: 100%; border-radius: 99px; transition: width .6s ease; }

/* Scrollbar fina */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #05070f; }
::-webkit-scrollbar-thumb { background: #16203a; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #0e7490; }

/* Selector visual del check-in: el corazón se enciende al marcar */
input.peer:checked + div .corazon { opacity: 1; }

/* ------------------------------------------------------------ Modales */
.modal-back {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: rgba(5, 7, 15, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.modal-back.abierto { opacity: 1; pointer-events: auto; }
.modal-caja {
  width: 100%; max-width: 26rem;
  transform: translateY(24px) scale(.96);
  transition: transform .35s cubic-bezier(.2, .9, .35, 1.15);
}
.modal-back.abierto .modal-caja { transform: none; }

/* Tarjeta que sale (respuesta dada) y entra la siguiente */
@keyframes tarjetaOut { to { opacity: 0; transform: translateX(-46px) scale(.94); } }
@keyframes tarjetaIn  { from { opacity: 0; transform: translateX(46px) scale(.97); } }
.tarjeta-out { animation: tarjetaOut .28s ease forwards; }
.tarjeta-in  { animation: tarjetaIn .32s ease; }

/* ------------------------------------------------------------ Wizard del check-in */
.paso { display: none; }
.paso.activo { display: block; animation: tarjetaIn .35s ease; }

/* Impresión del ticket */
@media print {
  body { background: #fff !important; color: #000 !important; }
  header, footer, .no-print, .orb { display: none !important; }
  .ticket { border-color: #000; background: #fff; color: #000; }
  .solo-print { display: block !important; }
}
