:root {
    /* Paleta Principal */
    --primary-blue: #1e3a8a;
    --accent-blue: #2563eb;
    --light-blue: #eff6ff;
    --primary-red: #dc2626;
    --hover-red: #b91c1c;
    --primary-yellow: #f59e0b;
    --accent-yellow: #d97706;
    --primary-dark: #0f172a;
    --dark-surface: #1e293b;

    /* Fondos Sutiles */
    --bg-yellow: #fef3c7;
    --bg-red: #fee2e2;
    --bg-blue: #dbeafe;
    --bg-green: #dcfce7;
    --bg-purple: #f3e8ff;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;

    /* Textos y Bordes */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-subtle: #e2e8f0;
    --border-focus: #3b82f6;

    /* Sombras */
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 16px 32px -6px rgba(15, 23, 42, 0.08), 0 8px 16px -6px rgba(15, 23, 42, 0.04);
    --card-shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
}

/* =========================================================
   0. Base estable y rendimiento de renderizado
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
video {
    max-width: 100%;
}

img {
    height: auto;
}

/* =========================================================
   1. Reglas Generales & Tipografía
   ========================================================= */
html {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-main);
    background-color: #ffffff;
    padding-top: 76px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.font-serif-scripture {
    font-family: 'Cinzel', Georgia, serif;
    letter-spacing: 0.3px;
}

/* =========================================================
   2. Navegación Fija & Header
   ========================================================= */
.navbar-custom {
    background-color: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 3px solid;
    border-image: linear-gradient(to right, var(--accent-blue), var(--primary-red), var(--primary-yellow)) 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.3px;
    font-size: 1.05rem;
    color: var(--primary-blue) !important;
    text-decoration: none;
}

.navbar-brand-title {
    line-height: 1.25;
}

.navbar-logo {
    height: 46px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.25s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: #334155 !important;
    padding: 0.5rem 0.9rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover, 
.nav-link:focus,
.nav-link.active {
    color: var(--primary-red) !important;
    background-color: rgba(220, 38, 38, 0.05);
}

/* =========================================================
   3. Botones del Sistema
   ========================================================= */
.btn-red-brand {
    background-color: var(--primary-red);
    color: #ffffff !important;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.4rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-red-brand:hover {
    background-color: var(--hover-red);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}

.btn-red-brand:active {
    transform: translateY(0);
}

.btn-yellow-brand {
    background-color: var(--primary-yellow);
    color: #ffffff !important;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.4rem;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-yellow-brand:hover {
    background-color: var(--accent-yellow);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.btn-blue-outline {
    background-color: transparent;
    color: var(--accent-blue) !important;
    font-weight: 600;
    border: 2px solid var(--accent-blue);
    border-radius: 50px;
    padding: 0.5rem 1.3rem;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
}

.btn-blue-outline:hover {
    background-color: var(--accent-blue);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.btn-white-glass {
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff !important;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 0.6rem 1.4rem;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-white-glass:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* =========================================================
   4. Secciones & Hero Principal
   ========================================================= */
.section-padding {
    padding: 90px 0;
}

.bg-light-minimal {
    background-color: var(--bg-light);
}

.section-title {
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 400;
    max-width: 620px;
    margin: 0 auto;
}

/* Hero Section */
#home {
    background-color: var(--primary-dark);
    color: #ffffff;
    padding: 130px 0 110px;
    position: relative;
    overflow: hidden;
    min-height: 85vh;
    display: flex;
    align-items: center;
}

body {
    overflow-x: hidden;
}

.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
    opacity: 0.45;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.75) 0%, rgba(15, 23, 42, 0.94) 100%);
    z-index: 1;
}

#home .container {
    z-index: 2;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.4rem 1.1rem;
    border-radius: 50px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -1px;
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.hero-lead {
    font-size: 1.15rem;
    color: #cbd5e1;
    max-width: 680px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* Tarjeta Editorial de Cita Bíblica (Hero) */
.scripture-card {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 20px;
    padding: 2.25rem 2rem;
    max-width: 820px;
    margin: 2.5rem auto 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
}

.scripture-card::before {
    content: "“";
    position: absolute;
    top: -15px;
    left: 24px;
    font-size: 4rem;
    line-height: 1;
    color: var(--primary-yellow);
    font-family: serif;
    opacity: 0.7;
}

.scripture-text {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #f1f5f9;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.scripture-reference {
    color: var(--primary-yellow);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 0;
}

/* =========================================================
   5. Tarjetas & Componentes UI
   ========================================================= */
.minimal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 2.25rem 1.75rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.minimal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
    border-color: #cbd5e1;
}

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
    transition: transform 0.3s ease;
}

.minimal-card:hover .card-icon {
    transform: scale(1.08);
}

.card-icon-blue {
    background-color: var(--bg-blue);
    color: var(--accent-blue);
}

.card-icon-red {
    background-color: var(--bg-red);
    color: var(--primary-red);
}

.card-icon-yellow {
    background-color: var(--bg-yellow);
    color: var(--accent-yellow);
}

.card-icon-green {
    background-color: var(--bg-green);
    color: #16a34a;
}

.card-icon-purple {
    background-color: var(--bg-purple);
    color: #9333ea;
}

/* Badges */
.badge-minimal {
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-blue {
    background-color: var(--bg-blue);
    color: var(--accent-blue);
}

.badge-red {
    background-color: var(--bg-red);
    color: var(--primary-red);
}

.badge-yellow {
    background-color: var(--bg-yellow);
    color: var(--accent-yellow);
}

/* Insignias de Ministerios */
.badge-ministry {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-min-pastorado {
    background-color: #ede9fe;
    color: #6d28d9;
    border-color: #ddd6fe;
}

.badge-min-alabanza {
    background-color: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.badge-min-escuela {
    background-color: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.badge-min-evangelismo {
    background-color: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

.badge-min-ujieres {
    background-color: #ccfbf1;
    color: #0f766e;
    border-color: #99f6e4;
}

.badge-min-jovenes {
    background-color: #ffe4e6;
    color: #be123c;
    border-color: #fecdd3;
}

.badge-min-oracion {
    background-color: #f3e8ff;
    color: #7e22ce;
    border-color: #e9d5ff;
}

.badge-min-servidores {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.badge-min-medios {
    background-color: #e0e7ff;
    color: #3730a3;
    border-color: #c7d2fe;
}

/* =========================================================
   6. Cultos Semanales (Videos)
   ========================================================= */
.culto-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 18px;
}

.culto-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
}

.video-thumbnail-container {
    height: 210px;
    background-color: var(--primary-dark);
    overflow: hidden;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.video-thumbnail-preview {
    height: 100%;
    width: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.culto-card:hover .video-thumbnail-preview {
    opacity: 1;
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    transition: background 0.3s ease;
}

.culto-card:hover .play-overlay {
    background: rgba(15, 23, 42, 0.15);
}

.play-button-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: var(--primary-red);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 18px rgba(220, 38, 38, 0.45);
}

.culto-card:hover .play-button-icon {
    transform: scale(1.14);
    background-color: var(--primary-yellow);
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.5);
}

/* =========================================================
   7. Formulario y Controles de Entrada
   ========================================================= */
.minimal-form {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 2.25rem 2rem;
    box-shadow: var(--card-shadow);
}

.form-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid var(--border-subtle);
    padding: 0.7rem 0.95rem;
    font-size: 0.92rem;
    color: var(--text-main);
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-group-text {
    border-color: var(--border-subtle);
    border-radius: 10px;
}

/* =========================================================
   8. Horarios & Tarjeta de Contacto
   ========================================================= */
.schedule-item {
    padding: 0.85rem 1rem;
    background-color: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid var(--accent-blue);
    transition: background-color 0.2s ease;
}

.schedule-item:hover {
    background-color: #f1f5f9;
}

.schedule-item.special {
    border-left-color: var(--primary-yellow);
}

.schedule-item.highlight {
    border-left-color: var(--primary-red);
}

/* =========================================================
   9. Footer
   ========================================================= */
footer {
    background-color: var(--primary-dark);
    color: #94a3b8;
    border-top: 4px solid var(--primary-yellow);
    font-size: 0.92rem;
}

footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary-yellow);
}

.footer-social-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.2s ease;
}

.footer-social-icon:hover {
    background-color: var(--primary-red);
    color: #ffffff;
    transform: translateY(-2px);
}

/* =========================================================
   10. Portal de Miembros & Dashboard
   ========================================================= */
.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.table-hover tbody tr {
    transition: background-color 0.15s ease;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Mobile cards for members directory */
.member-mobile-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease;
}

.member-mobile-card:hover {
    border-color: #cbd5e1;
}

/* =========================================================
   11. Botón Volver Arriba & Toasts
   ========================================================= */
#scrollTopBtn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary-blue);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scrollTopBtn:hover {
    background-color: var(--accent-blue);
    transform: translateY(-3px);
}

/* Custom Toasts */
.toast-custom {
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    border: 0;
}

/* Auth Card Glass effect */
.auth-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    box-shadow: var(--card-shadow-lg);
}

.auth-badge-demo {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 0.85rem 1rem;
}

/* Estabilidad del hero en pantallas intermedias */
@media (max-width: 767.98px) {
    #home {
        min-height: auto;
        padding: 96px 0 72px;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 2.6rem);
    }

    .hero-lead {
        font-size: 1rem;
    }

    .scripture-card {
        margin-top: 2rem;
    }
}

/* Media Queries */
@media (max-width: 991.98px) {
    body {
        padding-top: 68px;
    }
    .hero-title {
        font-size: 2.35rem;
    }
    .section-padding {
        padding: 60px 0;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 1.85rem;
    }
    .scripture-card {
        padding: 1.5rem 1.25rem;
    }
    .scripture-text {
        font-size: 0.95rem;
    }
}


/* Accesibilidad: reduce animaciones cuando el sistema lo solicita. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
