/* Avisos por WhatsApp en las páginas de Kuskio Agenda — aprobado por Jesús y publicado el 25-oct-2026 (pendiente 33).
   Archivo compartido: lo cargan agenda/index.html y agenda/como-funciona/index.html, después de su estilos.css.
   Los mensajes son el texto real de las 5 plantillas aprobadas por Meta (borradores/whatsapp-plantillas.md),
   con datos de la demo (Inés Valdivieso, paciente ficticia Ana). Colores de WhatsApp en modo oscuro solo
   dentro del teléfono; afuera, la paleta Noche de Quito. */

:root {
  --wa-fondo: #0b141a; --wa-barra: #1f2c34; --wa-burbuja: #1f2c34; --wa-texto: #e9edef;
  --wa-gris: #8696a0; --wa-enlace: #53bdeb; --wa-linea: rgb(134 150 160 / 0.18);
}

/* --- Sección nueva de Agenda: "Tus pacientes, avisados por WhatsApp" ---------------------------- */
.wa { position: relative; background: var(--tinta-2); box-shadow: inset 0 1px 0 var(--linea); isolation: isolate; overflow: clip; }
.wa::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(42% 52% at 72% 50%, rgb(208 133 80 / 0.16), transparent 70%); }
.wa-fijo { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px clamp(40px, 6vw, 110px); align-items: center;
  width: min(1240px, 100%); margin: 0 auto; padding: var(--seccion) var(--margen); }
.wa-etq { display: inline-flex; align-items: center; gap: 10px; color: var(--cobre-claro); }
.wa-etq svg, .ico-wa svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wa .titulo { margin-top: 22px; max-width: 14ch; }
.wa .titulo em { display: block; }
.wa-bajada { margin-top: 26px; font-size: var(--lead); color: var(--suave); max-width: 40ch; }

.wa-pasos { margin-top: clamp(30px, 4vh, 48px); display: grid; max-width: 480px; counter-reset: paso; }
.wa-pasos li { position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 2px 0; padding: 14px 0; box-shadow: inset 0 -1px 0 var(--linea);
  color: var(--pizarra-texto); transition: color 250ms ease; }
.wa-pasos li::before { counter-increment: paso; content: "0" counter(paso); grid-row: span 2; font: 500 12px/1.9 var(--mono); letter-spacing: 0.08em; }
.wa-pasos li b { font-weight: 600; font-size: 18px; }
.wa-pasos li span { font-size: 15px; }
.wa-pasos li::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; border-radius: 2px; background: var(--cobre);
  transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--ease-out); }
.wa-pasos li.activo { color: var(--claro); }
.wa-pasos li.activo span { color: var(--suave); }
.wa-pasos li.activo::after { transform: scaleX(1); }
.wa-nota { margin-top: 22px; font-size: 15px; color: var(--pizarra-texto); max-width: 44ch; }
.wa-nota b { color: var(--suave); font-weight: 600; }

/* PC: la sección se fija y cada aviso aparece al bajar (un tramo corto, como el 02 aprobado). */
@media (min-width: 901px) {
  .js .wa.con-scroll { height: 270vh; }
  .js .wa.con-scroll .wa-fijo { position: sticky; top: 0; min-height: 100svh; padding-top: 72px; padding-bottom: 40px; }
}

/* --- El teléfono --------------------------------------------------------------------------------- */
.tel { position: relative; justify-self: center; width: min(352px, 100%); aspect-ratio: 352 / 700; max-height: min(700px, 82svh);
  padding: 11px; border-radius: 50px; background: #05090f;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.12), inset 0 0 0 1px rgb(255 255 255 / 0.05), 0 60px 120px -40px rgb(0 0 0 / 0.9), 0 0 90px -30px rgb(208 133 80 / 0.35); }
.tel-pantalla { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 40px; background: var(--wa-fondo); color: var(--wa-texto);
  font-family: "Onest", system-ui, sans-serif; }
.tel-estado { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 26px 6px; font-size: 13px; font-weight: 600; }
.tel-estado i { width: 86px; height: 24px; border-radius: 99px; background: #000; }
.tel-estado span:last-child { display: inline-flex; gap: 5px; align-items: center; }
.tel-estado svg { width: 16px; height: 12px; fill: currentColor; }

.wa-cabeza { flex: none; display: flex; align-items: center; gap: 11px; padding: 8px 16px 10px; background: var(--wa-barra); }
.wa-cabeza > svg { width: 18px; height: 18px; fill: none; stroke: var(--wa-texto); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wa-avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--tinta); color: var(--claro); }
.wa-avatar svg { width: 30px; height: 30px; }
.wa-cabeza b { display: flex; align-items: center; gap: 5px; font-size: 16px; font-weight: 600; line-height: 1.2; }
.wa-cabeza b svg { width: 15px; height: 15px; }
.wa-cabeza small { display: block; font-size: 12.5px; color: var(--wa-gris); }

.wa-chat { position: relative; flex: 1; min-height: 0; overflow: hidden; padding: 0 12px;
  background-image: radial-gradient(rgb(255 255 255 / 0.035) 1px, transparent 1px); background-size: 18px 18px; }
.wa-pista { display: grid; gap: 8px; padding: 14px 0 18px; will-change: transform; transition: transform 300ms var(--ease-out); }
.wa-dia { justify-self: center; padding: 5px 12px; border-radius: 8px; background: #182229; color: var(--wa-gris); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; }
.wa-msj { justify-self: start; width: 90%; border-radius: 4px 12px 12px 12px; background: var(--wa-burbuja); box-shadow: 0 1px 1px rgb(0 0 0 / 0.25); font-size: 13.5px; line-height: 1.42; }
.wa-msj .wa-cuerpo { padding: 8px 10px 4px; }
.wa-msj p + p { margin-top: 6px; }
.wa-msj b { font-weight: 700; }
.wa-msj .wa-pie { display: flex; justify-content: space-between; gap: 10px; align-items: end; margin-top: 6px; font-size: 12px; color: var(--wa-gris); }
.wa-msj .wa-pie time { flex: none; font-size: 11px; }
.wa-msj .wa-boton { display: flex; justify-content: center; align-items: center; gap: 7px; padding: 10px; box-shadow: inset 0 1px 0 var(--wa-linea); color: var(--wa-enlace); font-weight: 600; font-size: 13.5px; }
.wa-msj .wa-boton svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Aparecer de cada aviso y de su separador de día: estado por clase, nunca ligado al scroll en el mismo elemento. */
.js .wa-anima .wa-msj, .js .wa-anima .wa-dia { opacity: 0; transform: translateY(14px) scale(0.97); transform-origin: 0 0;
  transition: opacity 260ms var(--ease-out), transform 300ms var(--ease-out); }
.js .wa-anima .wa-msj.visto, .js .wa-anima .wa-dia.visto { opacity: 1; transform: none; }

.tel-escribe { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px 16px; }
.tel-escribe span { flex: 1; padding: 10px 16px; border-radius: 99px; background: var(--wa-barra); color: var(--wa-gris); font-size: 13.5px; }
.tel-escribe i { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #21c063; display: grid; place-items: center; }
.tel-escribe i svg { width: 18px; height: 18px; fill: none; stroke: #0b141a; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Notificación que baja por la pantalla cuando llega el recordatorio de "hoy". */
.wa-noti { position: absolute; z-index: 3; left: 10px; right: 10px; top: 46px; display: flex; gap: 10px; align-items: center; padding: 11px 13px; border-radius: 20px;
  background: rgb(52 60 70 / 0.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 18px 40px -12px rgb(0 0 0 / 0.7);
  opacity: 0; transform: translateY(-120%); transition: opacity 220ms var(--ease-out), transform 300ms var(--ease-out); pointer-events: none; }
.wa-noti.visto { opacity: 1; transform: none; }
.wa-noti .wa-avatar { width: 34px; height: 34px; border-radius: 9px; }
.wa-noti .wa-avatar svg { width: 26px; height: 26px; }
.wa-noti div { min-width: 0; font-size: 13px; line-height: 1.3; }
.wa-noti b { display: flex; justify-content: space-between; font-weight: 600; }
.wa-noti b small { font-weight: 400; color: #c3cad1; }
.wa-noti span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #dfe3e7; }

/* --- Agenda, fila "No más pacientes que olvidan su cita": el aviso es un WhatsApp ------------------- */
.ico-wa { background: #d9f2e2; color: #11603a; }
.notif-wa b { display: flex; align-items: center; gap: 8px; }

/* --- Cómo funciona, lámina 4: el recordatorio en un chat de verdad (en vez de la captura del correo) - */
.detalle.wa-detalle { display: grid; place-items: center; background: var(--wa-fondo); }
.wa-detalle .wa-chat { position: absolute; inset: 0; padding: 0 clamp(16px, 3vw, 44px); display: flex; flex-direction: column; justify-content: center; }
.wa-detalle .wa-pista { gap: 10px; width: min(540px, 100%); margin: 0 auto; }
.wa-detalle .wa-msj { width: 88%; font-size: 14.5px; }
.wa-detalle .wa-cabeza { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.wa-detalle .wa-chat { padding-top: 58px; }

/* --- Cómo funciona, pestañas de avisos: por dónde sale cada uno --------------------------------- */
.canal { display: inline-flex; gap: 6px; margin-top: 8px; }
.canal i { font: 500 11px/1 var(--mono); font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px currentColor; opacity: 0.8; }
.canal i.wa-c { color: #157a48; opacity: 1; }

/* --- Celular y tablet ---------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .wa-fijo { grid-template-columns: 1fr; gap: 56px; }
  .tel { width: min(340px, 100%); max-height: none; }
}
@media (max-width: 760px) {
  .wa-pasos li { grid-template-columns: 44px minmax(0, 1fr); padding: 12px 0; }
  .wa-pasos li b { font-size: 17px; }
  .tel { width: min(330px, 100%); border-radius: 46px; }
  .tel-pantalla { border-radius: 36px; }
  .detalle.wa-detalle { aspect-ratio: 4 / 5; }
  .wa-detalle .wa-msj { width: 92%; font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .wa-pista, .js .wa-anima .wa-msj, .js .wa-anima .wa-dia, .wa-noti, .wa-pasos li::after { transition: none; }
}
