/* =========================================================
   MODALS.CSS - LIGHT THEME POPUPS, LEGAL & LIGHTBOX GALLERY
   (V4.4 - Free Scroll Enabled)
   ========================================================= */

.root-modal { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100vw; height: 100vh; 
    background: rgba(15, 23, 42, 0.4); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    z-index: 999999; 
    align-items: center; justify-content: center; 
    padding: 20px;
}
.root-modal.active { display: flex; animation: modalFadeIn 0.3s ease; }

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content { 
    background: #ffffff; 
    border: 1px solid #e5e7eb; 
    border-radius: 20px; 
    width: 100%; 
    max-width: 850px; 
    max-height: 85vh; 
    overflow-y: auto; 
    padding: 50px; 
    position: relative; 
    box-shadow: 0 40px 100px rgba(0,0,0,0.12);
}
.modal-content.narrow { max-width: 480px; text-align: center; }

.close-btn { 
    position: absolute; 
    top: 25px; right: 30px; 
    background: #f3f4f6; 
    border: none; 
    color: #6b7280; 
    width: 40px; height: 40px; 
    border-radius: 50%; 
    font-size: 1.5rem; 
    cursor: pointer; 
    transition: 0.3s; 
    display: flex; align-items: center; justify-content: center;
    line-height: 1; 
    z-index: 1000005;
}
.close-btn:hover { background: #e5e7eb; color: #111827; transform: rotate(90deg); }

.auth-header { margin-bottom: 35px; }
.auth-header h2 { font-size: 2rem; font-weight: 900; color: #111827; letter-spacing: -1px; }
.auth-header p { color: #6b7280; margin-top: 10px; font-weight: 500; }

.legal-container { text-align: left; }
.legal-title { 
    font-size: 2.5rem; 
    color: #111827; 
    margin-bottom: 20px; 
    font-weight: 900; 
    border-bottom: 2px solid #f3f4f6; 
    padding-bottom: 20px; 
    letter-spacing: -1px;
}
.legal-text { color: #4b5563; line-height: 1.8; font-size: 1.05rem; margin-top: 20px; }
.legal-text h4 { 
    color: #111827; 
    margin: 30px 0 12px; 
    font-size: 1.3rem; 
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}
.legal-text h4::before {
    content: '';
    width: 4px; height: 20px;
    background: var(--accent);
    border-radius: 2px;
}

/* =========================================================
   LIGHTBOX GALLERY WITH FREE SCROLL ENABLED
   ========================================================= */
#modal-lightbox {
    background: rgba(10, 15, 30, 0.98) !important; 
    padding: 0;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 1000000;
    overflow: auto; /* Allows screen scroll if image grows */
}
.lightbox-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: 40px;
    box-sizing: border-box;
}

.lightbox-image {
    max-width: 85vw !important;
    max-height: 80vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.9);
    transition: opacity 0.2s ease-in-out;
    touch-action: pan-x pan-y pinch-zoom; /* Explicit command to enable browser zoom */
}
.lightbox-caption {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.25rem;
    margin-top: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    font-size: 2.5rem;
    padding: 15px 22px;
    cursor: pointer;
    border-radius: 50%;
    transition: 0.3s;
    backdrop-filter: blur(5px);
    z-index: 1000002;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
}
.lightbox-nav.prev { left: 40px; }
.lightbox-nav.next { right: 40px; }

.lightbox-close {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    top: 35px;
    right: 40px;
    border: none;
    backdrop-filter: blur(5px);
}
.lightbox-close:hover {
    background: rgba(220, 38, 38, 0.9) !important;
    color: #ffffff;
}

@media (max-width: 768px) {
    .modal-content { padding: 30px 20px; border-radius: 12px; }
    .legal-title { font-size: 1.8rem; }
    .close-btn { top: 15px; right: 15px; width: 35px; height: 35px; }
    
    .lightbox-wrapper { padding: 15px; }
    .lightbox-image { 
        max-width: 95vw !important; 
        max-height: 75vh !important; 
    }
    .lightbox-nav { 
        padding: 12px 16px; 
        font-size: 1.8rem; 
        background: rgba(0, 0, 0, 0.6); 
    }
    .lightbox-nav.prev { left: 15px; }
    .lightbox-nav.next { right: 15px; }
    .lightbox-close { top: 15px; right: 15px; }
    .lightbox-caption { font-size: 0.95rem; padding: 0 30px; margin-top: 15px; }
}