/* =====================================================
   UK MARRIAGE BUREAU
   LEGAL PAGES MASTER CSS
   CENTRALIZED ARCHITECTURE
   UPGRADED: DESKTOP + MOBILE UX
===================================================== */

/* =====================================================
   LEGAL PAGE WRAPPER
===================================================== */

.legal-page {
    position: relative;
    background: var(--bg-light, #f8f9fa);
    overflow: hidden;
}

/* =====================================================
   LEGAL HERO
===================================================== */

.legal-page .legal-hero {
    position: relative;
    padding: 95px 0 85px;
    background: linear-gradient(135deg, #071c2c 0%, #0f3b46 55%, #125461 100%);
    overflow: hidden;
}

.legal-page .legal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.08), transparent 42%);
}

.legal-page .legal-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 920px;
    margin: auto;
}

.legal-page .legal-hero-title {
    color: #ffffff;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1.15;
    margin-bottom: 18px;
    font-weight: 700;
}

.legal-page .legal-hero-description {
    color: rgba(255,255,255,0.88);
    font-size: 1.08rem;
    line-height: 1.9;
    max-width: 760px;
    margin: auto;
}

.hero-badge {
    margin-top: 25px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.12);
    padding: 10px 24px;
    border-radius: 50px;
    color: #d4af5f;
    font-size: 0.9rem;
}

.button-bar {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.language-wrapper .btn-language {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 12px 25px;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(212,175,95,0.3);
}

.actions-wrapper .btn-consult {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #d4af5f, #b8943e);
    padding: 12px 30px;
    border-radius: 50px;
    color: #071c2c;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* =====================================================
   WELCOME MODAL
===================================================== */

.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.welcome-overlay.active {
    opacity: 1;
    visibility: visible;
}

.welcome-modal {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    max-width: 500px;
    width: 90%;
    padding: 40px 35px;
    border-radius: 32px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.welcome-overlay.active .welcome-modal {
    transform: scale(1);
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #d4af5f, #b8943e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.welcome-icon i {
    font-size: 40px;
    color: #071c2c;
}

.welcome-modal h2 {
    color: #071c2c;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.welcome-modal p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 25px;
}

.welcome-close-btn {
    background: linear-gradient(135deg, #d4af5f, #b8943e);
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    color: #071c2c;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

/* =====================================================
   LEGAL GRID
===================================================== */

.legal-page .legal-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 42px;
    align-items: start;
    padding: 70px 0;
}

/* =====================================================
   LEGAL SIDEBAR
===================================================== */

.legal-page .legal-sidebar {
    position: sticky;
    top: 110px;
}

.legal-page .sidebar-inner {
    background: #ffffff;
    border-radius: 32px;
    padding: 24px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.sidebar-header i {
    font-size: 28px;
    color: #d4af5f;
}

.sidebar-header h3 {
    font-size: 1.3rem;
    color: #071c2c;
    margin: 0;
}

/* =====================================================
   CAPSULE NAVIGATION - UPGRADED SPACING
===================================================== */

.legal-page .legal-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.legal-page .legal-nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    min-height: 62px;
    padding: 14px 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #155e75 0%, #047857 100%);
    color: #ffffff;
    text-decoration: none;
    transition: all 0.35s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.08);
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
}

.legal-page .legal-nav-link i {
    color: #d4af5f;
    width: 22px;
    text-align: center;
}

.legal-page .legal-nav-link:hover {
    transform: translateY(-2px);
}

.legal-page .legal-nav-link.active {
    background: linear-gradient(135deg, #1aa36f 0%, #0f9f63 100%);
    box-shadow: 0 8px 18px rgba(15,159,99,0.22), 0 0 0 3px rgba(212,175,95,0.22);
}

.sidebar-contact {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.sidebar-contact h4 {
    color: #071c2c;
    margin-bottom: 15px;
    font-size: 1rem;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #25D366;
    padding: 10px 20px;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

/* =====================================================
   LEGAL CONTENT - DESKTOP SINGLE DISPLAY AREA
===================================================== */

.legal-page .legal-content {
    background: #ffffff;
    border-radius: 34px;
    padding: 50px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.06);
    position: relative;
    min-height: 600px;
}

.legal-page .legal-section {
    margin-bottom: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.legal-page .legal-section.active-section {
    display: block;
}

.legal-page .legal-section.inactive-section {
    display: none;
}

.legal-page .legal-section:last-child {
    margin-bottom: 0;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    color: #071c2c;
    font-size: 1.8rem;
    margin-bottom: 10px;
    position: relative;
    padding-bottom: 15px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #d4af5f, #b8943e);
    border-radius: 3px;
}

.section-header p {
    color: #64748b;
    font-size: 1rem;
}

.content-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.intro-card {
    background: linear-gradient(135deg, #fef9e6, #fff8f0);
    border: 1px solid rgba(212,175,95,0.2);
    text-align: center;
    padding: 45px 35px;
}

.intro-highlight {
    background: rgba(212,175,95,0.1);
    padding: 20px;
    border-radius: 20px;
    margin: 25px 0;
}

.service-list {
    list-style: none;
    padding: 0;
}

.service-list li {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.info-box {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-radius: 20px;
    margin: 20px 0;
}

.info-box.warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.info-box.success {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
}

.info-box.info {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
}

.info-box i {
    font-size: 24px;
}

.fee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.fee-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
}

.agreement-card {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    text-align: center;
}

.agreement-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.cta-btn, .btn-register, .btn-consult-alt, .btn-print {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-btn, .btn-register {
    background: linear-gradient(135deg, #d4af5f, #b8943e);
    color: #071c2c;
}

.btn-consult-alt {
    background: #071c2c;
    color: white;
}

.btn-print {
    background: #64748b;
    color: white;
    border: none;
    cursor: pointer;
}

/* =====================================================
   LEGAL CTA
===================================================== */

.legal-page .legal-cta {
    margin-top: 80px;
    padding: 65px;
    border-radius: 42px;
    background: linear-gradient(135deg, #f5f7fa 0%, #eef5f5 100%);
    text-align: center;
}

.cta-content h2 {
    color: #071c2c;
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn-primary {
    background: linear-gradient(135deg, #d4af5f, #b8943e);
    padding: 14px 32px;
    border-radius: 50px;
    color: #071c2c;
    text-decoration: none;
    font-weight: 600;
}

.btn-secondary {
    background: #071c2c;
    padding: 14px 32px;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.text-center {
    text-align: center;
}

/* =====================================================
   MOBILE ACCORDION STYLES
===================================================== */

.mobile-accordion-trigger {
    cursor: pointer;
}

.mobile-accordion-content {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
}

.mobile-accordion-content.open {
    max-height: 3000px;
}

.mobile-accordion-content .legal-section {
    margin-bottom: 0;
}

/* =====================================================
   RESPONSIVE - DESKTOP + MOBILE UPGRADED
===================================================== */

@media (min-width: 993px) {
    /* Desktop: All sections hidden by default, active shown */
    .legal-page .legal-section {
        display: none;
    }
    .legal-page .legal-section.active-section {
        display: block;
    }
    /* Remove any accordion classes on desktop */
    .legal-page .mobile-accordion-trigger {
        cursor: default;
    }
    .legal-page .mobile-accordion-content {
        max-height: none !important;
        overflow: visible !important;
    }
}

@media (max-width: 992px) {
    .legal-page .legal-grid {
        grid-template-columns: 1fr;
    }
    .legal-page .legal-sidebar {
        position: relative;
        top: unset;
    }
    .button-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    /* Mobile Accordion: Reset desktop behavior */
    .legal-page .legal-content {
        padding: 0;
        background: transparent;
        box-shadow: none;
    }
    
    .legal-page .legal-section {
        display: block !important;
        background: #ffffff;
        border-radius: 34px;
        padding: 34px 26px;
        margin-bottom: 20px;
        box-shadow: 0 12px 35px rgba(0,0,0,0.06);
        opacity: 1 !important;
        transform: none !important;
    }
    
    .legal-page .legal-section:last-child {
        margin-bottom: 0;
    }
    
    /* Hide the desktop active/inactive classes on mobile */
    .legal-page .legal-section.active-section,
    .legal-page .legal-section.inactive-section {
        display: block !important;
    }
    
    /* Accordion content wrapper */
    .mobile-accordion-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-accordion-content.open {
        max-height: 3000px;
    }
    
    /* Sidebar navigation becomes accordion triggers */
    .legal-page .legal-nav-link {
        margin-bottom: 0;
        position: relative;
    }
    
    .legal-page .legal-nav-link::after {
        content: '\f078';
        font-family: 'Font Awesome 6 Free';
        font-weight: 600;
        position: absolute;
        right: 24px;
        transition: transform 0.3s ease;
    }
    
    .legal-page .legal-nav-link.active::after {
        transform: rotate(180deg);
    }
    
    /* Remove active state background styling for mobile triggers */
    .legal-page .legal-nav-link.active {
        background: linear-gradient(135deg, #155e75 0%, #047857 100%);
        box-shadow: 0 4px 10px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.08);
    }
    
    .legal-page .legal-nav-link.open-trigger {
        background: linear-gradient(135deg, #1aa36f 0%, #0f9f63 100%);
        box-shadow: 0 8px 18px rgba(15,159,99,0.22), 0 0 0 3px rgba(212,175,95,0.22);
    }
}

@media (max-width: 768px) {
    .legal-page .legal-hero {
        padding: 80px 0 70px;
    }
    .legal-page .legal-content {
        padding: 0;
    }
    .legal-page .legal-section {
        padding: 30px 22px;
        border-radius: 28px;
    }
    .welcome-modal {
        padding: 30px 20px;
    }
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}