/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Comic Sans MS", cursive, sans-serif;
  font-size: 1.1rem;
  color: #333;
  overflow-x: hidden;
  background-image: url(../images/bg.png);
  background-size: cover;
  background-position: top center;
  background-attachment: scroll;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent;
  padding: 1rem 2rem;
  z-index: 1000;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.nav-links a:hover {
  color: #61bde4;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}

/* Auth Container */
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem 2rem;
  min-height: 100vh;
  overflow: visible;
}

.auth-box {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 3rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  overflow: visible;
}

.auth-title {
  font-size: 2.5rem;
  color: #144767;
  text-align: center;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tab Buttons */
.tab-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tab-btn {
  flex: 1;
  padding: 0.8rem;
  border: none;
  background: #e0e0e0;
  color: #666;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: "Comic Sans MS", cursive, sans-serif;
}

.tab-btn:hover {
  background: #d0d0d0;
}

.tab-btn.active {
  background: #61bde4;
  color: white;
  box-shadow: 0 4px 10px rgba(97, 189, 228, 0.3);
}

/* Form Container */
.form-container {
  display: none;
}

.form-container.active {
  display: block;
  animation: fadeIn 0.3s;
}

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

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
  overflow: visible;
}

.form-group label {
  display: block;
  color: #144767;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.form-group input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
  font-family: "Comic Sans MS", cursive, sans-serif;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #61bde4;
  box-shadow: 0 0 0 3px rgba(97, 189, 228, 0.1);
}

/* School/University autocomplete - professional dropdown */
.school-autocomplete {
  position: relative;
  width: 100%;
}

.school-autocomplete input {
  width: 100%;
  padding-right: 2.5rem;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

.school-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: none;
}

.school-dropdown.open {
  display: block;
  animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.school-dropdown-item {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
}

.school-dropdown-item:last-child {
  border-bottom: none;
}

.school-dropdown-item:hover,
.school-dropdown-item.highlighted {
  background: #e8f4fc;
  color: #144767;
}

.school-dropdown-empty {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}

/* Scrollbar for dropdown */
.school-dropdown::-webkit-scrollbar {
  width: 8px;
}

.school-dropdown::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 0 10px 10px 0;
}

.school-dropdown::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 4px;
}

.school-dropdown::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* Error Message */
.error-message {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
  padding: 0.8rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: none;
}

.error-message.show {
  display: block;
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Google Button */
.google-btn {
  width: 100%;
  padding: 0.9rem;
  border: 2px solid #ddd;
  background: white;
  color: #444;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: "Comic Sans MS", cursive, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.google-btn:hover {
  background: #f8f9fa;
  border-color: #4285F4;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
  transform: translateY(-2px);
}

.google-btn:active {
  transform: translateY(0);
}

.google-icon {
  flex-shrink: 0;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: #999;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #ddd;
}

.divider span {
  padding: 0 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Auth Button */
.auth-btn {
  width: 100%;
  padding: 1rem;
  border: none;
  background: linear-gradient(135deg, #61bde4 0%, #4a9dc7 100%);
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: "Comic Sans MS", cursive, sans-serif;
  box-shadow: 0 4px 15px rgba(97, 189, 228, 0.3);
}

.auth-btn:hover {
  background: linear-gradient(135deg, #4a9dc7 0%, #3d8ab5 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(97, 189, 228, 0.4);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.secondary-btn {
  margin-top: 0.75rem;
  background: #f1f1f1;
  color: #444;
  box-shadow: none;
}

.secondary-btn:hover {
  background: #e4e4e4;
  color: #333;
  transform: none;
  box-shadow: none;
}

.forgot-password-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

.forgot-password-link {
  border: none;
  background: transparent;
  color: #4a9dc7;
  font-family: "Comic Sans MS", cursive, sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.forgot-password-link:hover {
  color: #357da1;
}

/* Switch Text */
.switch-text {
  text-align: center;
  margin-top: 1.5rem;
  color: #666;
  font-size: 0.95rem;
}

.switch-text a {
  color: #61bde4;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.switch-text a:hover {
  color: #4a9dc7;
  text-decoration: underline;
}

/* Loading State */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 3rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: modalFadeIn 0.4s ease-out;
  overflow: visible;
}

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

.modal-content h2 {
  color: #144767;
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.modal-content p {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .auth-box {
    padding: 2rem;
    margin: 1rem;
  }

  .auth-title {
    font-size: 2rem;
  }

  .form-group input {
    font-size: 0.95rem;
  }

  .modal-content {
    padding: 2rem;
    margin: 1rem;
  }

  .modal-content h2 {
    font-size: 1.6rem;
  }

  .modal-content p {
    font-size: 1rem;
  }
}

