/**
 * AUTH MODAL STYLES
 * Enhanced UX for login/registration modal
 * Now using Bootstrap modal structure with custom styling
 */

/* Ensure modal is hidden by default */
#modalAuth {
  display: none;
}

/* When Bootstrap shows the modal, it will add .show class */
#modalAuth.show {
  display: block;
}

/* Override Bootstrap modal backdrop */
#modalAuth.modal .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* Modal dialog sizing */
#modalAuth .modal-dialog {
  max-width: 500px;
  margin: 1.75rem auto;
}

/* Modal content container */
#modalAuth .auth-modal-content {
  padding: 2rem;
  border-radius: 1rem;
  background: white;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: none;
}

/* Modal header */
.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.auth-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

.auth-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
}

/* Tabs container */
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.auth-tab {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  color: #6b7280;
  transition: all 0.2s ease;
}

.auth-tab.active {
  border-bottom-color: var(--razo-orange, #F97316);
  color: var(--razo-orange, #F97316);
}

/* Forms */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group:last-of-type {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Password input wrapper */
.password-input-wrapper {
  position: relative;
}

.password-input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  color: #6b7280;
  font-size: 1.25rem;
  transition: color 0.2s ease;
}

/* Submit button */
.auth-submit-btn {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--razo-orange, #F97316);
  border: none;
  border-radius: 0.5rem;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Input focus states with orange accent */
#modalAuth input:focus,
.form-control:focus {
  outline: none;
  border-color: var(--razo-orange, #F97316) !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Hover effect on inputs */
#modalAuth input:hover:not(:focus) {
  border-color: #9ca3af;
}

/* Tab hover effects */
#modalAuth .auth-tab:hover {
  background-color: rgba(249, 115, 22, 0.05);
}

/* Button hover effects */
#modalAuth button[type="submit"]:hover:not(:disabled) {
  background: #ea580c !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

#modalAuth button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

#modalAuth button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Password toggle button hover */
#modalAuth button[id^="toggle"]:hover {
  color: var(--razo-orange, #F97316);
}

/* Close button hover */
#btnCerrarAuthModal:hover {
  color: #dc2626;
  transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 576px) {
  #modalAuth .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  #modalAuth .auth-modal-content {
    padding: 1.5rem !important;
  }
  
  #modalAuth .auth-modal-title {
    font-size: 1.25rem !important;
  }
  
  #modalAuth input,
  #modalAuth button[type="submit"] {
    font-size: 0.95rem !important;
  }
}

/* Invalid input state */
#modalAuth input:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

#modalAuth input:valid:not(:placeholder-shown) {
  border-color: #10b981;
}
