:root {
  --crema: #FBF7FC;
  --crema-2: #F1E6F7;
  --lila-suave: #E4CFF0;
  --lila: #C9A6E0;
  --morado-medio: #9B72C4;
  --morado: #7E5A9B;
  --morado-profundo: #4A2F66;
  --morado-texto: #43285D;
  --blanco: #ffffff;

  --fuente-firma: "Dancing Script", cursive;
  --fuente-etiqueta: "Cormorant Garamond", serif;
  --fuente-ui: "Quicksand", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  height: 100vh;
  font-family: var(--fuente-ui);
  color: var(--morado-texto);
  background-color: var(--crema);
  overflow: hidden;
}

#pantalla-pin {
  background-image: url("fondo-pine.png");
  background-size: cover;
  background-position: center 15%;
  background-repeat: no-repeat;
}

#pantalla-contenido {
  background-image: url("Fondo2.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.oculto { display: none !important; }

.pantalla {
  position: relative;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 24px;
}


.pantalla-fondo {
  padding-bottom: 1vh;
}


.tarjeta-pin {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 20px 28px;
  border-radius: 28px;
  background: rgba(255, 250, 253, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 34px rgba(90, 55, 120, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.firma {
  font-family: var(--fuente-etiqueta);
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0 0 2px;
  color: var(--morado-profundo);
}
.firma span { font-weight: 600; }

.subtitulo {
  font-family: var(--fuente-etiqueta);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--morado);
  text-align: center;
  margin: 0 0 18px;
}


.aparecer {
  opacity: 0;
  transform: translateY(14px);
  animation: aparecerTarjeta .6s cubic-bezier(.2,.7,.3,1) forwards;
  animation-delay: var(--retraso, 0s);
}
.tarjeta-pin {
  opacity: 0;
  animation: aparecerPanel .7s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes aparecerTarjeta {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes aparecerPanel {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .aparecer, .tarjeta-pin {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}


.pin-puntos {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}
.pin-punto {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--morado-medio);
  background: transparent;
  transition: background .15s ease, transform .15s ease;
}
.pin-punto.lleno {
  background: var(--morado-medio);
  transform: scale(1.1);
}

.pin-puntos.error-shake {
  animation: agitar .4s ease;
}
.pin-puntos.error-shake .pin-punto {
  border-color: #b0518f;
  background: #b0518f;
}
@keyframes agitar {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}


.teclado {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 12px;
  justify-content: center;
}

.tecla {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(160deg, var(--blanco), var(--crema-2));
  box-shadow: 0 3px 10px rgba(124, 90, 155, 0.22);
  font-family: var(--fuente-ui);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--morado-profundo);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, background .15s ease;
}
.tecla:hover { background: linear-gradient(160deg, var(--blanco), var(--lila-suave)); }
.tecla:active { transform: scale(.94); box-shadow: 0 1px 4px rgba(124, 90, 155, 0.3); }
.tecla:focus-visible { outline: 2px solid var(--morado-medio); outline-offset: 2px; }

.tecla-vacia { visibility: hidden; box-shadow: none; border: none; background: none; cursor: default; }

.tecla-borrar {
  font-size: 1.1rem;
  color: var(--morado);
  background: transparent;
  box-shadow: none;
  border: 1px solid transparent;
}
.tecla-borrar:hover { background: rgba(241, 230, 247, 0.7); }

.error {
  min-height: 1.2em;
  margin-top: 16px;
  font-size: .9rem;
  color: #a8477d;
  font-weight: 600;
}


.tarjeta-contenido {
  width: 100%;
  max-width: 760px;
}


@media (max-width: 360px) {
  .teclado { grid-template-columns: repeat(3, 58px); gap: 10px; }
  .tecla { width: 58px; height: 58px; }
  .tarjeta-pin { max-width: 300px; padding: 18px 14px 22px; }
}

@media (min-height: 760px) {
  .pantalla-fondo { justify-content: center; padding-bottom: 0; }
}


#pantalla-contenido {
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: 5vh;
  padding-bottom: 5vh;
}

.titulo-razones {
  font-family: var(--fuente-etiqueta);
  font-weight: 800;
  font-style: italic;
  font-size: 2.0rem;
  line-height: 1.25;
  color: var(--morado-profundo);
  margin: 0 0 18px;
  text-align: center;
}

.contenido-dia {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  width: 100%;
  align-items: stretch;
}
@media (max-width: 720px) {
  .contenido-dia { grid-template-columns: 1fr; }
}

.panel-mensajes {
  background: rgba(255, 250, 253, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 22px;
  padding: 18px 20px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(90, 55, 120, 0.14);
}

.lista-razones {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lista-razones li {
  position: relative;
  padding-left: 24px;
  font-family: var(--fuente-etiqueta);
  font-size: 1.05rem;
  color: var(--morado-texto);
}
.lista-razones li::before {
  content: "♡";
  position: absolute;
  left: 0;
  color: var(--morado-medio);
}

.panel-video {
  display: flex;
  align-items: stretch;
  height: 100%;
}
.marco-video {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 6px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 30px rgba(90, 55, 120, 0.22);
  background: var(--crema-2);
}
.marco-video iframe { width: 100%; height: 100%; border: 0; display: block; }

.seccion-final {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px dashed rgba(155, 114, 196, 0.4);
  text-align: center;
}
.mensaje-final {
  font-family: var(--fuente-etiqueta);
  font-style: italic;
  font-size: 1.1rem;
  margin: 8px 0 18px;
}
.qrs { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.qr-caja {
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--morado-medio);
  overflow: hidden;
}
.qr-caja img { width: 100%; height: 100%; object-fit: contain; }

.sobre-cerrado {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 14px auto 0;
  padding: 18px 26px;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .3s ease;
}
.sobre-cerrado:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(90, 55, 120, 0.2); }
.sobre-cerrado:active { transform: scale(.96); }
.sobre-cerrado.abriendo .icono-candado { transform: rotate(-10deg) scale(1.15); }
.sobre-cerrado.oculto-tras-abrir { display: none; }

.icono-candado { width: 64px; height: 64px; transition: transform .35s ease; }

.texto-sobre {
  font-family: var(--fuente-etiqueta);
  font-style: italic;
  color: var(--morado);
  font-size: 1.2rem;
}

.contenido-sorpresa {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .7s ease, opacity .6s ease .1s;
}
.contenido-sorpresa.abierto {
  max-height: 600px;
  opacity: 1;
  margin-top: 20px;
}