/* Auth Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: 8px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  position: relative;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-actions {
  padding: 0 24px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 4px;
}

/* Auth Modal Specific Styles */
.auth-modal .modal {
  max-width: 460px;
  transition: max-height 0.3s ease-out;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  margin: 0;
  padding: 0;
}

.auth-tab {
  flex: 1;
  padding: 20px;
  text-align: center;
  background: none;
  border: none;
  font-size: 16px;
  color: #6b7280;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  font-weight: 500;
}

.auth-tab:hover {
  color: #374151;
}

.auth-tab.active {
  color: #111827;
  font-weight: 600;
}

.auth-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #3b82f6;
}

.auth-content {
  padding: 32px 24px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
  text-align: center;
}

.auth-subtitle {
  color: #6b7280;
  font-size: 14px;
  text-align: center;
  margin-bottom: 24px;
}

.auth-subtitle a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.auth-subtitle a:hover {
  text-decoration: underline;
}

.account-type-selector {
  margin-bottom: 12px;
}

.account-type-label {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 500;
}

.account-type-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.account-type-btn {
  padding: 16px;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.account-type-btn:hover {
  border-color: #3b82f6;
  background: #f9fafb;
}

.account-type-btn.selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.account-type-btn i {
  color: #6b7280;
}

.account-type-btn svg {
  stroke: #6b7280 !important;
}

.account-type-btn.selected i {
  color: #3b82f6;
}

.account-type-btn.selected svg {
  stroke: #3b82f6 !important;
}

.account-type-btn span {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.account-type-warning {
  background: #eff6ff;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 20px;
  display: none;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #1e40af;
}

.account-type-warning.show {
  display: flex;
}

.account-type-warning i {
  flex-shrink: 0;
  margin-top: 1px;
}

.form-label {
  font-size: 14px;
  color: #374151;
  margin-bottom: 6px;
  display: block;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error {
  border-color: #ef4444;
}

.input-error-message {
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.input-error-message.show {
  display: block;
}

.general-error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 16px;
  color: #991b1b;
  font-size: 13px;
  display: none;
  align-items: center;
  gap: 8px;
}

.general-error-message.show {
  display: flex;
}

.general-error-message i {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.password-input-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
}

.toggle-password:hover {
  color: #374151;
}

.forgot-password-link {
  text-align: right;
  margin-top: 8px;
  margin-bottom: -8px;
}

.forgot-password-link a {
  color: #3b82f6;
  font-size: 13px;
  text-decoration: none;
}

.forgot-password-link a:hover {
  text-decoration: underline;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
}

.checkbox-group label {
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-group label a {
  color: #3b82f6;
  text-decoration: none;
}

.checkbox-group label a:hover {
  text-decoration: underline;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 16px;
}

.auth-submit-btn:hover {
  background: #2563eb;
}

.auth-submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.registration-fields {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease-out;
}

.registration-fields.show {
  max-height: 600px;
  opacity: 1;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Success View Styles */
#success-view .auth-content {
  text-align: center;
  padding: 40px 24px;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  background: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon i {
  color: white;
  width: 32px;
  height: 32px;
}

/* Password Reset Sent View Styles */
#password-reset-sent-view .auth-content {
  text-align: center;
}

#password-reset-sent-view .success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  background: #eff6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#password-reset-sent-view .success-icon i {
  color: #3b82f6;
  width: 32px;
  height: 32px;
}

.password-reset-info {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
  margin: 16px 0;
}

.password-reset-steps {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 16px;
  margin: 24px 0;
  text-align: left;
}

.password-reset-steps-title {
  font-size: 13px;
  margin: 0 0 12px 0;
  font-weight: 500;
}

.password-reset-steps-title i {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: text-bottom;
  margin-right: 6px;
  color: #3b82f6;
}

.password-reset-steps ul {
  font-size: 13px;
  margin: 0;
  padding-left: 24px;
  list-style-type: disc;
}

.password-reset-steps ul li {
  margin-bottom: 6px;
}

.password-reset-steps ul li:last-child {
  margin-bottom: 0;
}

#resendContainer p {
  color: #6b7280;
  font-size: 16px;
  font-weight: 500;
}

#resendEmailBtn {
  background: white;
  color: #3b82f6;
  border: 1px solid #3b82f6;
}

#resendTimer {
  display: none;
  color: #6b7280;
  font-size: 13px;
  margin-top: 12px;
}

/* Back to login link styles */
.back-to-login {
  margin-top: 24px;
}

.back-to-login a {
  color: #6b7280;
  font-size: 14px;
  text-decoration: none;
}

.back-to-login i {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: text-bottom;
  margin-right: 4px;
}

/* Forgot password view back link */
#forgot-password-view .back-link {
  text-align: center;
  margin-top: 16px;
  margin-bottom: 4px;
}

#forgot-password-view .back-link a {
  color: #6b7280;
  font-size: 14px;
  text-decoration: none;
}

#forgot-password-view .back-link i {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: text-bottom;
  margin-right: 4px;
}

/* Feather icon alignment fix for inline text */
.password-reset-steps-title svg.feather,
.back-to-login svg.feather,
#forgot-password-view .back-link svg.feather {
  display: inline-block;
  vertical-align: text-bottom;
  position: relative;
  top: 2px;
}

#termsError {
  margin-top: -8px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .modal {
    max-width: 100%;
    margin: 20px;
    max-height: calc(100vh - 40px);
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .auth-modal .modal {
    max-width: calc(100% - 40px);
  }
}
