.legal-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 18px;
    padding: 14px 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.legal-footer button {
    border: 0;
    padding: 0;
    background: transparent;
    color: #8bc7ff;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

[data-theme="light"] .legal-footer {
    color: rgba(17, 24, 39, 0.64);
}

[data-theme="light"] .legal-footer button {
    color: #2563eb;
}

.legal-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 8, 19, 0.72);
    backdrop-filter: blur(14px);
}

.legal-modal-overlay.hidden {
    display: none;
}

.legal-modal-card {
    width: min(720px, 100%);
    max-height: min(86vh, 820px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(130, 180, 255, 0.25);
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(86, 128, 255, 0.22), transparent 34%),
        linear-gradient(145deg, rgba(19, 25, 48, 0.98), rgba(8, 12, 28, 0.98));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
    color: #fff;
}

.legal-modal-head {
    padding: 22px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-modal-kicker {
    margin-bottom: 7px;
    color: #8bc7ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legal-modal-title {
    margin: 0;
    font-size: clamp(22px, 4vw, 30px);
    line-height: 1.15;
}

.legal-modal-subtitle {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 15px;
}

.legal-modal-body {
    padding: 18px 24px;
    overflow: auto;
}

.legal-doc-text {
    display: grid;
    gap: 12px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 14px;
    line-height: 1.65;
}

.legal-doc-text p {
    margin: 0;
}

.legal-doc-meta {
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
}

.legal-consent-links {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

.legal-consent-links button {
    width: 100%;
    border: 1px solid rgba(139, 199, 255, 0.3);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    text-align: left;
    cursor: pointer;
}

.legal-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
    line-height: 1.45;
}

.legal-checkbox-row input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: #6ea8ff;
}

.legal-modal-actions {
    padding: 16px 24px 22px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
}

.legal-btn-primary {
    background: linear-gradient(135deg, #64c8ff, #7c6cff);
    color: #fff;
}

.legal-btn-primary:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.legal-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.86);
}

.legal-status {
    min-height: 20px;
    margin-top: 12px;
    color: #ffb4b4;
    font-size: 13px;
}

[data-theme="light"] .legal-modal-card {
    background:
        radial-gradient(circle at top left, rgba(74, 144, 255, 0.18), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98));
    color: #111827;
}

[data-theme="light"] .legal-modal-subtitle,
[data-theme="light"] .legal-doc-text,
[data-theme="light"] .legal-checkbox-row {
    color: rgba(17, 24, 39, 0.78);
}

[data-theme="light"] .legal-doc-meta {
    color: rgba(17, 24, 39, 0.56);
}

[data-theme="light"] .legal-consent-links button,
[data-theme="light"] .legal-btn-secondary {
    background: rgba(37, 99, 235, 0.08);
    color: #111827;
}

@media (max-width: 620px) {
    .legal-modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .legal-modal-card {
        max-height: 92vh;
        border-radius: 22px;
    }

    .legal-modal-actions {
        flex-direction: column-reverse;
    }

    .legal-btn {
        width: 100%;
    }
}
