/* Terms Modal Styles */

/* Modal overlay */
.terms-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.terms-modal-overlay.show {
    opacity: 1;
    visibility: visible;
    display: flex;
}

/* Contenedor principal del modal */
.terms-modal-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(191, 219, 254, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terms-modal-overlay.show .terms-modal-container {
    transform: scale(1) translateY(0);
}

/* Header del modal */
.terms-modal-header {
    padding: 32px 40px 24px;
    border-bottom: 2px solid var(--cucu-pink);
    background: linear-gradient(135deg, var(--cucu-cream) 0%, var(--cucu-pink) 100%);
    flex-shrink: 0;
}

.terms-modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cucu-text);
    margin: 0;
    padding-right: 40px;
}

.terms-modal-header p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 8px 0 0;
}

/* Botón cerrar */
.terms-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
    padding: 8px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.terms-modal-close:hover {
    background: var(--cucu-pink);
    color: var(--cucu-text);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Contenido scrollable */
.terms-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

/* Estilos para el contenido de texto */
.terms-section {
    margin-bottom: 32px;
}

.terms-section h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--cucu-text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cucu-blue);
    display: flex;
    align-items: center;
    gap: 12px;
}

.terms-section h3::before {
    content: '';
    width: 6px;
    height: 24px;
    background: linear-gradient(135deg, var(--cucu-blue) 0%, var(--cucu-lavender) 100%);
    border-radius: 3px;
    flex-shrink: 0;
}

.terms-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cucu-text);
    margin: 20px 0 12px;
}

.terms-section p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #64748b;
    margin-bottom: 16px;
    text-align: justify;
}

.terms-section ul {
    margin: 16px 0;
    padding-left: 24px;
}

.terms-section li {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #64748b;
    margin-bottom: 8px;
}

.terms-section strong {
    color: var(--cucu-text);
    font-weight: 600;
}

/* Destacados importantes */
.terms-highlight {
    background: linear-gradient(135deg, var(--cucu-cream) 0%, var(--cucu-pink) 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 24px 0;
    border-left: 4px solid var(--cucu-blue);
}

.terms-highlight p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--cucu-text);
    font-weight: 500;
}

/* Footer del modal */
.terms-modal-footer {
    padding: 24px 40px;
    border-top: 2px solid var(--cucu-pink);
    background: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn-terms-close {
    background: linear-gradient(135deg, var(--cucu-blue) 0%, var(--cucu-lavender) 100%);
    color: var(--cucu-text);
    padding: 14px 32px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(191, 219, 254, 0.4);
    font-family: 'Poppins', sans-serif;
}

.btn-terms-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(191, 219, 254, 0.6);
    background: linear-gradient(135deg, var(--cucu-lavender) 0%, #d6beff 100%);
}

/* Scrollbar personalizada */
.terms-modal-content::-webkit-scrollbar {
    width: 8px;
}

.terms-modal-content::-webkit-scrollbar-track {
    background: rgba(191, 219, 254, 0.1);
    border-radius: 10px;
}

.terms-modal-content::-webkit-scrollbar-thumb {
    background: var(--cucu-blue);
    border-radius: 10px;
}

.terms-modal-content::-webkit-scrollbar-thumb:hover {
    background: #93c5fd;
}

/* Animación de entrada */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.terms-modal-container {
    animation: modalSlideIn 0.4s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .terms-modal-overlay {
        padding: 15px;
    }
    
    .terms-modal-container {
        max-height: 90vh;
        border-radius: 20px;
    }
    
    .terms-modal-header {
        padding: 24px 20px 20px;
    }
    
    .terms-modal-header h2 {
        font-size: 1.5rem;
        padding-right: 50px;
    }
    
    .terms-modal-header p {
        font-size: 0.9rem;
    }
    
    .terms-modal-content {
        padding: 24px 20px;
    }
    
    .terms-section h3 {
        font-size: 1.2rem;
    }
    
    .terms-section h4 {
        font-size: 1rem;
    }
    
    .terms-section p,
    .terms-section li {
        font-size: 0.9rem;
    }
    
    .terms-modal-footer {
        padding: 20px;
    }
    
    .btn-terms-close {
        width: 100%;
        padding: 12px 24px;
    }
}

@media (max-width: 480px) {
    .terms-modal-overlay {
        padding: 10px;
    }
    
    .terms-modal-header {
        padding: 20px 16px 16px;
    }
    
    .terms-modal-header h2 {
        font-size: 1.3rem;
    }
    
    .terms-modal-content {
        padding: 20px 16px;
    }
    
    .terms-section {
        margin-bottom: 24px;
    }
    
    .terms-section h3 {
        font-size: 1.1rem;
    }
    
    .terms-section p,
    .terms-section li {
        font-size: 0.85rem;
        text-align: left;
    }
    
    .terms-highlight {
        padding: 16px;
    }
}

/* Estados adicionales */
.terms-modal-overlay.closing {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Mejoras de accesibilidad */
.terms-modal-close:focus,
.btn-terms-close:focus {
    outline: 3px solid var(--cucu-blue);
    outline-offset: 2px;
}

/* Efecto de lectura progresiva */
.terms-section {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInSection 0.4s ease-out forwards;
}

.terms-section:nth-child(1) { animation-delay: 0.1s; }
.terms-section:nth-child(2) { animation-delay: 0.15s; }
.terms-section:nth-child(3) { animation-delay: 0.2s; }
.terms-section:nth-child(4) { animation-delay: 0.25s; }
.terms-section:nth-child(5) { animation-delay: 0.3s; }
.terms-section:nth-child(6) { animation-delay: 0.35s; }
.terms-section:nth-child(7) { animation-delay: 0.4s; }
.terms-section:nth-child(8) { animation-delay: 0.45s; }

@keyframes fadeInSection {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}