:root {
    --color-fondo: #F9F6F0;
    --color-texto: #4A4A4A;
    --color-acento: #C5A880; 
    --color-boton: #D4B895;
    
    /* Colores para el sobre (carta) */
    --sobre-oscuro: #b5986c;
    --sobre-medio: #c5a880;
    --sobre-claro: #d6bc98;
}
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--color-fondo);
    color: var(--color-texto);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}
/* Ocultar scroll mientras carga */
body.cargando {
    overflow: hidden;
}

h1, h2 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--color-acento);
    font-weight: 600;
}
.contenedor-principal {
    max-width: 500px;
    margin: 0 auto;
    background-color: #FFFFFF;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    overflow-x: hidden;
}
.seccion {
    padding: 60px 30px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

/* --- ESTILOS DE LA PORTADA ACTUALIZADOS --- */
.portada {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    /* Usamos la imagen del atardecer de los novios de fondo */
    background-image: url('uploads/novios3.jpeg'); 
    background-size: cover;
    background-position: center;
    padding: 0;
    border-bottom: none;
    overflow: hidden;
}

/* --- ESTILOS DE LA NUEVA FOTO CENTRAL --- */
.contenedor-foto-central {
    margin-top: 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.foto-central {
    /* Tamaños relativos para que se adapte a cualquier tamaño de pantalla móvil */
    width: 75%;
    max-width: 280px; 
    height: 350px;
    object-fit: cover;
    /* Efecto de marco en forma de "arco" (muy elegante y tendencia) */
    border-radius: 150px 150px 15px 15px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    border: 6px solid #FFFFFF; /* Borde blanco estilo marco */
}

.frase-portada {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.15rem;
    color: var(--color-texto);
    margin: 10px auto 0;
    line-height: 1.4;
    max-width: 85%;
}

/* Capa semi-transparente para que el texto se lea perfectamente sobre la foto */
.portada::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(249, 246, 240, 0.85); /* Tono claro de la web, ajusta la opacidad (0.85) si quieres ver más o menos la foto */
    z-index: 1;
}

.portada-contenido {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    width: 100%;
    /* Oculto al inicio para la animación de la carta */
    opacity: 0; 
    transform: translateY(30px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

/* Esta clase se añade por JS tras abrir el sobre */
.portada-contenido.animar-entrada {
    opacity: 1;
    transform: translateY(0);
}

.subtitulo {
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-texto);
}
.nombres {
    font-size: 4.5rem;
    margin: 10px 0;
    font-style: italic;
    color: var(--color-acento);
}
.fecha-destacada {
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: var(--color-texto);
}

/* --- ESTILOS DEL PRELOADER (CARTA) --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-fondo);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s;
}
#preloader.oculto {
    opacity: 0;
    visibility: hidden;
}

/* --- ESTILOS DEL PRELOADER (SOBRE REALISTA) --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-fondo); /* Fondo suave */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s;
    perspective: 1000px; /* Necesario para el efecto 3D al abrir la solapa */
}

#preloader.oculto {
    opacity: 0;
    visibility: hidden;
}

.sobre-animado {
    position: relative;
    width: 350px;
    height: 230px;
    transition: transform 1s ease-in-out, opacity 1s ease;
    /* Sombras para darle volumen y realismo */
    box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.05);
}

.sobre-animado.desvanecer {
    transform: translateY(100px) scale(0.8);
    opacity: 0;
}

/* Base interior del sobre (lo que se ve cuando se abre) */
.sobre-espalda {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e6d8c3;
    border-radius: 4px;
}

/* Solapa inferior */
.sobre-abajo {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 175px solid transparent; /* Mitad del ancho */
    border-right: 175px solid transparent;
    border-bottom: 115px solid #f2e8d5; /* Color crema claro */
    z-index: 3;
}

/* Solapas laterales */
.sobre-izquierda {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 115px solid transparent; /* Mitad del alto */
    border-bottom: 115px solid transparent;
    border-left: 175px solid #ebdnc2; /* Ligeramente más oscuro para dar profundidad */
    z-index: 2;
}

.sobre-derecha {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 115px solid transparent;
    border-bottom: 115px solid transparent;
    border-right: 175px solid #ebdnc2;
    z-index: 2;
}

/* Solapa superior (la que se mueve) */
.sobre-solapa-superior {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 175px solid transparent;
    border-right: 175px solid transparent;
    border-top: 130px solid #f9f6f0; /* Color principal */
    z-index: 5;
    transform-origin: top;
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1), z-index 0s 0.6s;
    /* Añadimos un pequeño filtro de sombra para que destaque sobre las otras solapas */
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}

.sobre-solapa-superior.abierta {
    transform: rotateX(180deg);
    z-index: 1; /* Al abrirse, debe pasar detrás de las otras solapas */
    filter: none;
}

/* --- ESTILOS DEL SELLO DE CERA --- */
.sello-cera {
    position: absolute;
    /* Posicionamiento para centrarlo en la punta del triángulo de la solapa */
    top: -145px; 
    left: -25px; 
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #c99352, #a67232); /* Tono dorado/cobre viejo */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 
        0 4px 6px rgba(0,0,0,0.3),
        inset 0 -2px 4px rgba(0,0,0,0.2),
        inset 0 2px 4px rgba(255,255,255,0.4);
    /* Simular los bordes irregulares de la cera derritida */
    border: 2px solid #8c5b25;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sello-cera:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* Las iniciales grabadas en el sello */
.iniciales {
    font-family: 'Cormorant Garamond', serif;
    color: #ffd799;
    font-size: 1.1rem;
    font-style: italic;
    font-weight: 600;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5); /* Efecto de bajorrelieve */
    transform: rotate(0deg); /* Asegurar que estén rectas */
}

/* Texto de ayuda ("Toca para abrir") */
.instruccion-abrir {
    position: absolute;
    bottom: -40px;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-acento);
    letter-spacing: 1px;
    animation: palpitar 2s infinite;
    transition: opacity 0.5s ease;
}

@keyframes palpitar {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}


/* --- RESTO DE ESTILOS --- */
.cita-romantica {
    font-style: italic;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: var(--color-acento);
    margin-top: 20px;
}
.grid-contador {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}
.grid-contador div {
    background-color: var(--color-fondo);
    padding: 10px;
    border-radius: 5px;
    min-width: 60px;
}
.grid-contador span {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-acento);
}
.btn {
    display: inline-block;
    background-color: var(--color-boton);
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    font-weight: 600;
    margin-top: 20px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    transition: background 0.3s ease;
}
.btn:hover {
    background-color: var(--color-acento);
}
.formulario {
    text-align: left;
    margin-top: 30px;
}
.formulario label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}
.formulario input, .formulario select, .formulario textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}
.nota-importante {
    font-size: 0.85rem;
    color: #d9534f;
    font-weight: 600;
}
.cuenta-bancaria {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
    background: var(--color-fondo);
    padding: 10px;
    border-radius: 5px;
}
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.grid-galeria {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}
.foto-novios {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    object-fit: cover;
}
#codigo-qr {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    display: inline-block;
}
input[type="file"] {
    background-color: var(--color-fondo);
    padding: 10px;
    cursor: pointer;
}
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.foto-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background: #fff;
}
.foto-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}
.btn-descarga {
    display: block;
    background-color: var(--color-boton);
    color: white;
    text-align: center;
    padding: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.3s ease;
}
.btn-descarga:hover {
    background-color: var(--color-acento);
}
.enlace-volver {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--color-acento);
    text-decoration: none;
    font-weight: 600;
}

/* --- BOTÓN DE MÚSICA FLOTANTE --- */
.btn-musica {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-boton);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.btn-musica.oculto {
    display: none; /* Se oculta hasta que se abre el sobre */
}

.btn-musica:hover {
    background-color: var(--color-acento);
    transform: scale(1.1);
}
