/* Authentication Modal Styles */

.auth-manager {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

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

.auth-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 8px;
  transition: all 0.2s ease;
  z-index: 1;
}

.auth-close-btn:hover {
  background: var(--background-light);
  color: var(--text);
}

.auth-content {
  padding: 0;
}

/* Auth Form Styles */

.auth-form {
  width: 100%;
}

.auth-form-container {
  padding: 40px 32px 32px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 16px;
}

.auth-form-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.2s ease;
  background: white;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.input-wrapper input.error {
  border-color: var(--danger-color);
}

.input-wrapper input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-wrapper .input-icon {
  position: absolute;
  right: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.password-input input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--background-light);
}

.password-toggle .hidden {
  display: none;
}

.checkbox-group {
  margin: 8px 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  padding: 4px;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px !important;
  height: 20px !important;
  border: 2px solid #374151 !important;
  border-radius: 6px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: white !important;
  flex-shrink: 0; /* Prevent checkbox from shrinking */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-width: 20px;
  min-height: 20px;
}

.checkbox-label:hover .checkbox-custom {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 98, 51, 0.1);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: "✓";
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.checkbox-text {
  color: #374151 !important;
  line-height: 1.4;
  font-weight: 500;
  font-size: 14px !important;
  display: inline-block !important;
}

.error-message {
  color: var(--danger-color);
  font-size: 14px;
  margin-top: 4px;
}

.general-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
}

.form-divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
}

.form-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.form-divider span {
  background: white;
  padding: 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.btn-full-width {
  width: 100%;
  justify-content: center;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.switch-auth {
  margin-top: 8px;
}

.forgot-password {
  text-align: center;
  margin-top: 16px;
}

.forgot-link {
  color: var(--primary-color);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Password Strength Indicator */

.password-strength {
  margin-top: 8px;
}

.password-strength-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.password-strength-bar {
  height: 4px;
  background: var(--background-light);
  border-radius: 2px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.password-strength-fill.weak {
  width: 33%;
  background: var(--danger-color);
}

.password-strength-fill.medium {
  width: 66%;
  background: #f59e0b;
}

.password-strength-fill.strong {
  width: 100%;
  background: var(--success-color);
}

/* Terms and Privacy */

.terms-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.terms-text a {
  color: var(--primary-color);
  text-decoration: none;
}

.terms-text a:hover {
  text-decoration: underline;
}

/* Responsive */

@media (max-width: 640px) {
  .auth-modal {
    max-width: none;
    margin: 0;
    border-radius: 0;
    height: 100%;
    max-height: none;
  }

  .auth-form-container {
    padding: 32px 24px;
  }

  .auth-header h2 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .auth-overlay {
    padding: 0;
  }

  .auth-form-container {
    padding: 24px 20px;
  }
}
