/* Modern Login/Signup Styles - DarkReader Compatible */
:root {
  --primary-blue: #3996fb;
  --primary-blue-dark: #2b7de1;
  --primary-blue-light: #e8f3ff;
  --error-red: #ef4444;
  --success-green: #10b981;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
  --bg-light: #f9fafb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.6;
}

.form {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  max-width: 440px;
  width: 100%;
  padding: 48px 40px;
  margin: 20px auto;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.text-center {
  text-align: center;
}

.text-center-ai {
  text-align: center;
  font-size: 18px;
  margin: 0 auto 30px;
  max-width: 440px;
  color: white;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 20px 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.text-center-ai .emoji {
  font-size: 24px;
  margin-right: 8px;
}

/* Form Groups */
.form-group {
  position: relative;
  margin-bottom: 28px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  outline: none;
  background: white;
  transition: all 0.3s ease;
  font-family: inherit;
  color: var(--text-dark);
}

.form-group input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
  top: -10px;
  left: 12px;
  font-size: 12px;
  color: var(--primary-blue);
  background: white;
  padding: 0 6px;
  font-weight: 600;
}

.form-group label {
  position: absolute;
  left: 16px;
  top: 15px;
  color: var(--text-light);
  font-size: 15px;
  pointer-events: none;
  transition: all 0.3s ease;
  background: transparent;
}

/* Captcha Question */
#captcha-question {
  display: block;
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 15px;
}

/* Buttons */
button {
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  letter-spacing: 0.3px;
}

#register-button {
  background: var(--primary-blue);
  color: white;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px 0 rgba(57, 150, 251, 0.39);
}

#register-button:hover:not(:disabled) {
  background: var(--primary-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(57, 150, 251, 0.5);
}

#register-button:active:not(:disabled) {
  transform: translateY(0);
}

#register-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Google Sign-in Button */
.google-sign-in-button {
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 14px 16px 14px 48px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  color: var(--text-dark);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTcuNiA5LjJsLS4xLTEuOEg5djMuNGg0LjhDMTMuNiAxMiAxMyAxMyAxMiAxMy42djIuMmgzYTguOCA4LjggMCAwIDAgMi42LTYuNnoiIGZpbGw9IiM0Mjg1RjQiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik05IDE4YzIuNCAwIDQuNS0uOCA2LTIuMmwtMy0yLjJhNS40IDUuNCAwIDAgMS04LTIuOUgxVjEzYTkgOSAwIDAgMCA4IDV6IiBmaWxsPSIjMzRBODUzIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNNCAxMC43YTUuNCA1LjQgMCAwIDEgMC0zLjRWNUgxYTkgOSAwIDAgMCAwIDhsMy0yLjN6IiBmaWxsPSIjRkJCQzA1IiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48cGF0aCBkPSJNOSAzLjZjMS4zIDAgMi41LjQgMy40IDEuM0wxNSAyLjNBOSA5IDAgMCAwIDEgNWwzIDIuNGE1LjQgNS40IDAgMCAxIDUtMy43eiIgZmlsbD0iI0VBNDMzNSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PHBhdGggZD0iTTAgMGgxOHYxOEgweiIvPjwvZz48L3N2Zz4=);
  background-color: white;
  background-repeat: no-repeat;
  background-position: 16px center;
}

.google-sign-in-button:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--primary-blue-light);
  transform: translateY(-2px);
}

.google-sign-in-button:active {
  transform: translateY(0);
  background-color: var(--bg-light);
}

/* Divider */
.divider {
  text-align: center;
  margin: 32px 0;
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* Links */
.link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

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

p {
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-light);
}

/* Spinner */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  margin-left: 10px;
}

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

/* Notifications */
.alert {
  position: fixed;
  top: 20px;
  right: 20px;
  left: 20px;
  max-width: 500px;
  margin: 0 auto;
  padding: 16px 20px;
  background-color: var(--error-red);
  color: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 1;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert.success {
  background-color: var(--success-green);
}

.alert.info {
  background-color: #3b82f6;
}

.alert.warning {
  background-color: #f59e0b;
}

.closebtn {
  color: white;
  font-weight: bold;
  font-size: 24px;
  line-height: 20px;
  cursor: pointer;
  transition: 0.3s;
  opacity: 0.8;
  margin-left: 16px;
  flex-shrink: 0;
}

.closebtn:hover {
  opacity: 1;
}

#error-notification,
#success-notification {
  display: none;
}

/* Responsive Design */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .form {
    padding: 32px 24px;
  }

  header h1 {
    font-size: 24px;
  }

  .text-center-ai {
    font-size: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
  }

  .alert {
    top: 10px;
    right: 10px;
    left: 10px;
    font-size: 14px;
    padding: 14px 16px;
  }
}

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

.form {
  animation: fadeInUp 0.5s ease;
}

/* Focus visible for accessibility */
button:focus-visible,
.google-sign-in-button:focus-visible,
.link:focus-visible {
  outline: 3px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Additional helper for floating labels in dark mode */
.form-group input:not(:placeholder-shown) + label,
.form-group input:focus + label {
  /* DarkReader will automatically adjust these colors */
  background: white;
}

/* Ensure good contrast for DarkReader */
.form {
  /* DarkReader will transform this automatically */
  background: #ffffff;
}

.form-group input {
  /* Ensure DarkReader can properly invert these */
  background-color: #ffffff;
  border-color: #e5e7eb;
}

/* Make sure the transition is smooth when DarkReader activates */
* {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Override transitions for animations that should stay fast */
.spinner,
button,
.google-sign-in-button,
.link,
.alert,
.form {
  transition: all 0.3s ease;
}

.form-group input,
.form-group label {
  transition: all 0.3s ease;
}