:root {
  --bg-cream: #faf7f2;
  --card-bg: rgba(255, 255, 255, 0.90);
  --gold-dark: #b89358;
  --gold-light: #dfba7c;
  --text-main: #3a3836;
  --text-muted: #726e6a;
  --border-gold: rgba(184, 147, 88, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 1. Fondo general color crema */
body {
  background-color: #f5f0e9; 
  color: var(--text-main);
  font-family: 'Montserrat', sans-serif;
  text-align: center;
  line-height: 1.6;
  margin: 0;
  overflow-x: hidden;
}

/* Capa fija para las ramas (Reescalado Automático) */
body::before {
  content: "";
  position: fixed;
  top: 0; 
  left: 0;
  width: 100vw; 
  height: 100vh;
  z-index: -1; /* Las devuelve al fondo, detrás de la tarjeta */
  pointer-events: none; 
  
  background-image: 
    url('rama_1.png'), 
    url('rama_2.png'),
    url('rama_3.png'), 
    url('rama_4.png');
    
  background-position: 
    top left, 
    top right, 
    bottom left, 
    bottom right;
  background-repeat: no-repeat;
  
  /* MAGIA DE REESCALADO: 
     Mínimo 85px en celulares pequeños.
     Crece dinámicamente con la pantalla (22vw).
     Máximo 220px en monitores grandes. */
  background-size: clamp(85px, 22vw, 220px) auto; 
}


/* 2. Tu tarjeta blanca normal (Asegúrate de que quede así) */
.card {
  background: rgba(255, 255, 255, 0.85); /* Este es tu cuadro blanco */
  backdrop-filter: blur(8px);
  border: 1px solid rgba(184, 147, 88, 0.2);
  border-radius: 18px;
  padding: 36px 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  position: relative;
}

/* --- ESTILOS Y ANIMACIÓN DEL SOBRE DIGITAL --- */
/* --- ESTILOS Y ANIMACIÓN DEL SOBRE VERTICAL PREMIUM --- */
#envelope-screen {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: #f5f0e9; 
  background-image: radial-gradient(circle, rgba(184, 147, 88, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  perspective: 1200px;
}

#envelope-screen.hidden {
  opacity: 0; visibility: hidden; pointer-events: none;
}

.envelope-main {
  position: relative;
  width: 320px;
  height: 500px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.envelope-main:hover {
  transform: scale(1.02);
}

.envelope-body {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: #e3dec9; /* Fondo interior */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* Pliegues creados con rombos rotados para lograr las líneas exactas */
.env-left {
  position: absolute; width: 227px; height: 227px; 
  top: calc(50% - 113.5px); left: -113.5px; transform: rotate(45deg); 
  background: #eeeade; border-top: 1.5px solid #d4ad68; border-right: 1.5px solid #d4ad68;
}

.env-right {
  position: absolute; width: 227px; height: 227px; 
  top: calc(50% - 113.5px); right: -113.5px; transform: rotate(45deg); 
  background: #eeeade; border-bottom: 1.5px solid #d4ad68; border-left: 1.5px solid #d4ad68;
}

.env-bottom {
  position: absolute; width: 354px; height: 354px; 
  bottom: -177px; left: calc(50% - 177px); transform: rotate(45deg); 
  background: #f3efe4; border-top: 1.5px solid #d4ad68; border-left: 1.5px solid #d4ad68;
  box-shadow: -2px -2px 6px rgba(0,0,0,0.04);
}

/* Solapa superior que se abre */
.env-top-wrapper {
  position: absolute; top: 0; left: 0; width: 100%; height: 250px; 
  border-radius: 12px 12px 0 0; overflow: hidden;
  transform-origin: top center; transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
}

.env-top-diamond {
  position: absolute; width: 354px; height: 354px; 
  top: -177px; left: calc(50% - 177px); transform: rotate(45deg); 
  background: #f8f5ed; border-bottom: 1.5px solid #d4ad68; border-right: 1.5px solid #d4ad68;
  box-shadow: 3px 3px 8px rgba(0,0,0,0.06);
}

/* Textos e imágenes sobre el sobre */
.env-top-content {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 45px; z-index: 5;
}

.para-text {
  font-family: 'Great Vibes', cursive; font-size: 2.6rem; color: #435b3e; margin-bottom: -5px;
}

.guest-name {
  font-family: 'Cormorant Garamond', serif; font-size: 0.75rem; letter-spacing: 4px; font-weight: 600; color: #2d3b29;
}

.diamond-divider {
  font-size: 0.6rem; color: #647b5e; margin-top: 8px;
}

.env-branch-bl {
  position: absolute; bottom: 35px; left: 10px; width: 65px; z-index: 5; opacity: 0.9;
}

.env-branch-br {
  position: absolute; bottom: 35px; right: 10px; width: 65px; z-index: 5; opacity: 0.9; 
  transform: scaleX(-1); /* Voltea la imagen por si usas la misma rama */
}

.toca-sello {
  position: absolute; bottom: 20px; left: 0; width: 100%; text-align: center;
  font-family: 'Montserrat', sans-serif; font-size: 0.75rem; letter-spacing: 3px; color: #5a6650; z-index: 5;
}

/* Sello de Cera Verde */
.wax-seal {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 100px; height: 100px;
  background: #89a07b; border-radius: 50%; z-index: 10;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2), inset 0 0 15px rgba(255,255,255,0.3), inset 0 0 5px rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
  
  /* --- AJUSTES DE LETRA Y CENTRADO PERFECTO --- */
  font-family: 'Allura', cursive;
  font-size: 2.5rem; 
  letter-spacing: 2px; /* Separa las letras para que no se encimen */
  padding-left: 2px; /* Compensa el espacio extra para centrar la palabra exactamente en el medio */
  
  color: #eef2e6;
  text-shadow: -1px -1px 1px rgba(255,255,255,0.3), 1px 1px 2px rgba(0,0,0,0.4);
  border: 1px solid #738a66;
  transition: opacity 0.3s ease, transform 0.4s ease;
}

.wax-seal::before {
  content: ''; position: absolute; 
  width: 80px; height: 80px; 
  border: 1px solid rgba(255,255,255,0.15); border-radius: 50%;
}

/* --- CLASES DE ANIMACIÓN AL HACER CLIC --- */
.envelope-main.open .wax-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.4);
}

.envelope-main.open .env-top-wrapper {
  transform: rotateX(180deg);
  transition-delay: 0.2s;
}

.flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 160px solid transparent;
  border-right: 160px solid transparent;
  border-top: 130px solid var(--gold-light);
  transform-origin: top;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4;
}

.envelope-front {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 160px solid #d4ad68;
  border-right: 160px solid #d4ad68;
  border-bottom: 110px solid #c5a059;
  border-radius: 0 0 6px 6px;
  z-index: 3;
}

.letter {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: #fff;
  border-radius: 4px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s; /* El 0.3s es un retraso para que primero abra la solapa */
}

.letter-names {
  font-family: 'Great Vibes', cursive;
  font-size: 2.2rem;
  color: var(--gold-dark);
}

.letter-text {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* Clases activas al hacer clic */
.envelope-wrapper.open .flap {
  transform: rotateX(180deg);
  z-index: 1; /* Pasa hacia atrás */
}

.envelope-wrapper.open .letter {
  transform: translateY(-160px);
  z-index: 5; /* Pasa hacia adelante */
}

/* Opcional: Hacer las tarjetas un poco más transparentes para que se funda mejor con el fondo */
.card {
  background: rgba(255, 255, 255, 0.65); /* Más transparente */
  backdrop-filter: blur(8px);
  border: 1px solid rgba(184, 147, 88, 0.2);
  border-radius: 18px;
  padding: 36px 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  position: relative;
}

.container {
  max-width: 580px;
  margin: 0 auto;
  padding: 24px 18px;
}

/* Tarjetas y Contenedores */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  padding: 36px 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  position: relative;
}

/* Títulos y fuentes caligráficas Alex Brush */
h2 {
  font-family: 'Great Vibes', cursive;
  font-size: 2.8rem;
  color: var(--gold-dark);
  margin-bottom: 12px;
  line-height: 1.2;
  font-weight: 400;
}

.welcome-header {
  font-family: 'Great Vibes', cursive;
  font-size: 2.9rem;
  color: var(--gold-dark);
  line-height: 1.2;
  margin-bottom: 8px;
}

.welcome-sub {
  font-family: 'Alex Brush', cursive;
  font-size: 1.95rem;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 18px;
}

/* Fotografía de los novios */
.photo-wrapper {
  margin: 20px auto;
  max-width: 320px;
}

.hero-couple-img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 2px solid var(--gold-light);
  box-shadow: 0 8px 24px rgba(184, 147, 88, 0.25);
  display: block;
}

.welcome-quote {
  font-family: 'Alex Brush', cursive;
  font-size: 1.8rem;
  color: var(--text-main);
  line-height: 1.45;
  margin: 20px 0;
  padding: 0 10px;
}

.names-welcome {
  font-family: 'Alex Brush', cursive;
  font-size: 3.2rem;
  color: var(--gold-dark);
  line-height: 1.1;
  margin: 8px 0;
}

.cursive-text {
  font-family: 'Alex Brush', cursive;
  font-size: 1.85rem;
  line-height: 1.35;
  color: var(--text-main);
}

.cursive-gold {
  font-family: 'Alex Brush', cursive;
  font-size: 2.2rem;
  color: var(--gold-dark);
  line-height: 1.2;
}

/* Iconos personalizados */
.rings-img {
  width: 90px;
  max-width: 30%;
  height: auto;
  margin: 12px auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(184, 147, 88, 0.25));
}

.gift-icon-img {
  width: 58px;
  height: auto;
  margin: 0 auto 12px auto;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(184, 147, 88, 0.2));
}

/* --- TAMAÑOS INDEPENDIENTES PARA LOS EVENTOS --- */
.icon-reception {
  width: 80px; /* Tamaño del arco */
  height: auto;
  margin: 8px auto 12px auto;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(184, 147, 88, 0.15));
}

.icon-ceremony {
  width: 130px; /* Tamaño más grande para los novios */
  height: auto;
  margin: 8px auto 12px auto;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(184, 147, 88, 0.15));
}

.icon-dresscode {
  width: 90px; /* Ajusta este valor si lo quieres más grande o pequeño */
  height: auto;
  margin: 8px auto 12px auto;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(184, 147, 88, 0.15));
}

/* Portada y Contador */
.hero-pretitle {
  font-family: 'Alex Brush', cursive;
  font-size: 2.2rem;
  color: var(--gold-dark);
  margin-bottom: 6px;
  line-height: 1.2;
}

.date-hero {
  font-family: 'Alex Brush', cursive;
  font-size: 2.3rem;
  color: var(--text-main);
  margin-top: 4px;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.count-box {
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 10px 4px;
  background: #ffffff;
}

.count-box span {
  display: block;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--gold-dark);
  font-family: 'Cormorant Garamond', serif;
}

.count-box label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* Botones */
.btn {
  display: inline-block;
  padding: 12px 26px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  color: #ffffff;
  text-decoration: none;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  margin-top: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(184, 147, 88, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184, 147, 88, 0.4);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.event-info {
  margin-bottom: 20px;
}

.event-time {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold-dark);
}

/* Formulario */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  background: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 2px rgba(184, 147, 88, 0.2);
}

.bank-box {
  margin-top: 18px;
  padding: 16px;
  background: #fff;
  border-radius: 10px;
  border: 1px dashed var(--border-gold);
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer {
  font-family: 'Alex Brush', cursive; /* O la fuente que estés usando */
  color: var(--gold-dark);
  margin: 10px 0;
  
  /* MAGIA DE REESCALADO PARA TEXTO: */
  font-size: clamp(1.4rem, 7vw, 2.8rem); 
  white-space: nowrap; /* Obliga a que el texto NO se parta en dos renglones */
}

/* Empuja las ramas hacia el centro en pantallas grandes (computadoras) */
@media (min-width: 768px) {
  body::before {
    background-position: 
      calc(50% - 320px) 0%, 
      calc(50% + 320px) 0%, 
      calc(50% - 320px) 100%, 
      calc(50% + 320px) 100%;
  }
}

