/* ============================================================
   Registro de Charlas ESM — identidad visual
   Azul ESM #034798 · look limpio corporativo
   ============================================================ */
:root {
  --azul: #034798;
  --azul-oscuro: #023368;
  --amarillo: #f5b301;
  --tinta: #1a2231;
  --gris: #5b6a82;
  --linea: #c7d6ea;
  --azul-suave: #e8f0fb;
  --fondo: #eef2f7;
  --blanco: #ffffff;
  --ok: #1e8e3e;
  --peligro: #c62828;
  --radio: 10px;
  --sombra: 0 2px 10px rgba(2, 47, 102, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Barlow', system-ui, sans-serif;
  background: var(--fondo);
  color: var(--tinta);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

header.app {
  background: var(--azul);
  color: var(--blanco);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
header.app img { height: 34px; background: var(--blanco); border-radius: 6px; padding: 3px 6px; }
header.app .titulos { min-width: 0; }
header.app h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.25rem;
  margin: 0;
  line-height: 1.1;
}
header.app small { color: #cfe0fb; font-size: 0.78rem; display: block; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 14px 60px;
}

.tarjeta {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 18px 16px;
  margin-bottom: 16px;
}

.seccion-titulo {
  font-family: 'Barlow Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--azul);
  border-left: 4px solid var(--amarillo);
  padding-left: 10px;
  margin: 0 0 14px;
}

label.campo { display: block; font-weight: 600; font-size: 0.9rem; margin: 12px 0 4px; color: var(--tinta); }
label.campo .opcional { font-weight: 400; color: var(--gris); }

input[type="text"], input[type="time"], input[type="date"], input[type="number"], textarea, select {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--linea);
  border-radius: 8px;
  font: inherit;
  background: #fbfcfe;
  color: var(--tinta);
}
input:focus, textarea:focus, select:focus {
  outline: 3px solid rgba(3, 71, 152, 0.25);
  border-color: var(--azul);
}
textarea { min-height: 74px; resize: vertical; }

.fila { display: flex; gap: 10px; flex-wrap: wrap; }
.fila > * { flex: 1; min-width: 130px; }

/* Chips seleccionables (motivos, áreas, turno, jornada) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--linea);
  background: #fbfcfe;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--tinta);
  transition: all 0.12s ease;
}
.chip[aria-pressed="true"] {
  background: var(--azul);
  border-color: var(--azul);
  color: var(--blanco);
  font-weight: 600;
}
.chip:focus-visible { outline: 3px solid rgba(3, 71, 152, 0.35); }

/* Escala UV — réplica de la escala del formato en papel */
.uv-escala { display: flex; flex-wrap: wrap; gap: 6px; }
.uv {
  flex: 1 0 54px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 10px 4px;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-align: center;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.uv small { display: block; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.03em; }
.uv[aria-pressed="true"] { border-color: var(--tinta); box-shadow: 0 0 0 3px rgba(22,35,58,0.35); transform: scale(1.04); }
.uv-1, .uv-2 { background: #97BF0D; }
.uv-3, .uv-4, .uv-5 { background: #F8B334; }
.uv-6, .uv-7 { background: #F39400; }
.uv-8, .uv-9, .uv-10 { background: #E5352D; }
.uv-11 { background: #E63C8B; }

/* Zona de imagen */
.zona-imagen {
  border: 2px dashed var(--linea);
  border-radius: var(--radio);
  padding: 18px;
  text-align: center;
  color: var(--gris);
  cursor: pointer;
  background: #fbfcfe;
}
.zona-imagen.con-imagen { padding: 8px; border-style: solid; }
.zona-imagen img { max-width: 100%; max-height: 300px; border-radius: 6px; }
.zona-imagen.lleno { opacity: 0.5; cursor: not-allowed; }

/* Miniaturas de las imágenes de apoyo */
.miniaturas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.miniatura {
  position: relative; width: 90px; height: 90px;
  border: 1.5px solid var(--linea); border-radius: 8px;
  background: #fbfcfe; overflow: hidden;
}
.miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; }
.miniatura .quitar {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--peligro); color: #fff; border: 2px solid #fff;
  font-size: 0.85rem; line-height: 1; cursor: pointer; padding: 0;
  display: grid; place-items: center;
}

/* Lienzo de firma */
.firma-caja { border: 2px solid var(--linea); border-radius: var(--radio); background: var(--blanco); position: relative; }
.firma-caja canvas { display: block; width: 100%; height: 200px; touch-action: none; border-radius: var(--radio); }
.firma-caja .guia {
  position: absolute; left: 8%; right: 8%; bottom: 34px;
  border-bottom: 1.5px dashed var(--linea);
  pointer-events: none;
}
.firma-caja .marca {
  position: absolute; top: 8px; left: 12px;
  font-size: 0.72rem; color: var(--gris); pointer-events: none;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.firma-limpiar {
  margin-top: 8px;
  background: none; border: none; color: var(--azul);
  font: inherit; font-weight: 600; cursor: pointer; padding: 6px 2px;
}

/* Botones */
.boton {
  display: block; width: 100%;
  background: var(--amarillo); color: var(--azul-oscuro);
  border: none; border-radius: var(--radio);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.25rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 15px; cursor: pointer;
  box-shadow: var(--sombra);
}
.boton:disabled { opacity: 0.5; cursor: not-allowed; }
.boton.secundario { background: var(--azul); color: var(--blanco); }
.boton.borde { background: var(--blanco); color: var(--azul); border: 2px solid var(--azul); box-shadow: none; }
.boton + .boton { margin-top: 10px; }

/* Mensajes */
.aviso { border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-size: 0.94rem; }
.aviso.error { background: #fdecea; color: var(--peligro); border: 1px solid #f5c6c6; }
.aviso.exito { background: #e8f5e9; color: var(--ok); border: 1px solid #bfe3c4; }
.aviso.info { background: #e8f0fd; color: var(--azul-oscuro); border: 1px solid #c4d7f5; }
.oculto { display: none !important; }

/* Lista de firmantes */
.lista-firmas { list-style: none; margin: 0; padding: 0; }
.lista-firmas li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--linea);
}
.lista-firmas .num {
  background: var(--azul); color: var(--blanco);
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
}
.lista-firmas .datos { flex: 1; min-width: 0; }
.lista-firmas .datos b { display: block; }
.lista-firmas .datos span { color: var(--gris); font-size: 0.85rem; }
.lista-firmas img.mini-firma { height: 34px; max-width: 90px; object-fit: contain; }

/* Estado y link para compartir */
.estado-pill {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.9rem;
}
.estado-pill.abierta { background: #e8f5e9; color: var(--ok); }
.estado-pill.cerrada { background: #fdecea; color: var(--peligro); }

.link-caja {
  display: flex; gap: 8px; align-items: stretch;
}
.link-caja input { flex: 1; font-size: 0.85rem; color: var(--gris); }
.link-caja button {
  background: var(--azul); color: #fff; border: none; border-radius: 8px;
  padding: 0 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.boton-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #25d366; color: #fff; text-decoration: none;
  border-radius: var(--radio); padding: 13px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 1.15rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  margin-top: 10px;
}

.pie { text-align: center; color: var(--gris); font-size: 0.78rem; padding: 20px 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
