/* ==================================================
   MIMO DIGITAL — San Valentín V2: Sobre de Lacre & Carta
   Romántica, simple, emotiva y fácil de personalizar
   ================================================== */

:root {
  --bg-deep: #0f0408;
  --envelope-wine: #2a0b14;
  --envelope-border: #4d1525;
  --seal-gold: #e2b755;
  --paper-cream: #faf7f2;
  --ink-dark: #2a1f23;
  --rose-accent: #c9184a;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-deep);
  background-image: radial-gradient(circle at 50% 20%, #300c19 0%, var(--bg-deep) 75%);
  color: #fff;
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.letter-experience {
  width: 100%;
  max-width: 480px;
}

/* ── FASE 1: Sobre Cerrado ── */
.envelope-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 0;
}

.envelope-box {
  width: 100%;
  max-width: 380px;
  height: 250px;
  background: var(--envelope-wine);
  border-radius: 16px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 0 1px var(--envelope-border);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  overflow: hidden;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 130px;
  background: #360f1b;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-bottom: 2px solid rgba(226, 183, 85, 0.3);
  z-index: 2;
  transition: transform 0.6s ease;
}

.envelope-pocket {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.wax-seal-btn {
  width: 68px;
  height: 68px;
  background: radial-gradient(circle, #df375b 0%, #a01433 100%);
  border-radius: 50%;
  border: 2px solid #ff758f;
  box-shadow: 0 8px 20px rgba(160, 20, 51, 0.6), inset 0 2px 4px rgba(255,255,255,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wax-seal-btn:hover {
  transform: scale(1.1);
}

.wax-seal-btn:active {
  transform: scale(0.95);
}

.seal-heart {
  font-size: 1.5rem;
}

.seal-hint {
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: #fff;
  font-weight: 700;
  margin-top: 2px;
}

.envelope-to {
  text-align: center;
}

.to-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--seal-gold);
  font-weight: 600;
}

.to-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: #fff;
  margin-top: 2px;
}

/* ── FASE 2: Carta Desplegada ── */
.letter-sheet {
  background: var(--paper-cream);
  color: var(--ink-dark);
  border-radius: 20px;
  padding: 2.2rem 1.8rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.4);
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  animation: unfoldLetter 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.sheet-header {
  text-align: center;
  border-bottom: 1px solid #e0d8cc;
  padding-bottom: 1rem;
}

.sheet-date {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--rose-accent);
  font-weight: 700;
}

.sheet-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1.2;
  margin-top: 4px;
  color: #1a0f12;
}

.sheet-message {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.8;
  color: #382c30;
  white-space: pre-line;
  text-align: justify;
}

/* ── Galería Deslizable ── */
.sheet-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.gallery-heading {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: #88787c;
  text-align: center;
}

.slider-photo-box {
  width: 100%;
  aspect-ratio: 16/10;
  background: #ede8df;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid #ded5c8;
}

.slider-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #88787c;
  font-size: 0.85rem;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  color: #fff;
  padding: 16px 12px 8px 12px;
  font-size: 0.85rem;
  text-align: center;
}

.gallery-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.gal-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ede8df;
  border: 1px solid #dcd5c7;
  color: #333;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gal-counter {
  font-size: 0.8rem;
  color: #88787c;
}

/* ── Propuesta ── */
.proposal-card {
  background: #f4ecdf;
  border: 1.5px dashed #d1c5b4;
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.proposal-question {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--rose-accent);
}

.proposal-sub {
  font-size: 0.9rem;
  color: #665a5e;
}

.proposal-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.4rem;
}

.love-choice-btn {
  padding: 10px 20px;
  border-radius: 25px;
  border: 1px solid var(--rose-accent);
  background: #fff;
  color: var(--rose-accent);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.love-choice-btn.primary {
  background: var(--rose-accent);
  color: #fff;
}

.love-choice-btn:hover {
  transform: scale(1.05);
}

.proposal-accepted-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: popMessage 0.4s ease forwards;
}

.big-heart-icon {
  font-size: 2.5rem;
}

.proposal-accepted-msg h4 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--rose-accent);
}

.proposal-accepted-msg p {
  font-size: 0.85rem;
  color: #665a5e;
}

/* ── Footer ── */
.sheet-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 0.5rem;
  border-top: 1px solid #e0d8cc;
}

.signature-line {
  font-size: 0.85rem;
  color: #88787c;
  font-style: italic;
}

.signature-author {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--rose-accent);
}

@keyframes unfoldLetter {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes popMessage {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
