:root {
  --corinto: #7a1f3d;
  --rojo: #c8283c;
  --rosa: #f7a8bc;
  --rosa-pastel: #ffd6e0;
  --crema-rosa: #fff0f3;
  --texto: #4a1427;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100%;
  font-family: "Quicksand", system-ui, sans-serif;
  color: var(--texto);
  background:
    radial-gradient(circle at 15% 10%, var(--rosa-pastel) 0, transparent 45%),
    radial-gradient(circle at 85% 90%, var(--rosa) 0, transparent 40%),
    var(--crema-rosa);
  background-attachment: fixed;
  overflow-x: hidden;
}

.script {
  font-family: "Pacifico", cursive;
  font-weight: 400;
  color: var(--corinto);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.hidden { display: none !important; }

/* ---------- Corazones flotando ---------- */
.hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.heart {
  position: absolute;
  bottom: -40px;
  color: var(--rojo);
  opacity: 0;
  animation: subir linear infinite;
}

@keyframes subir {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: .55; }
  90%  { opacity: .35; }
  100% { transform: translateY(-115vh) rotate(25deg); opacity: 0; }
}

/* ---------- Pantallas y tarjeta ---------- */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(6px);
  border: 2px solid var(--rosa);
  border-radius: 32px;
  padding: 36px 26px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(122, 31, 61, .18);
}

.lock-card { max-width: 400px; }
.content-card { max-width: 820px; }

/* ---------- Pantalla de contraseña ---------- */
.lock-heart {
  color: var(--rojo);
  display: inline-block;
  margin-bottom: 8px;
  animation: latido 1.6s ease-in-out infinite;
}

@keyframes latido {
  0%, 100% { transform: scale(1); }
  15%      { transform: scale(1.18); }
  30%      { transform: scale(1); }
  45%      { transform: scale(1.12); }
}

.lock-card h1 { font-size: 2.6rem; margin-bottom: 6px; }

.lead { font-size: 1.05rem; margin-bottom: 22px; color: var(--corinto); }

form { display: flex; flex-direction: column; gap: 12px; }

input {
  width: 100%;
  padding: 14px 18px;
  font: inherit;
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 2px;
  color: var(--corinto);
  background: var(--crema-rosa);
  border: 2px solid var(--rosa);
  border-radius: 999px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input:focus-visible {
  border-color: var(--rojo);
  box-shadow: 0 0 0 4px rgba(200, 40, 60, .18);
}

button, .btn {
  display: inline-block;
  padding: 14px 26px;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--rojo), var(--corinto));
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(200, 40, 60, .35);
  transition: transform .15s;
}

button:hover, .btn:hover { transform: translateY(-2px); }
button:focus-visible, .btn:focus-visible { outline: 3px solid var(--corinto); outline-offset: 3px; }

.hint { margin-top: 18px; font-size: .92rem; opacity: .8; }

.error {
  min-height: 1.4em;
  margin-top: 10px;
  font-weight: 700;
  color: var(--rojo);
}

.shake { animation: sacudir .45s; }

@keyframes sacudir {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

/* ---------- Contenido ---------- */
.content-card h1 { font-size: clamp(2.4rem, 8vw, 3.8rem); }

.subtitle {
  margin: 6px 0 18px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--rojo);
}

.message {
  max-width: 520px;
  margin: 0 auto;
  font-size: 1.08rem;
  line-height: 1.7;
}

.divider {
  margin: 22px 0;
  color: var(--rosa);
  font-size: 1.4rem;
  letter-spacing: 10px;
}

.pdf-wrap {
  margin: 24px auto 0;
  height: 70vh;
  min-height: 380px;
  overflow: hidden;
  border: 3px solid var(--rosa);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(122, 31, 61, .15);
}

.pdf-wrap iframe { width: 100%; height: 100%; border: 0; }

.note { margin-top: 12px; font-size: .88rem; opacity: .75; }

.signature { margin-top: 26px; font-size: 1.6rem; }

@media (prefers-reduced-motion: reduce) {
  .heart, .lock-heart, .shake { animation: none; }
  .heart { opacity: .3; bottom: auto; }
}