/* =========================================
   AETERNA - HOJA DE ESTILOS PRINCIPAL
   ========================================= */

/* =========================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================= */
:root { 
    --gold: #d4af37; 
    --sidebar-w: 350px; 
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    scrollbar-width: thin; 
    scrollbar-color: rgba(212, 175, 55, 0.5) #0a0a0a; 
}

body { 
    font-family: 'Lato', sans-serif; 
    background-color: #050505; 
    color: white; 
    overflow-x: hidden; 
    min-height: 100vh;
}

/* --- SCROLLBAR ELEGANTE --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.5); border-radius: 10px; transition: 0.3s; }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.9); }

/* =========================================
   2. FONDOS Y ESTRUCTURA PRINCIPAL
   ========================================= */
.bg-blur { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background-size: cover; background-position: center; 
    filter: blur(30px) brightness(0.2); z-index: -1; transform: scale(1.1); 
}

.main-content { 
    margin-left: 0; transition: 0.4s; padding: 60px 20px; 
    display: flex; flex-direction: column; align-items: center; width: 100%; 
}
.main-content.shifted { margin-left: var(--sidebar-w); width: calc(100% - var(--sidebar-w)); }

.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 20px; }

/* =========================================
   3. SIDEBAR Y WIDGETS (Menú lateral)
   ========================================= */
.sidebar { 
    position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar-w); 
    background: rgba(10, 10, 10, 0.85); border-right: 1px solid rgba(212, 175, 55, 0.3); 
    z-index: 2000; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; flex-direction: column; padding: 80px 20px 20px 20px; 
    overflow-y: auto; transform: translateX(-100%); backdrop-filter: blur(10px);
    box-shadow: 10px 0 30px rgba(0,0,0,0.8);
}
.sidebar.active { transform: translateX(0); }

.btn-toggle { 
    position: fixed; top: 20px; left: 20px; z-index: 2100; 
    background: rgba(0,0,0,0.6); border: 1px solid var(--gold); 
    padding: 10px 15px; border-radius: 4px; cursor: pointer; 
    font-size: 0.8rem; letter-spacing: 1px; color: var(--gold); 
    backdrop-filter: blur(5px); transition: 0.3s; 
}
.btn-toggle:hover { background: var(--gold); color: black; }

.widget-box { 
    background: rgba(255,255,255,0.03); border: 1px solid rgba(212,175,55,0.2); 
    border-radius: 12px; padding: 20px; margin-bottom: 25px; transition: 0.5s; 
}
.widget-box:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(212, 175, 55, 0.5); box-shadow: 0 0 20px rgba(212, 175, 55, 0.1); }

.widget-title { font-family: 'Playfair Display'; color:white; font-size: 0.85rem; letter-spacing: 2px; margin-bottom: 15px; border-bottom: 1px solid rgba(212,175,55,0.1); padding-bottom: 10px; }

/* =========================================
   4. TIPOGRAFÍAS Y TEXTOS
   ========================================= */
.name-manuscrito { 
    font-family: 'Dancing Script', cursive; font-size: 4.5rem; color: var(--gold); 
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); margin-top: 15px; margin-bottom: 5px; 
    white-space: nowrap; transition: text-shadow 0.5s ease, color 0.5s ease; cursor: default;
}
.name-manuscrito:hover { text-shadow: 0 0 20px rgba(212, 175, 55, 0.9), 0 0 40px rgba(212, 175, 55, 0.5); color: #fff; }

.dates { color: var(--gold); letter-spacing: 5px; font-size: 1.1rem; margin-bottom: 30px; }
.texto-oro { font-family: 'Dancing Script', cursive; color: var(--gold); font-size: 1.1rem; }

/* =========================================
   5. BOTONES E INPUTS
   ========================================= */
.btn-gold { background: var(--gold); color: black; border: none; padding: 15px; border-radius: 8px; font-weight: bold; cursor: pointer; width: 100%; transition: background 0.3s; }
.btn-gold:hover { background: #b8962d; }

.btn-aeterna {
    width: 100%; padding: 12px; background: rgba(0, 0, 0, 0.6); 
    border: 1px solid var(--gold); color: var(--gold); font-family: 'Playfair Display', serif; 
    font-weight: bold; letter-spacing: 1px; cursor: pointer; border-radius: 4px; 
    transition: 0.3s ease; text-transform: uppercase; position: relative; overflow: hidden;
}
.btn-aeterna::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(212,175,55,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg); transition: all 0.7s ease;
}
.btn-aeterna:hover::after { left: 200%; }
.btn-aeterna:hover { background: var(--gold); color: black; box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }

.btn-historial-link { background: none; border: none; color: var(--gold); font-family: 'Playfair Display'; font-style: italic; cursor: pointer; margin: 10px 0; width: 100%; opacity: 0.8; }
.btn-historial-link:hover { text-decoration: underline; opacity: 1; }

/* Botón Global Volver */
.btn-volver-global {
    position: absolute; top: 25px; left: 30px; background: rgba(0, 0, 0, 0.6); 
    border: 1px solid rgba(212, 175, 55, 0.5); color: var(--gold); padding: 8px 18px; 
    border-radius: 4px; font-family: 'Lato', sans-serif; font-size: 0.8rem; 
    font-weight: bold; text-transform: uppercase; letter-spacing: 1px; 
    text-decoration: none; transition: 0.3s; z-index: 1000; backdrop-filter: blur(5px);
}
.btn-volver-global:hover { background: var(--gold); color: #000; box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }

/* Tooltips */
.btn-tooltip { position: relative; }
.btn-tooltip::after {
    content: attr(data-mensaje); position: absolute; bottom: 115%; left: 50%; transform: translateX(-50%);
    background: rgba(15, 15, 15, 0.95); color: #ccc; border: 1px solid var(--gold); padding: 10px 15px;
    border-radius: 6px; font-size: 0.75rem; font-family: 'Lato', sans-serif; text-transform: none;
    line-height: 1.4; width: 220px; text-align: center; opacity: 0; visibility: hidden;
    transition: all 0.3s ease; pointer-events: none; z-index: 1000; box-shadow: 0 5px 15px rgba(0,0,0,0.8);
}
.btn-tooltip:hover::after { opacity: 1; visibility: visible; bottom: 125%; }

input, select, textarea { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ddd; border-radius: 6px; font-size: 16px; }
input[type="checkbox"], input[type="radio"] { width: auto !important; margin: 0 !important; display: inline-block !important; cursor: pointer; }

/* =========================================
   6. FOTOS Y GALERÍA (Polaroids)
   ========================================= */
.portrait-container { position: relative; width: 260px; height: 260px; margin-bottom: 20px; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.portrait-container:hover { transform: scale(1.08); }
.portrait { 
    width: 260px; height: 260px; border-radius: 50%; border: 3px solid var(--gold); 
    object-fit: cover; box-shadow: 0 0 25px rgba(212,175,55,0.2); 
    animation: pulso-dorado 4s infinite alternate ease-in-out;
}
.portrait-container:hover .portrait { box-shadow: 0 0 35px rgba(212,175,55,0.5); }

@keyframes pulso-dorado { 0% { box-shadow: 0 0 15px rgba(212, 175, 55, 0.1); } 50% { box-shadow: 0 0 35px rgba(212, 175, 55, 0.5); } 100% { box-shadow: 0 0 15px rgba(212, 175, 55, 0.1); } }

.gallery { display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; margin: 50px auto 0 auto; width: 100%; max-width: 1050px; }
.polaroid { background: white; padding: 10px 10px 25px 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); width: 220px; transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer; transform: rotate(-1deg); }
.polaroid img { width: 100%; height: 180px; object-fit: cover; }
.polaroid-caption { font-family: 'Playfair Display'; font-style: italic; color: #222; text-align: center; margin-top: 10px; font-size: 0.8rem; }
.polaroid:hover { transform: translateY(-12px) rotate(0deg) scale(1.08); box-shadow: 0 20px 40px rgba(212, 175, 55, 0.3); border-bottom: 3px solid var(--gold); z-index: 10; }

.portada-sugeridor {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80%;
    text-align: center; font-family: 'Dancing Script', cursive; color: rgba(255, 255, 255, 0.8); 
    font-size: 1.4rem; line-height: 1.2; text-shadow: 0 0 10px rgba(0,0,0,0.9); pointer-events: none; z-index: 10;
}

/* =========================================
   7. ICONOS Y OFRENDAS
   ========================================= */
.quick-access-icons { display: flex; gap: 25px; margin-bottom: 30px; }
.quick-icon { font-size: 1.8rem; cursor: pointer; color: rgba(255,255,255,0.5); transition: 0.3s; padding: 10px; border-radius: 50%; }
.quick-icon:hover { color: var(--gold); transform: translateY(-5px); background: rgba(212,175,55,0.1); }

.ofrenda-selector { display: flex; justify-content: space-around; margin: 30px 0; padding: 10px; }
.of-icon { font-size: 3.5rem; cursor: pointer; padding: 15px; border-radius: 15px; transition: all 0.4s; border: 2px solid transparent; filter: grayscale(0.5); }
.of-icon:hover { transform: scale(1.2); filter: grayscale(0); }
.of-icon.active { filter: grayscale(0); background: rgba(212, 175, 55, 0.15); border-color: var(--gold); box-shadow: 0 0 25px rgba(212, 175, 55, 0.5); transform: scale(1.1); }

.fila-ofrenda { display: flex; align-items: center; gap: 20px; padding: 15px; border-bottom: 1px solid rgba(212, 175, 55, 0.1); width: 100%; transition: 0.3s; }
.fila-ofrenda:hover { background: rgba(212, 175, 55, 0.05); }
.ofrenda-icon-historial { font-size: 2.2rem; filter: drop-shadow(0 0 8px var(--gold)); flex-shrink: 0; }
.donante-nombre { font-family: 'Playfair Display', serif; color: var(--gold); font-size: 1.2rem; letter-spacing: 1px; }

/* =========================================
   8. MODALES
   ========================================= */
.modal-aeterna { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.95); display:none; justify-content:center; align-items:center; z-index:10000; padding: 20px; }
.modal-body { background: #111; padding: 30px; border-radius: 15px; border: 1px solid var(--gold); width: 100%; max-width: 500px; }

#lightbox { display:none; position:fixed; z-index:9999; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.9); justify-content:center; align-items:center; flex-direction:column; }
#lightbox img { max-width:90%; max-height:80%; border: 3px solid white; box-shadow: 0 0 30px rgba(212, 175, 55, 0.3); }

/* =========================================
   9. BARRA SUPERIOR (Anteprima)
   ========================================= */
.top-nav {
    position: fixed; top: 0; left: 0; width: 100%; background: rgba(15, 15, 15, 0.95);
    padding: 15px 5%; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid var(--gold); z-index: 3000; box-shadow: 0 4px 15px rgba(0,0,0,0.8);
}
.brand { font-family: 'Playfair Display'; color: var(--gold); font-size: 1.2rem; letter-spacing: 2px; }
.vista-previa-badge { background: #ff4444; color: white; padding: 4px 10px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; letter-spacing: 1px; margin-left: 10px; text-transform: uppercase;}
.btn-group { display: flex; gap: 15px; }
.btn-nav { padding: 10px 25px; border-radius: 4px; border: 1px solid white; background: transparent; color: white; cursor: pointer; font-family: 'Playfair Display'; font-weight: bold; transition: 0.3s; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }
.btn-confirm { background: var(--gold); border-color: var(--gold); color: black; }
.btn-nav:hover { transform: translateY(-2px); }

/* =========================================
   10. AUTENTICACIÓN (Login, Registro, Recuperar)
   ========================================= */
.pantalla-centrada { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 40px 20px; box-sizing: border-box; }

.auth-card {
    background: rgba(15, 15, 15, 0.85); backdrop-filter: blur(15px); border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 40px; border-radius: 12px; width: 100%; max-width: 450px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.8); text-align: center; margin: auto; 
}
.registro-card {
    background: rgba(15, 15, 15, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid #333; padding: 40px; border-radius: 8px; width: 100%; max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8); text-align: center; margin: auto; height: auto;
}

.brand-title { font-family: 'Playfair Display', serif; color: var(--gold); font-size: 2.5rem; margin-bottom: 5px; margin-top: 0; }
.subtitle { color: #aaa; font-size: 0.9rem; margin-bottom: 30px; }
.auth-card p { margin-bottom: 30px !important; line-height: 1.6; }
#formReset, #formRecuperar { margin-top: 25px !important; }

.form-group, .input-group { text-align: left; margin-bottom: 20px; }
.form-group label, .input-group label { display: block; font-size: 0.8rem; color: var(--gold); margin-bottom: 8px; letter-spacing: 1px; text-transform: uppercase; }
.input-group input { width: 100%; padding: 12px; background: #000; border: 1px solid #444; color: white; border-radius: 4px; outline: none; transition: 0.3s; box-sizing: border-box; }
.input-group input:focus { border-color: var(--gold); }

.form-footer { margin-top: 20px; font-size: 0.9rem; color: #888; }
.form-footer a, .link-text { color: var(--gold); text-decoration: none; font-size: 0.85rem; transition: 0.3s; }
.form-footer a:hover, .link-text:hover { text-decoration: underline; color: #fff; }

.bg-login-blur { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: url('../assets/fondo-login.jpg') no-repeat center center; background-size: cover; filter: brightness(0.2) blur(10px); z-index: -1; }
#mensaje { margin-top: 15px; padding: 10px; border-radius: 4px; display: none; font-size: 0.9rem; }

/* =========================================
   11. LANDING PAGE (index.html)
   ========================================= */
body.fondo-index { background: linear-gradient(rgba(20, 20, 20, 0.4), rgba(20, 20, 20, 0.4)), url('../assets/fondo-cielo.png') no-repeat center center fixed; background-size: cover; color: #1a1a1a; line-height: 1.6; position: relative; z-index: 1; }
body.fondo-index::after { content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.65); z-index: -1; pointer-events: none; }
.promo-hero { margin-top: 20px; font-family: 'Playfair Display', serif; color: var(--gold); font-size: 0.9rem; letter-spacing: 2px; text-transform: uppercase; opacity: 0.9; animation: fadeIn 2s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 0.9; transform: translateY(0); } }

.hero { height: 80vh; background: transparent; display: flex; flex-direction: column; justify-content: center; align-items: center; color: white; text-align: center; padding: 0 20px; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(3rem, 10vw, 5rem); font-weight: 400; letter-spacing: 4px; margin-bottom: 10px; }
.nav-links { position: absolute; top: 30px; right: 40px; display: flex; gap: 20px; z-index: 100; }
.nav-links a { color: white; text-decoration: none; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; border: 1px solid rgba(255,255,255,0.4); padding: 10px 20px; transition: 0.3s; background: rgba(0,0,0,0.2); }
.nav-links a:hover { border-color: var(--gold); color: var(--gold); }

.container-index { max-width: 1200px; margin: -100px auto 50px; padding: 0 20px; position: relative; z-index: 10; }
#contenedor-perfiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px; }

.card-memorial-glass { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(12px); border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.15); transition: 0.5s cubic-bezier(0.165, 0.84, 0.44, 1); cursor: pointer; border: 1px solid rgba(255, 255, 255, 0.3); }
.card-memorial-glass:hover { background: rgba(255, 255, 255, 1); transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.card-memorial-glass .img-wrapper { position: relative; height: 350px; overflow: hidden; background: #eee; }
.card-memorial-glass img { width: 100%; height: 100%; object-fit: cover; transition: 0.8s; }
.card-memorial-glass:hover img { transform: scale(1.05); }

.card-memorial-glass .card-info { text-align: center !important; padding: 25px; display: flex; flex-direction: column; }
.card-memorial-glass .card-info h3 { order: 1; font-family: 'Playfair Display', serif; font-size: 1.4rem; color: #1a1a1a; margin-bottom: 8px; margin-top: 0; }
.card-memorial-glass .card-dates { order: 2; color: var(--gold); font-size: 0.75rem; letter-spacing: 2px; font-weight: 700; margin-bottom: 10px; }
.card-memorial-glass .card-ref { order: 3; font-size: 0.65rem; color: #888; }

.search-bar { max-width: 600px; margin: 40px auto; display: flex; background: rgba(255,255,255,0.9); padding: 5px; border-radius: 2px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); backdrop-filter: blur(5px); }
.search-bar input { flex-grow: 1; border: none; padding: 15px; outline: none; font-size: 1rem; background: transparent; }
.search-bar button { background: #1a1a1a; color: var(--gold); border: none; padding: 0 30px; cursor: pointer; font-weight: bold; }

/* =========================================
   12. PANEL DE USUARIO (panel.html)
   ========================================= */
.navbar { background: rgba(15, 15, 15, 0.95); padding: 15px 5%; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(212, 175, 55, 0.3); position: sticky; top: 0; z-index: 100; }
.navbar .brand { font-family: 'Playfair Display'; color: var(--gold); font-size: 1.5rem; letter-spacing: 2px; }
.logout-btn { background: transparent; border: 1px solid #555; color: #ccc; padding: 8px 15px; border-radius: 4px; cursor: pointer; transition: 0.3s; font-size: 0.8rem; text-transform: uppercase;}
.logout-btn:hover { border-color: var(--gold); color: white; }

.container-panel { max-width: 1000px; margin: 50px auto; padding: 0 20px; }
.header-panel { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; flex-wrap: wrap; gap: 20px; border-bottom: 1px solid #222; padding-bottom: 20px;}
.header-panel h1 { font-family: 'Playfair Display'; font-size: 2.5rem; margin-bottom: 5px; font-weight: normal; color: var(--gold);}
.grid-perfiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }

.perfil-card { background: #111; border: 1px solid #333; border-radius: 8px; overflow: hidden; transition: 0.3s; position: relative; }
.perfil-card:hover { border-color: var(--gold); box-shadow: 0 10px 20px rgba(0,0,0,0.5);}
.perfil-card .card-info { text-align: center; display: flex; flex-direction: column; align-items: center; padding: 20px; }
.card-img { width: 100%; height: 200px; object-fit: cover; border-bottom: 1px solid #333; background: #0a0a0a; display: flex; justify-content: center; align-items: center; color: #555; font-size: 3rem;}
.badge-status { position: absolute; top: 15px; right: 15px; padding: 5px 10px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; letter-spacing: 1px; backdrop-filter: blur(5px); }
.badge-publico { background: rgba(40, 167, 69, 0.2); color: #4ade80; border: 1px solid #4ade80; }
.badge-oculto { background: rgba(220, 53, 69, 0.2); color: #ff6b6b; border: 1px solid #ff6b6b; }
.card-name { font-family: 'Playfair Display'; font-size: 1.5rem; color: white; margin-bottom: 5px; text-transform: capitalize;}
.card-dates { color: var(--gold); font-size: 0.9rem; margin-bottom: 20px; font-family: 'Playfair Display', serif; font-style: italic;}
.card-actions { display: flex; gap: 10px; flex-wrap: wrap;}
.btn-outline { flex: 1; text-align: center; padding: 10px; border: 1px solid #444; color: #ccc; text-decoration: none; border-radius: 4px; font-size: 0.8rem; transition: 0.3s; font-weight: bold; min-width: 120px; }
.btn-outline:hover { background: #222; border-color: var(--gold); color: var(--gold); }
.estado-texto { font-size: 0.8rem; color: #888; margin-bottom: 15px; display: block; line-height: 1.4;}

/* =========================================
   13. EDITOR DE PERFIL (perfil-editar.html, crear-perfil.html)
   ========================================= */
body.fondo-crear { background: linear-gradient(rgba(20, 20, 20, 0.4), rgba(20, 20, 20, 0.4)), url('../assets/fondo-humano.png') no-repeat center center fixed; background-size: cover; }
.glass-card { background: rgba(15, 15, 15, 0.85); backdrop-filter: blur(15px); border-radius: 12px; padding: 40px; width: 100%; max-width: 500px; box-shadow: 0 15px 35px rgba(0,0,0,0.8); border: 1px solid rgba(212, 175, 55, 0.3); text-align: center; margin: 40px auto; }
.upload-area { border: 1px dashed #555; padding: 25px; text-align: center; border-radius: 6px; background: rgba(0, 0, 0, 0.3); cursor: pointer; transition: 0.3s; }
.upload-area:hover { border-color: var(--gold); background: rgba(212, 175, 55, 0.05); }

.layout-wrapper { display: flex; height: 100vh; width: 100vw; overflow: hidden; }
.layout-wrapper .main-content { flex-grow: 1; overflow-y: auto; padding: 80px 50px; background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('../assets/fondo-humano.png') no-repeat center center; background-size: cover; display: block; }
.admin-sidebar { width: var(--sidebar-w); background: rgba(15, 15, 15, 0.98); border-right: 1px solid var(--gold); padding: 25px; overflow-y: auto; transition: 0.3s; flex-shrink: 0; position: relative; }
.admin-sidebar.collapsed { width: 0; padding: 0; overflow: hidden; border-right: none; }
.sidebar-section { margin-bottom: 25px; border-bottom: 1px solid #333; padding-bottom: 20px; }
.sidebar-section h3 { font-family: 'Playfair Display', serif; color: var(--gold); font-size: 1.3rem; margin-bottom: 15px; margin-top: 5px; font-weight: normal; letter-spacing: 1px; }

.ed-galeria-grid { display: flex; flex-wrap: wrap; gap: 25px; justify-content: center; align-items: flex-start; }
.photo-edit-card { background: white; padding: 10px 10px 20px 10px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); width: 220px; position: relative; transition: transform 0.3s; }
.photo-edit-card:hover { transform: translateY(-5px); }
.photo-edit-card img { width: 100%; height: 180px; object-fit: cover; cursor: pointer; }
.btn-del-foto { position: absolute; top: -10px; right: -10px; background: #ff4444; color: white; border: none; border-radius: 50%; width: 25px; height: 25px; cursor: pointer; font-weight: bold; z-index: 10; transition: 0.3s; }
.btn-del-foto:hover { transform: scale(1.2); }
.photo-caption-input { width: 100%; border: none; border-bottom: 1px solid #ddd; font-family: 'Playfair Display'; font-style: italic; font-size: 0.85rem; color: #333; padding: 8px 0; outline: none; text-align: center; }

.input-dark { width: 100%; padding: 10px; background: #222; border: 1px solid #444; color: white; margin-bottom: 10px; outline: none; }
.input-dark:focus { border-color: var(--gold); }
#btn-portada { width: auto !important; display: inline-block; }
#ed-fecha-nac, #ed-fecha-def { width: 160px !important; font-family: 'Lato', sans-serif; border-radius: 5px; }

/* =========================================
   14. MODO LECTURA PANTALLA COMPLETA
   ========================================= */
body.modo-lectura { background: linear-gradient(rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0.85)), url('../assets/fondo-humano.png') no-repeat center center fixed !important; background-size: cover !important; color: var(--gold); min-height: 100vh; }
.contenedor-principal { display: flex; flex-direction: column; align-items: center; width: 100%; min-height: 100vh; box-sizing: border-box; position: relative; }
.controles-superiores { position: fixed; top: 30px; left: 40px; display: flex; z-index: 2000; }
.btn-gestion { background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(212, 175, 55, 0.5); color: var(--gold); padding: 10px 22px; cursor: pointer; font-family: 'Playfair Display'; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 2px; transition: 0.3s; backdrop-filter: blur(10px); border-radius: 2px; text-decoration: none; display: inline-block; }
.btn-gestion:hover { background: var(--gold); color: #000; box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }

#titulo-dinamico { color: var(--gold); font-family: 'Dancing Script', cursive; font-size: 3.5rem; margin-top: 60px; margin-bottom: 20px; text-align: center; transition: all 0.5s ease; text-shadow: 2px 2px 10px rgba(0,0,0,0.8); }
.marco-u { width: 85%; max-width: 1000px; flex-grow: 1; border: 2px solid var(--gold); border-bottom: none; background: rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; padding: 40px 70px; box-sizing: border-box; position: relative; border-radius: 8px 8px 0 0; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
#editor-unico, #lector-unico { width: 100%; background: transparent; border: none; outline: none; color: var(--gold); font-family: 'Dancing Script', cursive; font-size: 2rem; line-height: 1.8; resize: none; overflow: hidden; min-height: 60vh; text-shadow: 1px 1px 4px rgba(0,0,0,0.9); white-space: pre-wrap; text-align: left;}

/* =========================================
   15. PANEL ADMINISTRADOR
   ========================================= */
.container-admin { max-width: 1400px; margin: auto; padding: 0 20px; }
.container-admin h1 { font-family: 'Playfair Display', serif; color: var(--gold); margin-bottom: 20px; margin-top: 30px; font-weight: normal; }
.admin-controls { background: #111; padding: 20px; border-radius: 8px; margin-bottom: 20px; display: flex; gap: 15px; border: 1px solid #333; align-items: center; }
.admin-controls .input-dark { margin-bottom: 0 !important; }
.admin-controls .btn-gold { margin-bottom: 0 !important; width: auto !important; }

.tabla-wrapper { overflow-x: auto; background: #111; border-radius: 8px; border: 1px solid #333; }
.tabla-admin { width: 100%; border-collapse: collapse; min-width: 1000px; }
.tabla-admin th { background: #050505; color: var(--gold); padding: 15px; text-align: left; font-family: 'Playfair Display'; border-bottom: 1px solid #333; }
.tabla-admin td { padding: 15px; border-bottom: 1px solid #222; vertical-align: middle; }
.tabla-admin tr:hover { background: #1a1a1a; }
.tabla-admin select.input-dark, .tabla-admin input[type="number"].input-dark { width: auto !important; padding: 8px; margin-bottom: 5px !important; display: inline-block; font-size: 0.85rem; }

.img-previa { width: 60px; height: 60px; object-fit: cover; border-radius: 5px; border: 1px solid #444; }
.link-oro { color: var(--gold); font-weight: bold; text-decoration: none; }
.btn-accion { width: 100%; padding: 8px; margin-bottom: 5px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 0.8rem; transition: 0.3s; }
.btn-editar-admin { background: #222; color: var(--gold); border: 1px solid var(--gold); }
.btn-moderar { background: #2a3b4c; color: #60a5fa; border: 1px solid #3b82f6; }
.btn-borrar { background: transparent; color: #ff4444; border: 1px solid #ff4444; }

/* =========================================
   16. RESPONSIVO (Móviles)
   ========================================= */
@media (max-width: 1024px) {
    .sidebar { width: 100%; max-width: 350px;}
    .main-content.shifted { margin-left: 0; }
    .name-manuscrito { font-size: 2.2rem !important; }
    .btn-group { gap: 5px; }
    .btn-nav { padding: 8px 12px; font-size: 0.7rem; }
    .brand { display: none; }
    .marco-u { width: 95%; padding: 30px 20px; }
    #titulo-dinamico { font-size: 2.5rem; margin-top: 80px; }
    #lector-unico, #editor-unico { font-size: 1.5rem; }
    .controles-superiores { top: 15px; left: 15px; }
    
    /* ✨ SOLUCIÓN 1: Botones de la Home en el flujo central ✨ */
    .nav-links {
        position: relative !important; /* ¡Les quitamos el poder de flotar! */
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: wrap; /* Si la pantalla es muy estrecha, bajan de línea */
        gap: 10px;
        margin-top: 25px; /* Los separamos del texto promocional de arriba */
        margin-bottom: 15px;
    }
    .nav-links a {
        padding: 12px 15px; /* Un poco más "gorditos" para que sean fáciles de pulsar */
        font-size: 0.75rem;
        text-align: center;
        min-width: 130px; /* Evitamos que se queden demasiado enanos */
    }

    /* ✨ SOLUCIÓN 2: Evitar que el Premium se estire como un chicle ✨ */
    .badge-premium-promo {
        top: unset !important; /* ¡Matamos la orden de pegarse arriba! */
        bottom: 20px !important; /* Lo pegamos abajo */
        right: 50% !important; 
        transform: translateX(50%); /* Lo centramos abajo del todo */
        height: max-content !important; /* Le prohibimos que se estire a lo alto */
        width: max-content !important;
        font-size: 0.65rem;
        box-shadow: 0 5px 15px rgba(0,0,0,0.8);
    }
    /* ✨ Empujar Aeterna hacia arriba y matar el hueco inferior ✨ */
    .hero {
        justify-content: flex-start !important; 
        padding-top: 1vh !important; 
        height: auto !important; 
        padding-bottom: 0 !important; /* Quitamos todo el aire por abajo */
    }

    /* Subimos el contenedor principal */
    .container-index {
        margin-top: 0 !important; 
        padding-top: 0 !important;
    }

    /* ✨ Aplastamos el margen superior de la barra de búsqueda ✨ */
    .search-bar {
        margin-top: 15px !important; /* Le quitamos los 40px originales y lo dejamos en 15px */
        margin-bottom: 30px !important; /* Mantenemos espacio por debajo para que no se pegue a las tarjetas */
    }
}
/* =========================================
   17. BLOQUES RESCATADOS (Restauración)
   ========================================= */

/* 1. Arreglo del botón gigante en el Panel de Control */
.header-panel .btn-gold { 
    width: auto !important; 
    display: inline-block; 
    padding: 12px 25px; 
}

/* 2. Restaurar el texto de Plan Premium en el Perfil */
.badge-premium-promo {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.7rem;
    letter-spacing: 1px;
    z-index: 1000;
    backdrop-filter: blur(5px);
    font-family: 'Playfair Display', serif;
}

/* 3. Restaurar los estilos de la pasarela de pagos (registro-pago.html) */
.pricing-toggle { display: flex; justify-content: center; gap: 10px; margin: 20px 0; background: #eee; padding: 5px; border-radius: 50px; }
.toggle-btn { flex: 1; padding: 10px; border-radius: 50px; border: none; cursor: pointer; background: transparent; font-weight: bold; transition: 0.3s; color: #333; }
.toggle-btn.active { background: var(--gold); color: white; }
.price-display { font-size: 3rem; font-weight: bold; color: #1a1a1a; margin: 10px 0; }
.info-perpetuidad { font-size: 0.85rem; color: #666; background: #fff9e6; padding: 15px; border-radius: 8px; border-left: 4px solid var(--gold); margin-bottom: 20px; text-align: left; }

/* 4. Restaurar el aviso de "Memorial en Vida" en el editor */
#aviso-en-vida { 
    display: none; 
    background: rgba(212, 175, 55, 0.05); 
    border-left: 2px solid var(--gold); 
    padding: 15px; 
    margin-bottom: 20px; 
    border-radius: 0 6px 6px 0; 
    text-align: left; 
}
/* 5. Restaurar la caja del Login de Administrador (admin-login.html) */
.login-box { 
    background: #111; 
    padding: 40px; 
    border-radius: 8px; 
    border: 1px solid var(--gold); 
    box-shadow: 0 0 30px rgba(212,175,55,0.15); 
    width: 100%; 
    max-width: 400px; 
    text-align: center; 
    margin: auto; 
}
/* 6. Devolver el borde dorado al Registro */
.registro-card {
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
}
/* =========================================
   32. VISIBILIDAD DE CONTRASEÑA (El Ojito)
   ========================================= */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.password-wrapper input {
    width: 100%;
    padding-right: 45px !important; /* Dejamos espacio a la derecha para no pisar el ojo */
}
.btn-ojo {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
    padding: 0;
    outline: none;
}
.btn-ojo:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* =========================================
   33. MODAL DE MODERACIÓN (Panel Admin)
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); display: none; justify-content: center;
    align-items: center; z-index: 10000; padding: 20px;
}
.modal-content-admin {
    background: #111; padding: 30px; border-radius: 12px;
    border: 1px solid var(--gold); width: 100%; max-width: 600px;
    max-height: 90vh; overflow-y: auto; text-align: left;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}
.mod-section {
    background: rgba(255, 255, 255, 0.05); padding: 15px;
    border-radius: 8px; border: 1px solid #333; margin-bottom: 25px;
    max-height: 250px; overflow-y: auto; font-size: 0.9rem; color: #ccc;
}
/* Estilo para cada mensaje/ofrenda individual que inyecta el JS */
.mod-section div {
    border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 10px;
    display: flex; justify-content: space-between; align-items: center; gap: 15px;
}
.mod-section div:last-child { 
    border-bottom: none; margin-bottom: 0; padding-bottom: 0; 
}