/* auth-modal.css - Centralized styles for authentication modal */

/* Modal Overlay */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow: hidden;
  padding: 20px;
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.auth-modal-container {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 100%;
  max-height: 85vh;
  height: auto;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  margin: auto;
}

.auth-modal-overlay.active .auth-modal-container {
  transform: scale(1);
}

.auth-modal-header {
  padding: 25px 30px 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

.auth-modal-header h3 {
  margin: 0 0 0 0;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
}

.auth-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 5px;
  transition: all 0.3s ease;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

/* Form Stages */
.auth-form-stage {
  padding: 0;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-form-stage.active {
  display: block;
  opacity: 1;
}

/* Form Groups */
.auth-form-group {
  margin-bottom: 15px;
  padding: 0 30px;
}

.auth-form-stage.active .auth-form-group:first-child {
  padding-top: 25px;
}

.auth-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
}

.auth-form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.auth-form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 115, 230, 0.1);
}

.auth-form-group input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-form-group button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--primary);
  color: white;
}

.auth-form-group button:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 115, 230, 0.3);
}

.auth-form-group button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Error Messages */
.auth-error-message {
  color: #ef4444;
  font-size: 0.85rem;
  padding: 10px 30px;
  margin-bottom: 15px;
  background: #fee2e2;
  border-radius: 4px;
  border-left: 3px solid #ef4444;
}

/* Google Sign-In Button - PROMINENT */
.auth-google-button {
  width: calc(100% - 60px);
  margin: 15px 30px 0;
  padding: 12px 16px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text);
}

.auth-google-button:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.auth-google-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-google-button svg {
  width: 20px;
  height: 20px;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 30px;
  gap: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.auth-divider span {
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Toggle Links */
.auth-toggle {
  padding: 0 30px 25px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

.auth-toggle-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.auth-toggle-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .auth-modal-overlay {
    padding: 15px;
  }

  .auth-modal-container {
    max-height: calc(100vh - 30px);
  }

  .auth-modal-header {
    padding: 20px 20px 15px;
  }

  .auth-modal-header h3 {
    font-size: 1.2rem;
  }

  .auth-form-group {
    padding: 0 20px;
  }

  .auth-form-stage.active .auth-form-group:first-child {
    padding-top: 20px;
  }

  .auth-google-button {
    width: calc(100% - 40px);
    margin: 12px 20px 0;
    padding: 11px 14px;
    font-size: 0.95rem;
  }

  .auth-divider {
    margin: 15px 20px;
  }

  .auth-toggle {
    padding: 0 20px 20px;
  }
}

@media (max-width: 480px) {
  .auth-modal-header {
    padding: 16px 16px 12px;
  }

  .auth-modal-header h3 {
    font-size: 1.1rem;
  }

  .auth-form-group {
    padding: 0 16px;
    margin-bottom: 12px;
  }

  .auth-form-group input {
    padding: 11px;
    font-size: 16px; /* Prevents iOS zoom */
  }

  .auth-form-group button {
    padding: 11px;
    font-size: 0.95rem;
    min-height: 44px;
  }

  .auth-google-button {
    width: calc(100% - 32px);
    margin: 10px 16px 0;
    padding: 10px 12px;
  }

  .auth-divider {
    margin: 12px 16px;
    gap: 8px;
  }

  .auth-toggle {
    padding: 0 16px 16px;
    font-size: 0.85rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-modal-overlay.active .auth-modal-container {
  animation: fadeIn 0.3s ease;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .auth-modal-container {
    background: #1f2937;
    color: #f9fafb;
  }

  .auth-modal-header {
    border-bottom-color: #374151;
  }

  .auth-form-group label {
    color: #f3f4f6;
  }

  .auth-form-group input {
    background: #111827;
    border-color: #4b5563;
    color: #f9fafb;
  }

  .auth-form-group input::placeholder {
    color: #9ca3af;
  }

  .auth-form-group input:focus {
    border-color: #667eea;
  }

  .auth-error-message {
    background: #7f1d1d;
    color: #fecaca;
    border-left-color: #ef4444;
  }

  .auth-google-button {
    background: #111827;
    border-color: #4b5563;
    color: #f9fafb;
  }

  .auth-google-button:hover:not(:disabled) {
    background: #1f2937;
    border-color: #6b7280;
  }

  .auth-divider::before,
  .auth-divider::after {
    background: #4b5563;
  }

  .auth-divider span {
    color: #9ca3af;
  }

  .auth-toggle {
    color: #9ca3af;
  }

  .auth-toggle-link {
    color: #667eea;
  }

  .auth-toggle-link:hover {
    color: #5a6fd8;
  }
}
