/* ==========================================================
   Diseño "Chat" · Boda contada como conversación
   Mensajería genérica y elegante en tonos claros (sin imitar ninguna app)
   ========================================================== */

:root {
  --fondo: #f7f7f5;
  --salvia: #dfeee5;
  --salvia-2: #b9d5c4;
  --azul: #8fb3d9;
  --azul-2: #4f7aa6;
  --rubor: #f2cfc8;
  --rubor-2: #c9867b;
  --tinta: #2f3537;
  --suave: #7a8683;
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "DM Serif Display", Georgia, serif;

  --s-fondo: var(--fondo);
  --s-tinta: var(--tinta);
  --s-suave: var(--suave);
  --s-acento: var(--azul);
  --s-acento-tinta: #1f3349;
  --s-tarjeta: #ffffff;
  --s-borde: rgba(47, 53, 55, .07);
  --s-radio: 22px;
  --s-sombra: 0 1px 2px rgba(40, 50, 60, .06), 0 16px 30px -22px rgba(40, 60, 80, .4);
  --s-fuente: var(--sans);
  --s-titulo: var(--serif);
  --s-titulo-tam: clamp(2.3rem, 10vw, 2.9rem);
  --s-etiqueta: var(--sans);
  --s-num: var(--serif);
  --s-num-color: var(--azul-2);
  --s-btn-linea-color: var(--tinta);
}

body {
  background: linear-gradient(160deg, #eef3f7, #f6efec 55%, #eef4ef);
  background-attachment: fixed;
  color: var(--tinta);
  font-family: var(--sans);
}
.amp { font-family: var(--serif); font-style: italic; color: var(--rubor-2); }

/* ================= INTRO: CHAT ================= */
.chat {
  position: relative;
  width: min(100%, 520px);
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.chat__marco {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--fondo);
  /* Patrón propio muy tenue: corazoncitos y puntos */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%238fb3d9' stroke-opacity='.16' stroke-width='1.2'%3E%3Cpath d='M24 30c-5-4-8-7-8-11a4.5 4.5 0 0 1 8-3 4.5 4.5 0 0 1 8 3c0 4-3 7-8 11z'/%3E%3Cpath d='M86 88c-5-4-8-7-8-11a4.5 4.5 0 0 1 8-3 4.5 4.5 0 0 1 8 3c0 4-3 7-8 11z'/%3E%3Ccircle cx='92' cy='22' r='5'/%3E%3Ccircle cx='28' cy='92' r='3'/%3E%3C/g%3E%3Cg fill='%23f2cfc8' fill-opacity='.35'%3E%3Ccircle cx='60' cy='56' r='2'/%3E%3Ccircle cx='108' cy='60' r='1.6'/%3E%3Ccircle cx='8' cy='64' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: 0 0 60px -26px rgba(40, 60, 80, .35);
}

/* Encabezado */
.chat__cab {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 10px 10px 8px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(47, 53, 55, .06);
}
.chat__atras { display: grid; place-items: center; width: 26px; color: var(--azul-2); }
.chat__avatar { position: relative; flex: none; width: 46px; height: 46px; padding: 2px; border-radius: 50%; background: conic-gradient(from 200deg, var(--rubor), var(--azul), var(--salvia-2), var(--rubor)); }
.chat__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 2px solid #fff; }
.chat__punto { position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: #9fd0b2; border: 2px solid #fff; }
.chat__quien { flex: 1; min-width: 0; }
.chat__nombre { margin: 0; font-family: var(--serif); font-size: 1.16rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__nombre .amp { font-size: .8em; }
.chat__estado { margin: 1px 0 0; font-size: .76rem; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s; }
.chat__estado.activo { color: var(--azul-2); font-style: italic; }
.chat__saltar {
  all: unset;
  box-sizing: border-box;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: #edf3f9;
  color: var(--azul-2);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
}
.chat__saltar:focus-visible { outline: 2px solid var(--azul-2); outline-offset: 2px; }

/* Cuerpo */
.chat__cuerpo {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 10px;
  -webkit-overflow-scrolling: touch;
  cursor: pointer;
}
.chat__cuerpo:focus-visible { outline: 2px solid var(--azul); outline-offset: -4px; }
.chat__lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.msg { display: flex; }
.msg--izq { justify-content: flex-start; }
.msg--der { justify-content: flex-end; }
.msg.entra { animation: entrar .46s cubic-bezier(.2, .9, .3, 1.25) both; }
.msg--izq.entra { transform-origin: left bottom; }
.msg--der.entra { transform-origin: right bottom; }
@keyframes entrar { from { opacity: 0; transform: translateY(14px) scale(.9); } to { opacity: 1; transform: none; } }

.burbuja {
  position: relative;
  max-width: min(80%, 330px);
  padding: 8px 12px 6px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 1px 1.5px rgba(40, 50, 60, .07), 0 8px 16px -12px rgba(40, 50, 60, .28);
  font-size: .98rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.msg--izq .burbuja { border-bottom-left-radius: 6px; }
.msg--der .burbuja { background: var(--salvia); border-bottom-right-radius: 6px; }
.burbuja__autor { display: block; margin-bottom: 1px; font-size: .72rem; font-weight: 700; color: var(--rubor-2); }
.burbuja__txt { margin: 0; }
.burbuja__nombre { color: var(--azul-2); }
.burbuja__meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; margin-top: 2px; font-size: .66rem; color: #8b9693; }
.visto { width: 17px; height: 11px; color: #a7b1ae; transition: color .4s ease; }
.leido .visto { color: var(--azul-2); }

.burbuja--grande .burbuja__txt { font-family: var(--serif); font-size: 2.2rem; line-height: 1.1; letter-spacing: .02em; }
.msg--izq .burbuja--grande { background: linear-gradient(135deg, #fff, #fdf0ed); }

/* Foto */
.burbuja--foto { padding: 4px 4px 6px; }
.burbuja--foto .burbuja__autor { padding: 2px 8px 2px; }
.burbuja__foto { display: block; width: 100%; max-width: 250px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; background: #eef1ef; }
.burbuja--foto .burbuja__txt, .burbuja--foto .burbuja__meta { padding: 6px 8px 0; }

/* Nota de voz */
.burbuja--voz { min-width: min(260px, 78vw); padding: 8px 12px 6px 8px; }
.voz { display: flex; align-items: center; gap: 10px; }
.voz__play {
  all: unset;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--azul);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 14px -6px rgba(79, 122, 166, .7);
}
.voz__play:focus-visible { outline: 2px solid var(--azul-2); outline-offset: 3px; }
.voz__i { width: 20px; height: 20px; grid-area: 1 / 1; }
.voz__i--pausa { display: none; }
.sonando .voz__i--play { display: none; }
.sonando .voz__i--pausa { display: block; }
.invita .voz__play::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--azul); animation: invita 1.6s ease-out infinite; }
@keyframes invita { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }
.voz__onda { flex: 1; height: 30px; display: flex; align-items: center; gap: 2px; }
.voz__onda i { flex: 1; min-width: 2px; border-radius: 2px; background: #a9c3b5; transform-origin: center; transition: background-color .2s; }
.voz__onda i.activa { background: var(--azul-2); }
.sonando .voz__onda i { animation: ondear .46s ease-in-out infinite alternate; }
@keyframes ondear { from { transform: scaleY(.45); } to { transform: scaleY(1.15); } }
.voz__dur { flex: none; min-width: 2.2em; font-size: .74rem; color: var(--suave); font-variant-numeric: tabular-nums; }
.voz__pista { display: block; margin-top: 2px; font-size: .7rem; font-style: italic; color: var(--azul-2); opacity: 0; transition: opacity .4s; }
.invita ~ .voz__pista { opacity: 1; }

/* Tarjeta de fecha */
.burbuja--fecha { padding: 6px 6px 6px; }
.tarjeta-fecha {
  width: 176px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(47, 53, 55, .06);
}
.tarjeta-fecha__mes { align-self: stretch; padding: 6px 0; background: var(--rubor); color: #6b3f37; font-size: .78rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; }
.tarjeta-fecha__dia { margin-top: 4px; font-family: var(--serif); font-size: 3.6rem; line-height: 1; }
.tarjeta-fecha__sem { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--azul-2); }
.tarjeta-fecha__hora { margin: 2px 0 10px; font-size: .78rem; color: var(--suave); }
.burbuja--fecha .burbuja__txt, .burbuja--fecha .burbuja__meta { padding: 6px 6px 0; }
.burbuja--fecha .burbuja__txt { font-weight: 700; }

/* Tarjeta de ubicación */
.burbuja--mapa { padding: 4px 4px 6px; }
.burbuja--mapa .burbuja__autor { padding: 2px 8px; }
.mapa { display: flex; flex-direction: column; width: min(250px, 70vw); overflow: hidden; border-radius: 16px; background: #fff; color: inherit; text-decoration: none; box-shadow: inset 0 0 0 1px rgba(47, 53, 55, .06); }
.mapa:focus-visible { outline: 2px solid var(--azul-2); outline-offset: 2px; }
.mapa__img svg { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; }
.mapa__lugar { padding: 8px 12px 0; font-weight: 700; font-size: .94rem; line-height: 1.25; }
.mapa__dir { padding: 2px 12px 0; font-size: .8rem; color: var(--suave); line-height: 1.35; }
.mapa__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--azul-2); }
.mapa__gota { transform-box: fill-box; transform-origin: 50% 100%; }
.mapa__onda { transform-box: fill-box; transform-origin: center; opacity: 0; }
.entra .mapa__gota { animation: caerPin .8s .3s cubic-bezier(.3, 1.6, .5, 1) both; }
.entra .mapa__onda { animation: ondaPin 1.8s 1s ease-out infinite; }
@keyframes caerPin { from { transform: translateY(-40px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ondaPin { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.burbuja--mapa .burbuja__txt, .burbuja--mapa .burbuja__meta { padding: 6px 8px 0; }

/* Sticker */
.burbuja--sticker { padding: 0; background: none !important; box-shadow: none; }
.burbuja--sticker .burbuja__meta { margin-top: -6px; padding-right: 8px; }
.sticker { display: block; width: 124px; height: auto; overflow: visible; filter: drop-shadow(0 8px 12px rgba(200, 120, 110, .3)); }
.sticker__grande, .sticker__mini { transform-box: fill-box; transform-origin: center; }
.entra .sticker__grande { animation: latido 1.3s .2s ease-in-out 2; }
.entra .sticker__mini--1 { animation: flotar 2.4s ease-in-out infinite; }
.entra .sticker__mini--2 { animation: flotar 2.4s -1.2s ease-in-out infinite; }
@keyframes latido { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.14); } 30% { transform: scale(.96); } 45% { transform: scale(1.08); } }
@keyframes flotar { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-6px) rotate(8deg); } }

/* Chips de fecha y avisos del sistema */
.chip { display: flex; justify-content: center; margin: 10px 0 4px; }
.chip > span { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .9); box-shadow: 0 1px 2px rgba(40, 50, 60, .08); font-size: .72rem; font-weight: 600; letter-spacing: .04em; color: #6d7977; text-align: center; }
.chip[data-grupo] > span { background: #eaf1f8; color: var(--azul-2); }
.chip.entra { animation: aparecerChip .5s ease both; }
@keyframes aparecerChip { from { opacity: 0; transform: scale(.85); } }

/* Indicador "escribiendo" */
.burbuja--puntos { display: flex; gap: 4px; padding: 13px 14px; }
.burbuja--puntos i { width: 7px; height: 7px; border-radius: 50%; background: #a3b2ad; animation: punto 1.2s ease-in-out infinite; }
.burbuja--puntos i:nth-child(2) { animation-delay: .15s; }
.burbuja--puntos i:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.msg--escribiendo:not([hidden]) { animation: entrar .3s ease both; }

/* Pie: barra de escritura → respuestas rápidas */
.chat__pie {
  position: relative;
  z-index: 3;
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 10px);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(47, 53, 55, .06);
  transition: padding .5s ease;
}
.chat__barra { display: flex; align-items: center; gap: 8px; }
.chat__campo { flex: 1; display: flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 999px; background: #f1f2f0; color: #9aa4a1; font-size: .92rem; }
.chat__enviar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--azul); color: #fff; }
.chat__pista { margin: 6px 0 0; text-align: center; font-size: .7rem; letter-spacing: .06em; color: var(--suave); animation: respirar 2.4s ease-in-out infinite; }
@keyframes respirar { 50% { opacity: .45; } }
.respuestas { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.respuesta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--azul);
  background: #fff;
  color: #34587d;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  animation: entrar .5s cubic-bezier(.2, .9, .3, 1.25) both;
  transition: transform .2s ease;
}
.respuesta:nth-child(2) { animation-delay: .12s; }
.respuesta:nth-child(3) { animation-delay: .24s; }
.respuesta:active { transform: scale(.96); }
.respuesta:focus-visible { outline: 2px solid var(--azul-2); outline-offset: 2px; }
.respuesta--si { flex-basis: 100%; border-color: transparent; background: linear-gradient(135deg, #f6dcd6, var(--rubor) 60%, #eebdb3); color: #5a3a34; box-shadow: 0 10px 20px -12px rgba(201, 134, 123, .8); }
.chat.listo .chat__pie { padding-bottom: calc(env(safe-area-inset-bottom) + 58px); }
.chat .desliza-c { z-index: 4; color: var(--azul-2); }

/* ================= INVITACIÓN ================= */
.contenido { background: var(--fondo); box-shadow: 0 0 60px -26px rgba(40, 60, 80, .35); }

.anuncio { padding-top: 80px; }
.anuncio__eyebrow { margin: 0; padding: 6px 14px; border-radius: 999px; background: #eaf1f8; font-size: .72rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--azul-2); }
.anuncio__nombres { margin: 18px 0 0; font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 15vw, 4.2rem); line-height: .98; }
.anuncio__nombres .amp { display: block; font-size: .5em; margin: 4px 0; }
.anuncio__foto { position: relative; width: min(88%, 360px); margin: 30px 0 0; padding: 6px; border-radius: 28px 28px 28px 8px; background: #fff; box-shadow: var(--s-sombra); }
.anuncio__foto img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 22px 22px 22px 4px; }
.anuncio__hora { display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 8px 8px 2px; font-size: .78rem; color: var(--suave); }
.anuncio__hora .visto { color: var(--azul-2); }
.anuncio__txt { margin: 26px 0 0; max-width: 21em; font-size: 1.05rem; line-height: 1.6; }

.s-cuenta__caja { border-radius: 18px 18px 18px 6px; }
.s-cuenta__caja:nth-child(even) { background: var(--salvia); border-radius: 18px 18px 6px 18px; }
.s-evento:nth-child(odd) { border-radius: 24px 24px 24px 8px; }
.s-evento:nth-child(even) { border-radius: 24px 24px 8px 24px; background: var(--salvia); }
.s-evento__icono { background: #fff; border-color: var(--rubor); color: var(--rubor-2); }
.s-evento__titulo { color: var(--azul-2); }
.s-foto:nth-child(2) { border-radius: 22px 22px 22px 6px; }
.s-foto:nth-child(3) { border-radius: 22px 22px 6px 22px; }
.s-vestimenta { background: linear-gradient(180deg, var(--fondo), #eef4f9 50%, var(--fondo)); }
.s-vestimenta__tipo { font-family: var(--serif); color: var(--azul-2); }
.s-rsvp { background: radial-gradient(80% 60% at 50% 40%, rgba(242, 207, 200, .45), transparent 75%); }
.s-rsvp__saludo { font-family: var(--serif); color: var(--rubor-2); }
.s-btn--lleno { background: linear-gradient(135deg, #a9c6e4, var(--azul)); }
.s-pie__n { font-family: var(--serif); }
.btn-musica { background: #fff; color: var(--azul-2); box-shadow: 0 6px 18px rgba(40, 60, 80, .2); }

@media (prefers-reduced-motion: reduce) {
  .msg.entra, .chip.entra, .respuesta, .chat__pista, .burbuja--puntos i, .invita .voz__play::after,
  .entra .sticker__grande, .entra .sticker__mini--1, .entra .sticker__mini--2, .entra .mapa__onda, .sonando .voz__onda i { animation: none !important; }
  .entra .mapa__gota { animation: none; }
}
