/* =========================================================
   TOKENS — PALETA Y TIPOGRAFÍA
   ========================================================= */
:root {
    --bg-base: #14101c;
    --bg-panel: #1d1728;
    --bg-panel-alt: #241b31;
    --gold: #e3b35c;
    --gold-soft: #f0cd8a;
    --rose: #8a2846;
    --violet: #5b3a78;
    --ivory: #f1e9dc;
    --muted: #a99cc0;
    --line: rgba(241, 233, 220, 0.1);

    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Work Sans', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(91, 58, 120, 0.25), transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(138, 40, 70, 0.18), transparent 40%),
        var(--bg-base);
    color: var(--ivory);
    font-family: var(--font-body);
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============== BARRA SUPERIOR ============== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.4rem 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
.topbar__mark { color: var(--gold); font-size: 1rem; }

/* ============== BIENVENIDA / HERO ============== */
.hero {
    max-width: 720px;
    margin: 0 auto;
    padding: 4.5rem 1.5rem 3rem;
    text-align: center;
}
.hero__eyebrow {
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--gold);
    margin: 0 0 0.8rem;
}
.hero__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    margin: 0 0 1.2rem;
    color: var(--ivory);
}
.hero__text {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto 2rem;
}
.hero__cta {
    display: inline-block;
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, var(--rose), var(--violet));
    color: var(--ivory);
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    box-shadow: 0 8px 24px rgba(138, 40, 70, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(138, 40, 70, 0.5);
}

/* ============== IMAGEN CENTRAL (SIN RECORTAR) ============== */
.altar-imagen {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}
.altar-imagen__marco {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    min-height: 280px;
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: center;
}
.altar-imagen__marco img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}
.altar-imagen__placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    padding: 3rem 1rem;
    text-align: center;
}
.altar-imagen.sin-imagen img { display: none; }
.altar-imagen.sin-imagen .altar-imagen__placeholder { display: flex; }

/* ============== ALTAR DINÁMICO DEBAJO DE LA IMAGEN ============== */
.altar-interactivo {
    margin-top: 2.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.5rem 1rem;
}
.altar-interactivo__titulo {
    font-family: var(--font-display);
    color: var(--gold-soft);
    font-size: 1.4rem;
    margin: 0 0 1.2rem;
    letter-spacing: 0.05em;
}
.altar-cirios {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 1.6rem 1.2rem;
    padding: 0.5rem;
    max-height: 380px;
    overflow-y: auto;
}

/* ESTRUCTURA INDIVIDUAL DE CADA CIRIO CON NOMBRE */
.cirio {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 65px;
    position: relative;
}
.cirio__cuerpo {
    width: 16px;
    height: 46px;
    border-radius: 3px;
    background: linear-gradient(180deg, #d8cdb8, #a89c85);
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.3);
    position: relative;
}
.cirio__llama {
    width: 10px;
    height: 18px;
    border-radius: 50% 50% 35% 35% / 80% 80% 35% 35%;
    background: radial-gradient(circle at 50% 80%, #ffffff 10%, #fff3d0 30%, var(--gold) 65%, var(--rose) 100%);
    opacity: 1;
    transform-origin: 50% 100%;
    box-shadow: 0 0 12px 4px rgba(227, 179, 92, 0.6);
    animation:
        movimiento-fuego 1.8s ease-in-out infinite alternate,
        parpadeo-luz 0.15s ease-in-out infinite alternate;
}
.cirio__nombre {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    color: var(--ivory);
    text-align: center;
    line-height: 1.1;
    word-break: break-word;
    max-width: 65px;
    opacity: 0.9;
}

/* MARCADO DE VELA ACTIVA EN CARRUSEL */
.cirio--activo .cirio__llama {
    box-shadow: 0 0 20px 7px rgba(240, 205, 138, 0.9);
    transform: scale(1.18);
}
.cirio--activo .cirio__nombre {
    color: var(--gold-soft);
    font-weight: 600;
}

/* ============== VISTA PREVIA Y VELA APAGADA ============== */
.vista-previa-cirio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed var(--line);
    border-radius: 14px;
    padding: 1.2rem 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

/* Estado por defecto: Apagado */
.cirio--muestra .cirio__llama {
    opacity: 0;
    transform: scale(0);
    box-shadow: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Mecha apagada */
.cirio--muestra .cirio__cuerpo::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 6px;
    background: #3a322b;
    border-radius: 1px;
}

.cirio-status {
    margin: 0.8rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    font-style: italic;
    text-align: center;
    transition: color 0.3s ease;
}

/* ESTADO: ENCENDIDO RITUAL */
.cirio--muestra.enciende .cirio__llama {
    opacity: 1;
    animation: encender-mecha 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.27) forwards,
               movimiento-fuego 1.8s ease-in-out infinite alternate 1.2s,
               parpadeo-luz 0.15s ease-in-out infinite alternate 1.2s;
}

.vista-previa-cirio.activa {
    border-color: var(--gold);
    background: rgba(227, 179, 92, 0.05);
}

.vista-previa-cirio.activa .cirio-status {
    color: var(--gold-soft);
    font-weight: 500;
}

/* ANIMACIÓN DEL ENCENDIDO INICIAL DE LA MECHA */
@keyframes encender-mecha {
    0% {
        width: 3px;
        height: 3px;
        background: #ff4500;
        box-shadow: 0 0 2px #ff4500;
        opacity: 0.2;
        transform: scale(0.3);
    }
    50% {
        width: 14px;
        height: 24px;
        background: #ffe600;
        box-shadow: 0 0 25px 8px rgba(255, 200, 50, 0.9);
        opacity: 1;
        transform: scale(1.3);
    }
    100% {
        width: 10px;
        height: 18px;
        background: radial-gradient(circle at 50% 80%, #ffffff 10%, #fff3d0 30%, var(--gold) 65%, var(--rose) 100%);
        box-shadow: 0 0 12px 4px rgba(227, 179, 92, 0.6);
        transform: scale(1);
    }
}

/* ANIMACIONES DEL FUEGO REAL */
@keyframes movimiento-fuego {
    0% {
        transform: scale(1, 1) rotate(-2deg) skewX(-1deg);
        border-radius: 50% 50% 35% 35% / 80% 80% 35% 35%;
    }
    25% { transform: scale(0.95, 1.08) rotate(3deg) skewX(2deg); }
    50% {
        transform: scale(1.05, 0.92) rotate(-3deg) skewX(-2deg);
        border-radius: 40% 60% 30% 40% / 70% 90% 30% 40%;
    }
    75% { transform: scale(0.98, 1.04) rotate(2deg) skewX(1deg); }
    100% {
        transform: scale(1.02, 0.97) rotate(-1deg) skewX(-1deg);
        border-radius: 60% 40% 40% 30% / 90% 70% 40% 30%;
    }
}
@keyframes parpadeo-luz {
    0% { box-shadow: 0 0 10px 3px rgba(227, 179, 92, 0.5); opacity: 0.92; }
    100% { box-shadow: 0 0 16px 5px rgba(227, 179, 92, 0.85); opacity: 1; }
}

/* ============== RECUADROS (PETICIONES / AGRADECIMIENTOS) ============== */
.recuadros {
    max-width: 1080px;
    margin: 2rem auto 0;
    padding: 0 1.5rem 5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem;
}
@media (max-width: 820px) {
    .recuadros { grid-template-columns: 1fr; }
}

.panel {
    background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-alt));
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 2rem 1.8rem;
}
.panel__titulo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.7rem;
    margin: 0 0 0.35rem;
}
.panel--velas .panel__titulo { color: var(--gold-soft); }
.panel--gracias .panel__titulo { color: #e3a9bb; }
.panel__subtitulo {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0 0 1.4rem;
}

/* ---------- CARRUSEL SUAVE ---------- */
.carrusel {
    min-height: 105px;
    background: rgba(0,0,0,0.18);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out !important;
}
.carrusel--transicion {
    opacity: 0 !important;
    transform: translateY(-10px) !important;
}
.carrusel--pre-entrada {
    opacity: 0 !important;
    transform: translateY(10px) !important;
    transition: none !important;
}
.carrusel__nombre {
    margin: 0 0 0.3rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--gold-soft);
    font-weight: 600;
}
.panel--gracias .carrusel__nombre { color: #e3a9bb; }
.carrusel__texto { margin: 0; color: var(--ivory); font-size: 0.98rem; }
.carrusel__vacio { margin: 0; color: var(--muted); font-style: italic; }

/* ---------- FORMULARIOS ---------- */
.formulario {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.formulario label {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.5rem;
}
.formulario input,
.formulario textarea {
    background: rgba(0,0,0,0.22);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    color: var(--ivory);
    font-family: var(--font-body);
    font-size: 0.95rem;
    resize: vertical;
}
.campo-trampa {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.boton {
    margin-top: 1.1rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 999px;
    color: var(--ivory);
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.boton--velas { background: linear-gradient(135deg, var(--gold), var(--rose)); }
.boton--gracias { background: linear-gradient(135deg, var(--violet), var(--rose)); }
.boton:hover { transform: translateY(-2px); }

/* ============== PIE DE PÁGINA ============== */
.pie {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 2rem 1rem 3rem;
    border-top: 1px solid var(--line);
}