/**
 * Estilos mejorados para Modal de Términos y Condiciones
 * Nicole di Bella Collections
 */

/* Mejorar el overlay del modal de términos */
.terms-modal {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 11000 !important; /* Más alto que el modal de auth (10000) */
    /* Asegurar posicionamiento correcto */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.terms-modal.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Mejorar el contenido del modal */
.terms-modal .auth-modal-content {
    background: white !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
    max-width: 900px !important;
    width: 95% !important;
    max-height: 85vh !important;
    animation: termsSlideIn 0.3s ease-out;
    position: relative !important;
    /* El flexbox del padre ya lo centra */
    margin: 20px !important;
    transform: none !important;
}

@keyframes termsSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Header del modal */
.terms-modal .close-modal {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    background: none !important;
    border: none !important;
    font-size: 28px !important;
    color: #999 !important;
    cursor: pointer !important;
    padding: 5px !important;
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
}

.terms-modal .close-modal:hover {
    background: rgba(139, 92, 246, 0.1) !important;
    color: #8b5cf6 !important;
    transform: scale(1.1) !important;
}

/* Contenido del modal */
.terms-modal .auth-forms {
    padding: 0 !important;
}

.terms-modal .terms-content {
    padding: 40px 30px 30px !important;
}

.terms-modal .terms-content h3 {
    color: #8b5cf6 !important;
    margin-bottom: 30px !important;
    text-align: center !important;
    font-family: 'League Spartan', sans-serif !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    position: relative !important;
}

.terms-modal .terms-content h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #8b5cf6 0%, #d8b4e2 100%);
    margin: 15px auto;
    border-radius: 2px;
}

/* Contenido del texto */
.terms-modal .terms-content > div {
    color: #555 !important;
    line-height: 1.7 !important;
    font-size: 15px !important;
    max-height: 50vh !important;
    overflow-y: auto !important;
    padding-right: 10px !important;
}

/* Scroll personalizado */
.terms-modal .terms-content > div::-webkit-scrollbar {
    width: 6px;
}

.terms-modal .terms-content > div::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.terms-modal .terms-content > div::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6 0%, #d8b4e2 100%);
    border-radius: 3px;
}

.terms-modal .terms-content > div::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #c084fc 100%);
}

/* Títulos de secciones */
.terms-modal .terms-content h4 {
    color: #2d2d2d !important;
    margin-top: 25px !important;
    margin-bottom: 12px !important;
    font-family: 'League Spartan', sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    position: relative !important;
    padding-left: 15px !important;
}

.terms-modal .terms-content h4::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #8b5cf6 0%, #d8b4e2 100%);
    border-radius: 2px;
}

/* Párrafos */
.terms-modal .terms-content p {
    margin-bottom: 15px !important;
    text-align: justify !important;
    hyphens: auto !important;
}

/* Listas */
.terms-modal .terms-content ul {
    margin: 15px 0 !important;
    padding-left: 25px !important;
}

.terms-modal .terms-content li {
    margin-bottom: 8px !important;
    position: relative !important;
}

.terms-modal .terms-content li::marker {
    color: #8b5cf6 !important;
}

/* Pie del modal */
.terms-modal .terms-content p:last-of-type {
    margin-top: 25px !important;
    padding-top: 20px !important;
    border-top: 1px solid #eee !important;
    text-align: center !important;
    font-size: 13px !important;
    color: #999 !important;
    font-style: italic !important;
}

/* Botón de cerrar */
.terms-modal .close-terms-modal {
    background: linear-gradient(135deg, #8b5cf6 0%, #d8b4e2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 15px 35px !important;
    border-radius: 25px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2) !important;
}

.terms-modal .close-terms-modal:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3) !important;
    background: linear-gradient(135deg, #7c3aed 0%, #c084fc 100%) !important;
}

.terms-modal .close-terms-modal:active {
    transform: translateY(0) !important;
}

/* Responsive para móvil */
@media (max-width: 768px) {
    .terms-modal .auth-modal-content {
        width: 98% !important;
        margin: 10px !important;
        max-height: 90vh !important;
    }
    
    .terms-modal .terms-content {
        padding: 30px 20px 25px !important;
    }
    
    .terms-modal .terms-content h3 {
        font-size: 1.6rem !important;
        margin-bottom: 25px !important;
    }
    
    .terms-modal .terms-content > div {
        font-size: 14px !important;
        max-height: 45vh !important;
    }
    
    .terms-modal .terms-content h4 {
        font-size: 1rem !important;
        margin-top: 20px !important;
        padding-left: 12px !important;
    }
    
    .terms-modal .close-terms-modal {
        width: 100% !important;
        padding: 18px 20px !important;
        font-size: 1.1rem !important;
    }
}

/* Animación de entrada mejorada */
@media (prefers-reduced-motion: no-preference) {
    .terms-modal.active .auth-modal-content {
        animation: termsModalEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

@keyframes termsModalEnter {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Mejorar legibilidad en pantallas pequeñas */
@media (max-width: 480px) {
    .terms-modal .terms-content {
        padding: 25px 15px 20px !important;
    }
    
    .terms-modal .close-modal {
        top: 10px !important;
        right: 15px !important;
        font-size: 24px !important;
        width: 30px !important;
        height: 30px !important;
    }
}

/* Estados de focus para accesibilidad */
.terms-modal .close-modal:focus,
.terms-modal .close-terms-modal:focus {
    outline: 2px solid #8b5cf6 !important;
    outline-offset: 2px !important;
}

/* Loading state si se necesita */
.terms-modal.loading .terms-content {
    opacity: 0.7;
    pointer-events: none;
}

.terms-modal.loading .terms-content::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ajuste para responsive en móvil */
@media (max-width: 768px) {
    .terms-modal .auth-modal-content {
        width: 98% !important;
        max-width: calc(100vw - 20px) !important;
        margin: 10px !important;
    }
}