:root {
  --azul: #0d5bd7;
  --azul-oscuro: #0a47a8;
  --verde: #1a7f45;
  --verde-oscuro: #14633a;
  --ambar: #b45309;
  --ambar-oscuro: #8f4107;
  --rojo: #b42318;
  --fondo: #f1f4f9;
  --tarjeta: #ffffff;
  --texto: #1c2333;
  --texto-suave: #5b6478;
  --borde: #d5dbe6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.app {
  max-width: 420px;
  margin: 0 auto;
  padding: 16px;
}

.encabezado {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 16px;
}
.encabezado img { border-radius: 10px; }
.encabezado h1 { font-size: 1.25rem; margin: 0; }

.tarjeta {
  background: var(--tarjeta);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(20, 30, 60, 0.08);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tarjeta h2 { margin: 0; font-size: 1.15rem; }
.centrado { align-items: center; text-align: center; }

form { display: flex; flex-direction: column; gap: 10px; }
label { font-weight: 600; font-size: 0.9rem; }

input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: #fff;
  color: var(--texto);
}
input:focus { outline: 3px solid rgba(13, 91, 215, 0.35); border-color: var(--azul); }

.btn {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primario { background: var(--azul); }
.btn-primario:active:not(:disabled) { background: var(--azul-oscuro); }
.btn-entrada { background: var(--verde); padding: 18px; font-size: 1.15rem; }
.btn-entrada:active:not(:disabled) { background: var(--verde-oscuro); }
.btn-salida { background: var(--ambar); padding: 18px; font-size: 1.15rem; }
.btn-salida:active:not(:disabled) { background: var(--ambar-oscuro); }
.btn-secundario { background: #fff; color: var(--texto); border: 1px solid var(--borde); }

.reloj { text-align: center; padding: 4px 0 8px; }
.reloj-hora { font-size: 2.6rem; font-weight: 700; letter-spacing: 1px; }
.reloj-fecha { color: var(--texto-suave); }
.reloj-fecha::first-letter { text-transform: uppercase; }

.saludo { margin: 0; font-size: 1.05rem; font-weight: 600; text-align: center; }
.info { margin: 0; line-height: 1.5; text-align: center; }
.ayuda { margin: 0; color: var(--texto-suave); font-size: 0.9rem; line-height: 1.4; }

.mensaje {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef3fb;
  font-size: 0.95rem;
  line-height: 1.4;
}
.mensaje.error { background: #fdecea; color: var(--rojo); }
.mensaje.aviso { background: #fff4e0; color: #7a4a00; }

.marco-foto {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}
.marco-foto video, .marco-foto img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.palomita {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  font-size: 2.6rem;
  display: flex; align-items: center; justify-content: center;
}

.instalar { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
