/* Modal de Términos y Condiciones */
.terms-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.terms-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.terms-modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.8) translateY(20px);
  transition: transform 0.3s ease;
}

.terms-modal-overlay.show .terms-modal {
  transform: scale(1) translateY(0);
}

.terms-modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.terms-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

.terms-modal-content {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.terms-scroll-content {
  max-height: 50vh;
  overflow-y: auto;
  padding: 24px;
  line-height: 1.6;
  color: #374151;
}

.terms-scroll-content h2 {
  color: #007bff;
  font-size: 1.2rem;
  margin: 24px 0 12px 0;
  font-weight: 600;
}

.terms-scroll-content h2:first-child {
  margin-top: 0;
}

.terms-scroll-content p {
  margin-bottom: 16px;
  text-align: justify;
}

.terms-scroll-content ul {
  margin: 16px 0;
  padding-left: 20px;
}

.terms-scroll-content li {
  margin-bottom: 8px;
}

.terms-scroll-content .highlight {
  background-color: #f8f9fa;
  padding: 16px;
  border-left: 4px solid #007bff;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
}

.terms-modal-footer {
  padding: 20px 24px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 12px 12px;
}

.terms-checkbox-container {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
}

.terms-checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #007bff;
  cursor: pointer;
}

.terms-checkbox-container label {
  font-size: 0.95rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.terms-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.terms-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.terms-btn-cancel {
  background: #6b7280;
  color: white;
}

.terms-btn-cancel:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

.terms-btn-accept {
  background: #007bff;
  color: white;
}

.terms-btn-accept:hover:not(:disabled) {
  background: #0056b3;
  transform: translateY(-1px);
}

.terms-btn-accept:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* Scrollbar personalizada */
.terms-scroll-content::-webkit-scrollbar {
  width: 8px;
}

.terms-scroll-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.terms-scroll-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.terms-scroll-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
  .terms-modal {
    width: 95%;
    max-height: 95vh;
  }
  
  .terms-modal-header {
    padding: 20px 16px 12px;
  }
  
  .terms-modal-header h2 {
    font-size: 1.3rem;
  }
  
  .terms-scroll-content {
    padding: 16px;
    max-height: 45vh;
  }
  
  .terms-modal-footer {
    padding: 16px;
  }
  
  .terms-modal-buttons {
    flex-direction: column;
  }
  
  .terms-btn {
    width: 100%;
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .terms-modal {
    width: 98%;
    margin: 10px;
  }
  
  .terms-scroll-content {
    max-height: 40vh;
  }
  
  .terms-checkbox-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Animación de carga */
.terms-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: #6b7280;
}

.terms-loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

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

/* Prevenir scroll del body cuando el modal está abierto */
body.modal-open {
  overflow: hidden;
}