/* Condiciones de trabajo y aceptación de proyectos */
.footer-legal {
    max-width: 1180px;
    margin: 18px auto 0;
    text-align: center;
}

.legal-disclosure {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
}

.legal-disclosure summary {
    list-style: none;
}

.legal-disclosure summary::-webkit-details-marker {
    display: none;
}

.legal-toggle-btn {
    width: fit-content;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 999px;
    border: 1px solid rgba(53, 226, 255, 0.45);
    background: transparent;
    color: #bdf7ff;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 0 22px rgba(53, 226, 255, 0.10);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.legal-toggle-btn:hover,
.legal-toggle-btn:focus-visible {
    transform: translateY(-1px);
    color: #ffffff;
    border-color: rgba(255, 75, 255, 0.62);
    box-shadow: 0 0 26px rgba(255, 75, 255, 0.16);
    outline: none;
}

.legal-panel {
    margin-top: 16px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: radial-gradient(circle at 0 0, rgba(53, 226, 255, 0.12), transparent 58%), radial-gradient(circle at 100% 100%, rgba(255, 75, 255, 0.10), transparent 58%), rgba(7, 10, 26, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.58);
    padding: clamp(16px, 3vw, 28px);
    color: var(--text-muted);
    text-align: left;
}

.legal-panel > :first-child {
    margin-top: 0 !important;
}

.legal-panel h3 {
    color: var(--text-main);
    font-family: "Orbitron", sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: clamp(1rem, 2vw, 1.28rem);
    line-height: 1.28;
    margin: 0 0 26px 0;
}

.legal-panel > p:first-of-type {
    margin-top: 8px;
}

.legal-panel h4 {
    color: #ffffff;
    margin: 18px 0 8px;
    font-size: 0.98rem;
}

.legal-panel p,
.legal-panel li {
    line-height: 1.6;
    font-size: 0.9rem;
}

.legal-panel ul,
.legal-panel ol {
    padding-left: 20px;
    margin: 8px 0 0;
}

.legal-panel li {
    margin-bottom: 8px;
}

.legal-panel strong {
    color: #f2f4ff;
    font-weight: 600;
}

.legal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.legal-card {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    padding: 14px;
}

.legal-references a {
    color: #bdf7ff;
    text-decoration: none;
    border-bottom: 1px solid rgba(189, 247, 255, 0.35);
}

.legal-note {
    margin-top: 14px;
    font-size: 0.78rem;
    opacity: 0.85;
}

.legal-disclosure[open]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 11998;
    background: rgba(1, 3, 12, 0.76);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.legal-disclosure[open] > .legal-toggle-btn {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 12001;
    background: rgba(8, 12, 30, 0.96);
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65), 0 0 24px rgba(53, 226, 255, 0.16);
}

.legal-disclosure[open] > .legal-toggle-btn::after {
    content: "Cerrar";
    margin-left: 8px;
    color: #ffffff;
}

.legal-disclosure[open] > .legal-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 12000;
    width: min(1120px, calc(100vw - 32px));
    height: min(82dvh, 820px);
    max-height: 82dvh;
    margin: 0;
    overflow-y: auto;
    padding: clamp(18px, 3vw, 34px);
    transform: translate(-50%, -50%);
    border-radius: 26px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.82);
    scrollbar-width: thin;
}

.legal-disclosure[open] > .legal-panel h3 {
    position: sticky;
    top: -1px;
    z-index: 2;
    margin: calc(-1 * clamp(18px, 3vw, 34px)) calc(-1 * clamp(18px, 3vw, 34px)) 36px;
    padding: 24px clamp(18px, 3vw, 34px) 30px;
    background: linear-gradient(120deg, rgba(10, 15, 38, 0.99), rgba(38, 12, 62, 0.98));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-disclosure[open] > .legal-panel h3 + p {
    margin-top: 0;
}

a,
button,
[role="button"],
summary {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

#starsCanvas,
.hero-overlay,
.navbar::before,
.service-card::before,
#global-loader.hidden,
.intro-overlay.hidden {
    pointer-events: none !important;
}

#global-loader.hidden,
.intro-overlay.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    body, header, main, footer, section, .section, .hero-content, .hero-text, .hero-buttons, .portfolio-card, .social-grid, .contact-grid, .footer {
        pointer-events: auto !important;
    }

    .navbar {
        z-index: 9800;
        overflow: visible;
        pointer-events: auto !important;
    }

    .nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 999px;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.10);
        cursor: pointer;
        position: relative;
        z-index: 9802;
        pointer-events: auto !important;
    }

    .nav-links {
        position: fixed;
        top: calc(78px + env(safe-area-inset-top));
        left: 12px;
        right: 12px;
        width: auto;
        max-height: calc(100dvh - 104px);
        overflow-y: auto;
        flex-direction: column;
        gap: 4px;
        padding: 12px;
        border-radius: 18px;
        background: rgba(4, 6, 20, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72);
        z-index: 9801;
    }

    .nav-links:not(.nav-open) {
        display: none !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none !important;
    }

    .nav-links.nav-open {
        display: flex !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto !important;
        transform: translateY(0);
    }

    .nav-links a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 8px;
        border-radius: 12px;
        color: #ffffff;
        pointer-events: auto !important;
        position: relative;
        z-index: 9803;
    }

    .btn-primary, .btn-secondary, .portfolio-link, .social-card, .contact-form button, .contact-form input, .contact-form textarea, #mira-toggle, .legal-toggle-btn {
        position: relative;
        z-index: 10;
        pointer-events: auto !important;
    }

    .section-nav {
        display: none !important;
        pointer-events: none !important;
    }

    #mira-widget {
        pointer-events: none !important;
    }

    #mira-toggle,
    #mira-chat.mira-chat-open {
        pointer-events: auto !important;
    }
}

@media (max-width: 767px) {
    #intro-video-overlay,
    .intro-overlay,
    #global-loader {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        z-index: -1 !important;
    }
}

@media (max-width: 600px) {
    .legal-toggle-btn {
        width: 100%;
        text-align: center;
    }

    .legal-disclosure[open] > .legal-toggle-btn {
        top: auto;
        right: 10px;
        left: 10px;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100% - 20px);
        justify-content: center;
    }

    .legal-disclosure[open] > .legal-panel {
        width: 100%;
        height: 88dvh;
        max-height: 88dvh;
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        border-radius: 22px 22px 0 0;
        padding: 16px 16px 78px;
    }

    .legal-disclosure[open] > .legal-panel h3 {
        margin: -16px -16px 26px;
        padding: 18px 16px 24px;
        font-size: 0.98rem;
        letter-spacing: 0.06em;
    }
}
