/* =========================================================
   Hola Gabicha — estilos compartidos
   Colores: guinda (#7A1F3D) sobre rosa suave. Primero celular.
   ========================================================= */

:root {
  --guinda: #7A1F3D;
  --guinda-oscuro: #4E1025;
  --rosa: #FBF0F3;
  --rosa-medio: #F4D3DD;
  --borde: #EBD5DC;
  --texto: #2A1A20;
  --texto-suave: #5E4A52;
  --verde-wa: #1F7A4D;
  --rojo: #B3261E;
  --rojo-fondo: #FDECEC;
  --radio: 16px;
  --sombra: 0 10px 30px rgba(78, 16, 37, 0.10);
}

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

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--texto);
  background: #fff;
  line-height: 1.6;
}

h1, h2, h3 { font-family: "Plus Jakarta Sans", "Inter", sans-serif; color: var(--guinda-oscuro); line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--guinda); }
img { max-width: 100%; display: block; }

.contenedor { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.seccion { padding: 64px 0; }
.seccion.rosa { background: var(--rosa); }
.titulo-seccion { font-size: 32px; margin-bottom: 12px; }
.lead { font-size: 18px; color: var(--texto-suave); max-width: 640px; }

/* ---------- Cabecera ---------- */
.cabecera { background: #fff; border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 10; }
.cabecera .contenedor { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--guinda-oscuro); font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 20px; }
.marca img { width: 40px; height: 40px; }
.menu { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 15px; }
.menu a { text-decoration: none; color: var(--texto-suave); font-weight: 500; padding: 8px 0; }
.menu a:hover { color: var(--guinda); }
.menu a.boton-principal { color: #fff; padding: 10px 18px; min-height: 44px; }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border-radius: 999px; border: none;
  font: 600 16px/1.2 "Inter", sans-serif; text-decoration: none; cursor: pointer;
}
.boton-principal { background: var(--guinda); color: #fff; }
.boton-principal:hover { background: var(--guinda-oscuro); color: #fff; }
.boton-secundario { background: #fff; color: var(--guinda-oscuro); border: 1px solid var(--borde); }
.boton-wa { background: var(--verde-wa); color: #fff; }
.boton-rojo { background: var(--rojo); color: #fff; }
.boton:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #E85D8A; outline-offset: 2px; }

/* ---------- Héroe ---------- */
.heroe { background: var(--rosa); }
.heroe .contenedor { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding-top: 56px; padding-bottom: 56px; }
.heroe-texto { flex: 1 1 420px; display: flex; flex-direction: column; gap: 18px; }
.heroe-texto h1 { font-size: clamp(34px, 6vw, 52px); }
.etiqueta { align-self: flex-start; background: #fff; color: var(--guinda); font-size: 13px; font-weight: 600; letter-spacing: .04em; padding: 6px 14px; border-radius: 999px; }
.acciones { display: flex; flex-wrap: wrap; gap: 12px; }
.heroe-avatar { flex: 0 1 300px; width: 100%; max-width: 300px; margin: 0 auto; }
@media (max-width: 600px) { .heroe-avatar { max-width: 180px; } .heroe .contenedor { gap: 24px; padding-top: 36px; padding-bottom: 36px; } }

/* ---------- Tarjetas ---------- */
.rejilla { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; }
.tarjeta { flex: 1 1 240px; background: var(--rosa); border-radius: var(--radio); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.seccion.rosa .tarjeta { background: #fff; }
.tarjeta h3 { font-size: 19px; }
.tarjeta p { color: var(--texto-suave); font-size: 15px; }

.perfil { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.foto { flex: 0 0 220px; height: 260px; border-radius: 24px; background: var(--rosa-medio); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--guinda); padding: 16px; font-size: 14px; }
.perfil-texto { flex: 1 1 360px; display: flex; flex-direction: column; gap: 12px; }
.dato { color: var(--texto-suave); font-size: 15px; }

.puede { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 24px; }
.puede > div { flex: 1 1 300px; border-radius: var(--radio); padding: 24px; }
.puede .si { background: #EAF5EF; }
.puede .no { background: var(--rojo-fondo); }
.puede ul { margin: 10px 0 0; padding-left: 20px; }
.puede li { margin-bottom: 6px; }

.pasos { counter-reset: paso; list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 18px; }
.pasos li { flex: 1 1 220px; background: var(--rosa); border-radius: var(--radio); padding: 22px; }
.pasos li::before { counter-increment: paso; content: counter(paso); display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: var(--guinda); color: #fff; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 10px; }

.aviso-ia { margin-top: 20px; font-size: 14px; color: var(--texto-suave); }

/* ---------- Pie ---------- */
.pie { background: var(--guinda-oscuro); color: #F4D3DD; font-size: 14px; }
.pie .contenedor { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.pie a { color: #fff; }
.pie strong { color: #fff; }

/* ---------- Página legal ---------- */
.legal { max-width: 760px; }
.legal h2 { font-size: 22px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--texto-suave); }

/* =========================================================
   CHAT
   ========================================================= */
.pagina-chat { background: var(--rosa); min-height: 100vh; display: flex; flex-direction: column; }
.chat {
  flex: 1; width: 100%; max-width: 720px; margin: 0 auto; background: #fff;
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: var(--sombra);
}
.chat-cabecera { background: var(--guinda); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.chat-cabecera .cara { width: 46px; height: 46px; background: #fff; border-radius: 50%; padding: 3px; flex-shrink: 0; }
.chat-cabecera .nombre { font-weight: 700; font-size: 17px; }
.chat-cabecera .estado { font-size: 12px; color: var(--rosa-medio); }
.chat-cabecera .volver { margin-left: auto; color: #fff; font-size: 14px; }

.barra-emergencia { background: var(--rojo-fondo); border-bottom: 1px solid #F3C4C1; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: #5C1410; }
.barra-emergencia button { background: var(--rojo); color: #fff; border: none; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 13px; min-height: 40px; cursor: pointer; }

.mensajes { flex: 1; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 12px; background: #FDF8F9; min-height: 300px; }
.fila { display: flex; align-items: flex-end; gap: 8px; max-width: 92%; }
.fila.bot { align-self: flex-start; }
.fila.usuario { align-self: flex-end; }
.fila .mini { width: 34px; height: 34px; flex-shrink: 0; }
.burbuja { padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; white-space: pre-line; }
.bot .burbuja { background: #fff; border: 1px solid var(--borde); border-bottom-left-radius: 4px; }
.usuario .burbuja { background: var(--guinda); color: #fff; border-bottom-right-radius: 4px; }
.bot .burbuja.urgente { background: var(--rojo-fondo); border: 1.5px solid var(--rojo); color: #5C1410; font-weight: 500; }
.burbuja .boton { margin-top: 10px; width: 100%; min-height: 44px; font-size: 15px; }

.escribiendo { display: inline-flex; gap: 4px; padding: 14px 16px; }
.escribiendo span { width: 7px; height: 7px; border-radius: 50%; background: var(--guinda); opacity: .35; animation: punto 1.2s infinite; }
.escribiendo span:nth-child(2) { animation-delay: .2s; }
.escribiendo span:nth-child(3) { animation-delay: .4s; }
@keyframes punto { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .escribiendo span { animation: none; opacity: .7; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 0; }
.chip { background: var(--rosa); color: var(--guinda); border: 1px solid var(--borde); border-radius: 999px; padding: 9px 14px; font: 600 13px "Inter", sans-serif; min-height: 40px; cursor: pointer; }

.entrada { display: flex; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--borde); background: #fff; }
.entrada input { flex: 1; min-width: 0; height: 48px; border: 1px solid var(--borde); border-radius: 999px; padding: 0 18px; font: 16px "Inter", sans-serif; color: var(--texto); }
.entrada button { width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--guinda); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.entrada button:disabled { opacity: .5; cursor: default; }
.nota-ia { font-size: 12px; color: var(--texto-suave); padding: 0 16px 12px; text-align: center; }

/* Paneles que se superponen al chat: consentimiento, derivación, emergencia */
.capa { position: fixed; inset: 0; background: rgba(42, 26, 32, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.capa[hidden] { display: none; }
.panel { background: #fff; border-radius: 22px; max-width: 480px; width: 100%; max-height: 92vh; overflow-y: auto; padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 22px; }
.panel ul { margin: 0; padding-left: 20px; color: var(--texto-suave); font-size: 15px; }
.panel label { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.panel input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--guinda); flex-shrink: 0; }
.panel input[type="text"] { height: 46px; border: 1px solid var(--borde); border-radius: 12px; padding: 0 14px; font: 16px "Inter", sans-serif; width: 100%; }
.vista-previa { background: #E7F4EC; border-radius: 14px; padding: 14px; font-size: 15px; color: #173B28; white-space: pre-line; }
.pequeno { font-size: 13px; color: var(--texto-suave); }

.panel.emergencia { background: var(--rojo-fondo); border: 2px solid var(--rojo); align-items: center; text-align: center; }
.panel.emergencia h2 { color: #5C1410; }
.panel.emergencia p { color: #5C1410; font-size: 17px; font-weight: 500; }
.panel.emergencia .boton { width: 100%; }
.panel.emergencia img { width: 120px; }
