.legal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.legal-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.legal-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    flex-shrink: 0;
}

.legal-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c5530;
    font-weight: 600;
}

.legal-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.legal-modal-close:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
    transform: rotate(90deg);
}

.legal-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    font-size: 14px;
    color: #333;
}

.legal-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
}

.legal-content p {
    margin-bottom: 8px;
}

.legal-content br {
    display: none;
}

.legal-content h1,
.legal-content h2,
.legal-content h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    color: #2c5530;
}

.legal-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    background: #f8f9fa;
    flex-shrink: 0;
}

.legal-modal-agree {
    padding: 10px 28px;
    background: #2c5530;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.legal-modal-agree:hover {
    background: #4a7c59;
}

body.dark-mode .legal-modal {
    background: #1e1e1e;
}

body.dark-mode .legal-modal-header {
    background: #2a2a2a;
    border-bottom-color: #404040;
}

body.dark-mode .legal-modal-header h3 {
    color: #8fb996;
}

body.dark-mode .legal-modal-body {
    color: #e0e0e0;
}

body.dark-mode .legal-modal-footer {
    background: #2a2a2a;
    border-top-color: #404040;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .legal-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .legal-modal-header {
        padding: 16px 20px;
    }
    
    .legal-modal-body {
        padding: 20px;
    }
    
    .legal-modal-footer {
        padding: 12px 20px;
    }
}