/* --- Footer Base & Layout --- */
.site-footer {
    background-color: #030405; /* Deepest dark to anchor the page */
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 4rem;
    overflow: hidden;
}

/* Subtle background glow from the bottom */
.site-footer::before {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 60%; height: 300px;
    background: radial-gradient(ellipse at bottom, rgba(0, 123, 255, 0.08) 0%, rgba(5,6,8,0) 70%);
    pointer-events: none; z-index: 0;
}

/* --- Pre-Footer Call to Action (The Pazazz) --- */
.footer-cta {
    position: relative; 
    z-index: 2;
    width: 100%; /* Spans the full width of the 1280px container */
    margin: 0 auto 6rem;
    background: linear-gradient(145deg, rgba(13, 17, 22, 0.95) 0%, rgba(5, 6, 8, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08); 
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(15px);
}

/* Abstract Background Glow */
.cta-bg-glow {
    position: absolute;
    top: -50%; left: -10%;
    width: 60%; height: 200%;
    background: radial-gradient(ellipse at center, rgba(0, 123, 255, 0.1) 0%, transparent 70%);
    transform: rotate(-15deg);
    pointer-events: none;
    z-index: 0;
}

/* Subtle Grid Overlay */
.cta-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
}

.cta-content-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 4rem;
    gap: 4rem;
}

/* Left Side Text */
.cta-text-area {
    flex: 1.2;
    text-align: left;
}

.cta-text-area h2 {
    font-size: clamp(2rem, 3vw, 2.8rem);
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.cta-text-area p {
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.cta-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-actions .btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.05rem;
}

/* Right Side Trust Grid */
.cta-visual-area {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.cta-trust-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

.trust-pill {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem; /* Tightened from 1.2rem */
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px; /* Tightened from 10px */
    transition: all 0.3s ease;
}

.trust-pill:hover {
    background: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.3);
    transform: translateY(-3px);
}

.trust-icon {
    width: 32px; height: 32px; /* Tightened from 36px */
    border-radius: 8px;
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; /* Slightly smaller icon */
    box-shadow: inset 0 0 10px rgba(0, 123, 255, 0.2);
}

.trust-pill span {
    color: #fff;
    font-weight: 500;
    font-size: 0.85rem; /* Tightened from 0.9rem */
}

/* Responsive Stacking */
@media (max-width: 992px) {
    .cta-content-wrapper {
        flex-direction: column;
        padding: 3rem 2rem;
        text-align: center;
    }
    .cta-text-area { text-align: center; }
    .cta-text-area p { max-width: 100%; margin: 0 auto 2.5rem; }
    .cta-actions { justify-content: center; }
    .cta-visual-area { justify-content: center; width: 100%; }
    .cta-bg-glow { top: 0; left: 0; width: 100%; transform: none; }
    .cta-grid-pattern { mask-image: none; -webkit-mask-image: none; }
}

@media (max-width: 576px) {
    .cta-trust-grid { grid-template-columns: 1fr; }
    .trust-pill { flex-direction: row; align-items: center; }
}

/* --- Footer Links Grid --- */
.footer-content {
    position: relative; z-index: 2; display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 3rem; padding-bottom: 4rem;
}

/* Brand Column */
.footer-brand .logo-text { font-size: 1.4rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.footer-brand .logo-text img { height: 32px; filter: drop-shadow(0 0 8px rgba(0, 123, 255, 0.4)); }
.footer-brand p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; max-width: 280px; }

/* Link Columns */
.footer-heading {
    font-size: 1.05rem; color: #fff; margin-bottom: 1.5rem; font-weight: 600;
    position: relative; padding-bottom: 0.6rem;
}
/* Electric Blue Underline */
.footer-heading::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 25px; height: 2px; background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow); border-radius: 2px;
}

.footer-links { display: flex; flex-direction: column; gap: 0.8rem; }
.footer-links li a {
    color: var(--text-muted); font-size: 0.85rem; font-weight: 400;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); display: inline-flex; align-items: center;
}
.footer-links li a:hover {
    color: #fff; transform: translateX(6px); text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* --- Sub-Footer (Bottom Bar) --- */
.footer-bottom {
    position: relative; z-index: 2; border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem 0; display: flex; flex-direction: column; gap: 1.5rem;
}

/* Legal Links Row (Now triggers popups) */
.footer-legal-links { display: flex; justify-content: flex-start; gap: 2rem; }
.footer-legal-links a {
    color: var(--text-muted); font-size: 0.8rem; transition: color 0.2s; cursor: pointer;
}
.footer-legal-links a:hover { color: #fff; }

/* Final Copyright & Socials Row */
.footer-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-meta p { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin: 0; }

/* ByteBox Media Link formatting */
.bytebox-link { color: #38bdf8; font-weight: 500; text-decoration: none; transition: all 0.3s ease; }
.bytebox-link:hover { color: #fff; text-shadow: 0 0 10px rgba(56, 189, 248, 0.6); }

/* Social Icons */
.footer-socials { display: flex; gap: 1rem; }
.footer-socials a {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 6px;
    color: var(--text-muted); font-size: 1.1rem; transition: all 0.3s ease;
}
.footer-socials a:hover {
    background: rgba(0, 123, 255, 0.1); border-color: rgba(0, 123, 255, 0.4);
    color: #fff; transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0, 123, 255, 0.15);
}

/* --- DYNAMIC LEGAL MODAL (THE MAGIC) --- */
.legal-modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 999999; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: all 0.3s ease; padding: 1.5rem;
}
.legal-modal-overlay.active { opacity: 1; pointer-events: auto; }

.legal-modal-box {
    background: #0d1117;
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 12px; width: 100%; max-width: 800px; max-height: 85vh;
    display: flex; flex-direction: column; position: relative; overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8), 0 0 40px rgba(0, 123, 255, 0.1);
    transform: translateY(30px) scale(0.98);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.legal-modal-overlay.active .legal-modal-box { transform: translateY(0) scale(1); }

/* Subtle top glow for the modal */
.legal-modal-box::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    z-index: 10;
}

.legal-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(5,6,8,0.9); z-index: 5;
}
.legal-modal-title {
    color: #fff; font-size: 1.25rem; font-weight: 600; margin: 0;
    display: flex; align-items: center; gap: 10px;
}
.legal-modal-title iconify-icon { color: var(--primary); font-size: 1.5rem; filter: drop-shadow(0 0 5px rgba(0,123,255,0.5)); }

.legal-modal-close {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 1.5rem; cursor: pointer; transition: color 0.2s, transform 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.legal-modal-close:hover { color: #fff; transform: rotate(90deg); }

.legal-modal-body {
    padding: 2rem; overflow-y: auto; color: var(--text-muted); font-size: 0.95rem; line-height: 1.8;
}

/* Typography styles for fetched content inside modal */
.legal-modal-body h1, .legal-modal-body h2, .legal-modal-body h3 { color: #fff; margin-top: 1.5rem; margin-bottom: 0.75rem; font-weight: 600; }
.legal-modal-body h1:first-child, .legal-modal-body h2:first-child { margin-top: 0; }
.legal-modal-body p { margin-bottom: 1rem; }
.legal-modal-body a { color: var(--primary); text-decoration: underline; }
.legal-modal-body ul { padding-left: 1.5rem; margin-bottom: 1rem; list-style-type: disc; }
.legal-modal-body li { margin-bottom: 0.5rem; }

/* The Loader */
.modal-loader { display: none; align-items: center; justify-content: center; padding: 4rem; flex-direction: column; gap: 1rem; color: var(--primary); font-weight: 500;}
.modal-loader.active { display: flex; }
.spinner {
    width: 40px; height: 40px; border: 3px solid rgba(0,123,255,0.1);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 1s linear infinite; box-shadow: 0 0 15px rgba(0,123,255,0.2);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Custom Scrollbar for the modal */
.legal-modal-body::-webkit-scrollbar { width: 8px; }
.legal-modal-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.legal-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.legal-modal-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .footer-content { grid-template-columns: 1fr 1fr 1fr; }
    .footer-brand { grid-column: span 3; margin-bottom: 2rem; }
}

@media (max-width: 768px) {
    .footer-content { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
    .footer-brand { grid-column: span 1; display: flex; flex-direction: column; align-items: center; }
    .footer-brand .logo-text { justify-content: center; }
    .footer-brand p { margin: 0 auto; }
    .footer-heading::after { left: 50%; transform: translateX(-50%); }
    .footer-links { align-items: center; }
    .footer-links li a { justify-content: center; }
    .footer-links li a:hover { transform: translateY(-3px); } 
    .footer-cta { padding: 2.5rem 1.5rem; }
    .footer-cta h2 { font-size: 1.6rem; }
    .footer-bottom { align-items: center; text-align: center; }
    .footer-legal-links { justify-content: center; flex-wrap: wrap; gap: 1rem; }
    .footer-meta { flex-direction: column; align-items: center; gap: 1.5rem; }
    .footer-socials { justify-content: center; }
    
    /* Mobile Modal Adjustment */
    .legal-modal-overlay { padding: 1rem; }
    .legal-modal-body { padding: 1.5rem; }
}