/* ============================================================
   Itinerario Santiago — estilos
   Paleta: noche santiaguina + pétalos de rosa + hilo dorado
   ============================================================ */
:root {
  --noche:   #221A30;   /* fondo */
  --noche-2: #2C2140;   /* tarjetas */
  --noche-3: #372A50;   /* hover / chips */
  --linea:   #4A3A63;   /* bordes */
  --rosa:    #F2A0B5;   /* acento principal */
  --rosa-os: #D4738F;   /* rosa oscuro */
  --oro:     #E9C98F;   /* hilo dorado, horas */
  --crema:   #F8F1EA;   /* texto */
  --tenue:   #B8A9CC;   /* texto secundario */
  --radio: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--noche);
  color: var(--crema);
  font-family: 'Karla', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ======== HERO ======== */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 72px 24px 56px;
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, #3A2B56 0%, var(--noche) 70%),
    var(--noche);
}
.hero-eyebrow {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--oro);
  margin-bottom: 14px;
}
.hero-titulo {
  font-family: 'Fraunces', serif;
  font-weight: 380;
  font-size: clamp(44px, 12vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.01em;
}
.hero-titulo em {
  font-style: italic;
  color: var(--rosa);
}
.hero-nota {
  margin-top: 14px;
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--tenue);
}

/* Cuenta regresiva */
.countdown {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}
.cd-item {
  min-width: 72px;
  padding: 10px 12px;
  border: 1px solid var(--linea);
  border-radius: 14px;
  background: rgba(44, 33, 64, .6);
  backdrop-filter: blur(4px);
}
.cd-item b {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--oro);
}
.cd-item span {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tenue);
}

/* Pétalos cayendo */
.petalos { position: absolute; inset: 0; pointer-events: none; }
.petalos span {
  position: absolute;
  top: -30px;
  width: 14px; height: 11px;
  background: var(--rosa);
  border-radius: 80% 20% 80% 20%;
  opacity: .55;
  animation: caer linear infinite;
}
.petalos span:nth-child(1)  { left: 6%;  animation-duration: 11s; animation-delay: 0s;   transform: scale(.8); }
.petalos span:nth-child(2)  { left: 16%; animation-duration: 14s; animation-delay: 2s; }
.petalos span:nth-child(3)  { left: 27%; animation-duration: 10s; animation-delay: 5s;  transform: scale(.7); }
.petalos span:nth-child(4)  { left: 38%; animation-duration: 15s; animation-delay: 1s; }
.petalos span:nth-child(5)  { left: 49%; animation-duration: 12s; animation-delay: 7s;  transform: scale(.9); }
.petalos span:nth-child(6)  { left: 58%; animation-duration: 16s; animation-delay: 3s;  transform: scale(.65); }
.petalos span:nth-child(7)  { left: 68%; animation-duration: 11s; animation-delay: 8s; }
.petalos span:nth-child(8)  { left: 78%; animation-duration: 13s; animation-delay: 4s;  transform: scale(.75); }
.petalos span:nth-child(9)  { left: 88%; animation-duration: 15s; animation-delay: 6s; }
.petalos span:nth-child(10) { left: 95%; animation-duration: 12s; animation-delay: 9s;  transform: scale(.85); }
@keyframes caer {
  0%   { transform: translateY(-30px) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(540deg); }
}

/* ======== TABS DE DÍAS ======== */
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  background: rgba(34, 26, 48, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  border: 1px solid var(--linea);
  background: transparent;
  color: var(--tenue);
  font-family: 'Karla', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .25s ease;
}
.tab.activa {
  background: var(--rosa);
  border-color: var(--rosa);
  color: #3A1220;
  font-weight: 700;
}

/* ======== CONTENIDO / DÍA ======== */
main { max-width: 640px; margin: 0 auto; padding: 28px 20px 40px; }
.dia { display: none; }
.dia.activa { display: block; animation: aparecer .4s ease; }
@keyframes aparecer {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.dia-titulo {
  font-family: 'Fraunces', serif;
  font-weight: 420;
  font-size: 30px;
  margin-bottom: 2px;
}
.dia-sub {
  font-family: 'Caveat', cursive;
  font-size: 21px;
  color: var(--rosa);
  margin-bottom: 26px;
}

/* Línea de tiempo con hilo dorado */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--oro), var(--rosa-os));
  opacity: .5;
  border-radius: 2px;
}
.evento {
  position: relative;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.evento.visible { opacity: 1; transform: none; }
.evento::before {
  content: '';
  position: absolute;
  left: -25px; top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--noche);
  border: 2px solid var(--oro);
}
.evento.es-sorpresa::before { border-color: var(--rosa); background: var(--rosa); }

.tarjeta {
  background: var(--noche-2);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 16px 18px;
}
.evento-hora {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--oro);
  font-weight: 700;
}
.evento-titulo {
  font-family: 'Fraunces', serif;
  font-weight: 480;
  font-size: 20px;
  margin: 4px 0 2px;
}
.evento-detalle { color: var(--tenue); font-size: 14.5px; }
.evento-nota {
  font-family: 'Caveat', cursive;
  font-size: 19px;
  color: var(--rosa);
  margin-top: 6px;
}

/* Tarjeta sorpresa */
.tarjeta.sorpresa {
  border-color: var(--rosa-os);
  background:
    linear-gradient(120deg, rgba(242,160,181,.10) 0%, rgba(233,201,143,.10) 50%, rgba(242,160,181,.10) 100%),
    var(--noche-2);
  background-size: 200% 100%;
  animation: brillo 5s ease infinite;
}
@keyframes brillo {
  0%, 100% { background-position: 0% 0; }
  50%       { background-position: 100% 0; }
}

/* Bloques de elección */
.eleccion {
  margin-top: 12px;
  border-top: 1px dashed var(--linea);
  padding-top: 12px;
}
.eleccion-titulo {
  font-family: 'Caveat', cursive;
  font-size: 21px;
  color: var(--oro);
  margin-bottom: 10px;
}
.opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.opcion {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--linea);
  background: var(--noche-3);
  color: var(--crema);
  font-family: 'Karla', sans-serif;
  font-size: 14.5px;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .22s ease;
}
.opcion .corazon { transition: transform .25s ease; }
.opcion.elegida {
  background: var(--rosa);
  border-color: var(--rosa);
  color: #3A1220;
  font-weight: 700;
}
.opcion.elegida .corazon { transform: scale(1.25); }
.opcion:active { transform: scale(.96); }
.eleccion-ayuda { font-size: 12.5px; color: var(--tenue); margin-top: 8px; }

/* Botón de recuerdos */
.btn-recuerdos {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--oro);
  background: transparent;
  color: var(--oro);
  font-family: 'Karla', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .22s ease;
}
.btn-recuerdos:hover { background: rgba(233,201,143,.12); }
.btn-recuerdos .cont {
  background: var(--oro);
  color: #3A2C10;
  border-radius: 999px;
  font-size: 11.5px;
  padding: 1px 7px;
}

/* Despedida (miércoles) */
.despedida {
  text-align: center;
  padding: 30px 10px;
}
.despedida .grande { font-size: 44px; margin-bottom: 12px; }
.despedida h3 {
  font-family: 'Fraunces', serif;
  font-weight: 420;
  font-size: 26px;
  margin-bottom: 8px;
}
.despedida p { color: var(--tenue); max-width: 400px; margin: 0 auto; }
.despedida .firma {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  color: var(--rosa);
  margin-top: 16px;
}

/* ======== ÁLBUM ======== */
.album-vacio { text-align: center; color: var(--tenue); padding: 40px 10px; }
.album-vacio .grande { font-size: 40px; margin-bottom: 10px; }
.album-grupo { margin-bottom: 30px; }
.album-grupo-titulo {
  font-family: 'Fraunces', serif;
  font-weight: 480;
  font-size: 20px;
  margin-bottom: 4px;
}
.album-grupo-dia {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--oro);
}
.album-entrada {
  background: var(--noche-2);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 14px 16px;
  margin-top: 10px;
}
.album-autor {
  font-family: 'Caveat', cursive;
  font-size: 20px;
  color: var(--rosa);
}
.album-fecha { font-size: 12px; color: var(--tenue); margin-left: 6px; }
.album-comentario { margin-top: 4px; font-size: 15px; white-space: pre-wrap; }
.album-fotos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.album-fotos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .2s ease;
}
.album-fotos img:active { transform: scale(.96); }
.album-borrar {
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--tenue);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* ======== MODAL ======== */
.modal-fondo {
  position: fixed; inset: 0;
  z-index: 50;
  background: rgba(15, 10, 24, .75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--noche);
  border: 1px solid var(--linea);
  border-radius: 22px 22px 0 0;
  padding: 24px 20px 34px;
  animation: subir .3s ease;
}
@keyframes subir {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal-cerrar {
  position: absolute; top: 12px; right: 14px;
  background: var(--noche-3);
  border: none;
  color: var(--crema);
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}
.modal-eyebrow {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--oro);
}
.modal-titulo {
  font-family: 'Fraunces', serif;
  font-weight: 460;
  font-size: 24px;
  margin: 2px 0 16px;
}
.recuerdos-lista .album-entrada:first-child { margin-top: 0; }
.recuerdos-lista { margin-bottom: 18px; }
.recuerdos-vacio { color: var(--tenue); font-size: 14px; margin-bottom: 18px; }

.campo { display: block; margin-bottom: 12px; }
.campo span {
  display: block;
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--tenue);
  margin-bottom: 5px;
}
.campo input[type="text"],
.campo textarea {
  width: 100%;
  background: var(--noche-2);
  border: 1px solid var(--linea);
  border-radius: 12px;
  color: var(--crema);
  font-family: 'Karla', sans-serif;
  font-size: 15px;
  padding: 10px 12px;
  outline: none;
}
.campo input:focus, .campo textarea:focus { border-color: var(--rosa); }
.campo input[type="file"] { color: var(--tenue); font-size: 13px; }
.previas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.previas img {
  width: 58px; height: 58px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--linea);
}
.btn-guardar {
  width: 100%;
  background: var(--rosa);
  border: none;
  color: #3A1220;
  font-family: 'Karla', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 13px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .15s ease;
}
.btn-guardar:active { transform: scale(.98); }
.btn-guardar:disabled { opacity: .6; }
.form-estado { margin-top: 10px; font-size: 14px; color: var(--oro); text-align: center; }

/* ======== VISOR DE FOTOS ======== */
.visor {
  position: fixed; inset: 0;
  z-index: 60;
  background: rgba(10, 6, 18, .95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.visor img { max-width: 100%; max-height: 90vh; border-radius: 12px; }
.visor-cerrar {
  position: absolute; top: 16px; right: 18px;
  background: var(--noche-3);
  border: none;
  color: var(--crema);
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}

/* ======== PIE ======== */
.pie { text-align: center; padding: 10px 20px 46px; }
.pie-nota { font-family: 'Caveat', cursive; font-size: 21px; color: var(--tenue); }

/* ======== ACCESIBILIDAD ======== */
button:focus-visible, .opcion:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--oro);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .evento { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* El atributo hidden debe ganar siempre: .visor y .modal-fondo definen
   display:flex en una clase de autor, que sin esto pisa el [hidden]{display:none}
   del navegador y deja el visor/modal abiertos al cargar. */
[hidden] { display: none !important; }

/* ======== ÁLBUM: FOTOS TIPO POLAROID ======== */
.polaroids {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 12px; justify-content: center;
}
.polaroid {
  background: #FFFDF8;
  padding: 10px 10px 0;
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  width: 190px;
  transform: rotate(-2deg);
  transition: transform .25s ease, box-shadow .25s ease;
}
.polaroid:nth-child(even) { transform: rotate(2deg); }
.polaroid:nth-child(3n)   { transform: rotate(-1.2deg); }
.polaroid:hover { transform: rotate(0) scale(1.04); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); z-index: 2; }
.polaroid img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  display: block; border-radius: 1px; cursor: pointer; background: #ece6df;
}
.polaroid-pie {
  padding: 10px 6px 14px; text-align: center; line-height: 1.2;
}
.polaroid-que {
  display: block; font-family: 'Caveat', cursive; font-weight: 600;
  font-size: 21px; color: #2b2320;
}
.polaroid-fecha {
  display: block; margin-top: 2px; font-family: 'Caveat', cursive;
  font-size: 15px; color: #9a8a7f;
}

/* ======== MODAL DE BIENVENIDA ======== */
.bienvenida-fondo {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 10, 24, .82);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.bienvenida {
  position: relative; width: 100%; max-width: 440px;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, #3A2B56 0%, var(--noche-2) 70%),
    var(--noche-2);
  border: 1px solid var(--linea);
  border-radius: 22px;
  padding: 34px 26px 26px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  animation: bienvenidaEntra .5s ease;
}
@keyframes bienvenidaEntra {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.bienvenida-flor { font-size: 40px; margin-bottom: 4px; }
.bienvenida-eyebrow { font-family: 'Caveat', cursive; font-size: 20px; color: var(--rosa); }
.bienvenida-titulo {
  font-family: 'Fraunces', serif; font-size: 30px;
  margin: 2px 0 14px; color: var(--crema);
}
.bienvenida-texto { font-size: 16px; color: var(--crema); line-height: 1.6; }
.bienvenida-ayuda { margin-top: 14px; font-size: 14px; color: var(--tenue); line-height: 1.5; }
.bienvenida-acciones {
  margin-top: 22px; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.btn-comenzar {
  width: 100%; padding: 13px 20px; border: none; border-radius: 999px;
  background: linear-gradient(135deg, var(--rosa), var(--rosa-os));
  color: #3a1d27; font-family: 'Karla', sans-serif; font-weight: 700; font-size: 16px;
  cursor: pointer; transition: transform .15s ease, filter .15s ease;
}
.btn-comenzar:hover { filter: brightness(1.06); transform: translateY(-1px); }
.bienvenida-nomostrar {
  background: none; border: none; color: var(--tenue);
  font-family: 'Karla', sans-serif; font-size: 13px; cursor: pointer;
  text-decoration: underline; padding: 4px;
}
.bienvenida-nomostrar:hover { color: var(--crema); }
