/* ===== AUTH LAYOUT ===== */

/* ===== BRAND & HERO ===== */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.brand-logo i {
  font-size: 2.5rem;
  color: #4ade80;
}

.brand-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.brand-logo span {
  color: #4ade80;
}

.hero-content h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.hero-content p {
  color: #d1d5db;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #d1d5db;
}

.feature-item i {
  color: #4ade80;
}

/* ===== SERVICE CARDS ===== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.service-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
}

.service-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.service-card i {
  font-size: 1.5rem;
}

/* ===== FORM STYLES ===== */
.form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.form-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #1f2937;
}

.form-header p {
  color: #6b7280;
}

/* Role Selector */
.role-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: #f9fafb;
  padding: 0.5rem;
  border-radius: 12px;
}

.role-btn {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6b7280;
}

.role-btn:hover {
  background: white;
  color: #4f46e5;
}

.role-btn.active {
  background: white;
  border-color: #4f46e5;
  color: #4f46e5;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.role-btn i {
  font-size: 1.25rem;
}

.role-btn span {
  font-size: 0.875rem;
  font-weight: 500;
}

/* Input Fields */
.input-group {
  margin-bottom: 1.5rem;
}

.input-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.input-field {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field i {
  position: absolute;
  left: 1rem;
  color: #9ca3af;
  pointer-events: none;
}

.input-field input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: white;
}

.input-field input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.password-toggle {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #4b5563;
}

.checkbox-label input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-label input:checked + .checkmark {
  background: #4f46e5;
  border-color: #4f46e5;
}

.checkbox-label input:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.text-link {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
}

.text-link:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  padding: 0.875rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: #4f46e5;
  color: white;
}

.btn-primary:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  border-color: #e5e7eb;
  color: #374151;
}

.btn-outline:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.btn-ghost {
  background: transparent;
  color: #4f46e5;
}

.btn-ghost:hover {
  background: #f5f3ff;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 2rem 0;
  color: #9ca3af;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.divider span {
  padding: 0 1rem;
  font-size: 0.875rem;
}

/* Social Login */
.social-login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn.google {
  border-color: #dc2626;
  color: #dc2626;
}

.btn.google:hover {
  background: #fef2f2;
}

.btn.facebook {
  border-color: #2563eb;
  color: #2563eb;
}

.btn.facebook:hover {
  background: #eff6ff;
}

/* Footer */
.auth-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.auth-footer p {
  color: #6b7280;
  margin-bottom: 1rem;
}

.link-primary {
  color: #4f46e5;
  font-weight: 500;
  text-decoration: none;
}

.link-primary:hover {
  text-decoration: underline;
}

/* ===== LOADING OVERLAY (FIXED) ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loading-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto; /* Allow interaction with cancel button */
}

.loading-content {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #4f46e5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: #374151;
  margin-bottom: 1rem;
  font-weight: 500;
}

.cancel-btn {
  margin-top: 0.5rem;
}

/* ===== MESSAGES ===== */
.messages-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  max-width: 400px;
}

.alert {
  padding: 1rem 1.5rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  display: none;
  animation: slideInRight 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-error {
  background: #fef2f2;
  border: 2px solid #fecaca;
  color: #dc2626;
}

.alert-success {
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  color: #16a34a;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .auth-container {
    grid-template-columns: 1fr;
  }
  
  .auth-left {
    display: none;
  }
  
  .auth-right {
    padding: 2rem;
  }
}

@media (max-width: 640px) {
  .role-selector {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .social-login {
    grid-template-columns: 1fr;
  }
  
  .service-grid {
    grid-template-columns: 1fr;
  }
}
/* Error states */
.invalid {
    border-color: #ef4444 !important;
}

/* Role button states */
.role-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading overlay cancel button */
.cancel-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Message animations */
.alert {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive fixes */
@media (max-width: 640px) {
    .loading-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .messages-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}
