:root {
  --bg-gradient-start: #1a73e8;
  --bg-gradient-end: #4285f4;
  --card-bg: #ffffff;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --input-border: #dadce0;
  --input-focus: #1a73e8;
  --button-bg: #1a73e8;
  --button-hover: #1557b0;
  --link-color: #1a73e8;
  --shadow: rgba(60, 64, 67, 0.3);
  --shadow-hover: rgba(60, 64, 67, 0.15);
}

[data-theme="dark"] {
  --bg-gradient-start: #1f1f1f;
  --bg-gradient-end: #2d2d2d;
  --card-bg: #2d2d2d;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --input-border: #5f6368;
  --input-focus: #8ab4f8;
  --button-bg: #8ab4f8;
  --button-hover: #aecbfa;
  --link-color: #8ab4f8;
  --shadow: rgba(0, 0, 0, 0.5);
  --shadow-hover: rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  font-family: 'Google Sans', 'Roboto', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  border: 1px solid var(--input-border);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px var(--shadow);
  z-index: 1000;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  box-shadow: 0 2px 8px var(--shadow-hover);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  fill: var(--text-primary);
}

.auth-box {
  background: var(--card-bg);
  padding: 48px 40px;
  border-radius: 8px;
  box-shadow: 0 1px 3px var(--shadow), 0 4px 8px var(--shadow-hover);
  width: 100%;
  max-width: 450px;
  animation: fadeIn 0.4s ease;
}

.auth-box h2 {
  margin-bottom: 24px;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 400;
  text-align: center;
}

.auth-box input[type="text"],
.auth-box input[type="email"],
.auth-box input[type="password"],
.auth-box input[type="number"],
.auth-box input[type="department"] {
  width: 100%;
  padding: 14px 16px;
  margin: 8px 0;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--card-bg);
  outline: none;
  transition: border-color 0.2s ease;
}

.auth-box input:focus {
  border-color: var(--input-focus);
  border-width: 2px;
  padding: 13px 15px;
}

.auth-box input::placeholder {
  color: var(--text-secondary);
}

.forgot-password {
  color: var(--link-color);
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.forgot-password:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.auth-box button[type="submit"] {
  margin-top: 16px;
  padding: 12px 24px;
  width: 100%;
  border: none;
  border-radius: 4px;
  background: var(--button-bg);
  color: white;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.25px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  text-transform: uppercase;
}

.auth-box button[type="submit"]:hover {
  background: var(--button-hover);
  box-shadow: 0 1px 2px var(--shadow), 0 2px 6px var(--shadow-hover);
}

.auth-box button[type="submit"]:active {
  transform: scale(0.98);
}

.auth-box select {
  width: 100%;
  padding: 14px 16px;
  margin: 8px 0;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  font-size: 16px;
  background: var(--card-bg);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

.auth-box select:focus {
  border-color: var(--input-focus);
  border-width: 2px;
  padding: 13px 15px;
}

.toggle {
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

.toggle a {
  color: var(--link-color);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.toggle a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Password Wrapper with Eye Icon */
.password-wrapper {
  position: relative;
  margin: 8px 0;
}

.password-wrapper input {
  width: 100%;
  padding-right: 48px;
  margin: 0;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

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

.toggle-password svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Checkbox Wrapper */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 12px 0;
  gap: 8px;
}

.checkbox-wrapper label {
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  order: 1;
}

.checkbox-wrapper input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--input-border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  outline: none;
  transition: all 0.2s ease;
  order: 2;
  margin: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked {
  background-color: var(--button-bg);
  border-color: var(--button-bg);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-wrapper input[type="checkbox"]:hover {
  border-color: var(--input-focus);
}

/* reCAPTCHA spacing */
.g-recaptcha {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}

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

/* Responsive */
@media (max-width: 480px) {
  .auth-box {
    padding: 32px 24px;
  }
  
  .theme-toggle {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
}

/* Social Login Buttons */
.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.social-btn:hover {
  background: var(--input-border);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

.social-btn svg {
  flex-shrink: 0;
}

.google-btn:hover {
  border-color: #4285F4;
}

.facebook-btn:hover {
  border-color: #1877F2;
}

/* Modern Checkbox Styles */
.modern-checkbox-wrapper {
  display: flex;
  align-items: center;
  margin: 16px 0;
}

.modern-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.modern-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.modern-checkbox .checkmark {
  position: relative;
  height: 20px;
  width: 20px;
  background-color: var(--card-bg);
  border: 2px solid var(--input-border);
  border-radius: 4px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.modern-checkbox:hover .checkmark {
  border-color: var(--input-focus);
}

.modern-checkbox input[type="checkbox"]:checked ~ .checkmark {
  background-color: var(--button-bg);
  border-color: var(--button-bg);
}

.modern-checkbox .checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.modern-checkbox input[type="checkbox"]:checked ~ .checkmark:after {
  display: block;
  animation: checkmark 0.3s ease;
}

.modern-checkbox .checkbox-label {
  margin-left: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
}

.modern-checkbox input[type="checkbox"]:focus ~ .checkmark {
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

@keyframes checkmark {
  0% {
    height: 0;
  }
  100% {
    height: 10px;
  }
}
