/* Authentication Page Styles */

.auth-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg-colour) 0%, #0a0e13 100%);
}

.auth-container {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

.auth-form-container {
  background: var(--surface-colour);
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(61, 169, 252, 0.1);
}

.auth-form-container h2 {
  color: var(--accent-colour);
  font-size: 2rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-form-container p {
  color: #8b949e;
  text-align: center;
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.form-group label {
  color: var(--text-colour);
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-group input {
  padding: 0.75rem;
  border: 2px solid #21262d;
  border-radius: var(--border-radius);
  background: #0d1117;
  color: var(--text-colour);
  font-size: 1rem;
  transition: all var(--transition-speed);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-colour);
  box-shadow: 0 0 0 3px rgba(61, 169, 252, 0.1);
}

.form-group input:invalid {
  border-color: #da3633;
}

.password-requirements {
  margin-top: 0.25rem;
}

.password-requirements small {
  color: #8b949e;
  font-size: 0.8rem;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.5rem 0;
}

.checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-colour);
}

.checkbox-container input[type="checkbox"] {
  opacity: 0;
  position: absolute;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #21262d;
  border-radius: 3px;
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
  background: var(--accent-colour);
  border-color: var(--accent-colour);
}

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

.forgot-password {
  color: var(--accent-colour);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-speed);
}

.forgot-password:hover {
  color: var(--accent-colour-light);
}

.auth-btn {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.auth-btn.primary {
  background: var(--accent-colour);
  color: white;
}

.auth-btn.primary:hover {
  background: var(--accent-colour-light);
  transform: translateY(-1px);
}

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

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.auth-switch {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #21262d;
}

.auth-switch p {
  color: #8b949e;
  margin: 0;
}

.auth-switch a {
  color: var(--accent-colour);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  color: var(--accent-colour-light);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-spinner {
  text-align: center;
  color: var(--text-colour);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #21262d;
  border-top: 3px solid var(--accent-colour);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Message Overlay */
.message-overlay {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  animation: slideIn 0.3s ease-out;
}

.message-content {
  background: var(--surface-colour);
  color: var(--text-colour);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border-left: 4px solid var(--accent-colour);
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 400px;
}

.message-content.error {
  border-left-color: #da3633;
}

.message-content.success {
  border-left-color: #28a745;
}

.message-close {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.message-close:hover {
  color: var(--text-colour);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .auth-section {
    padding: 1rem;
  }
  
  .auth-form-container {
    padding: 2rem 1.5rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .message-overlay {
    top: 10px;
    right: 10px;
    left: 10px;
  }
}

/* Focus and validation states */
.form-group input:focus:valid {
  border-color: #28a745;
}

.form-group input:focus:invalid {
  border-color: #da3633;
}

.form-group.error input {
  border-color: #da3633;
}

.form-group.success input {
  border-color: #28a745;
}

.form-group .error-message {
  color: #da3633;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Animation for form switching */
.auth-form-container {
  transition: opacity 0.3s ease-in-out;
}

.auth-form-container.fade-out {
  opacity: 0;
}

.auth-form-container.fade-in {
  opacity: 1;
}

/* Enhanced Registration Styles - Matching Desktop App */
.field-hint {
  color: #8b949e;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

.password-requirements {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: var(--border-radius);
  padding: 1rem;
  margin: 1rem 0;
}

.password-requirements h4 {
  color: var(--text-colour);
  font-size: 0.9rem;
  margin: 0 0 0.75rem 0;
  font-weight: 500;
}

.password-requirements ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.password-requirements li {
  padding: 0.25rem 0;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  transition: color var(--transition-speed);
}

.password-requirements li::before {
  content: "○";
  margin-right: 0.5rem;
  font-size: 0.6rem;
  transition: all var(--transition-speed);
}

.password-requirements li.valid {
  color: #28a745;
}

.password-requirements li.valid::before {
  content: "●";
  color: #28a745;
}

.password-requirements li.invalid {
  color: #8b949e;
}

/* Validation States */
.form-group.valid input {
  border-color: #28a745;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.form-group.error input {
  border-color: #da3633;
  box-shadow: 0 0 0 3px rgba(218, 54, 51, 0.1);
}

.form-group.valid input:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

.form-group.error input:focus {
  border-color: #da3633;
  box-shadow: 0 0 0 3px rgba(218, 54, 51, 0.2);
}

/* Username validation indicator */
.form-group.valid label::after {
  content: " ✓";
  color: #28a745;
  font-weight: bold;
}

.form-group.error label::after {
  content: " ✗";
  color: #da3633;
  font-weight: bold;
}

/* Student Registration Form Styles */
.auth-container {
  max-width: 600px; /* Wider for student form */
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.75rem;
  border: 2px solid #21262d;
  border-radius: var(--border-radius);
  background: #0d1117;
  transition: all var(--transition-speed);
  margin: 0;
}

.radio-label:hover {
  border-color: #30363d;
  background: #161b22;
}

.radio-label input[type="radio"] {
  margin: 0;
  margin-right: 0.75rem;
  width: auto;
  padding: 0;
}

.radio-label input[type="radio"]:checked {
  accent-color: var(--accent-colour);
}

.radio-label:has(input:checked) {
  border-color: var(--accent-colour);
  background: rgba(61, 169, 252, 0.1);
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #21262d;
  border-radius: 50%;
  margin-right: 0.75rem;
  position: relative;
  transition: all var(--transition-speed);
  flex-shrink: 0;
}

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

.radio-label input[type="radio"]:checked + .radio-custom::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.checkbox-group {
  margin: 1rem 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-colour);
  margin: 0;
  gap: 0.75rem;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  opacity: 0;
  position: absolute;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #21262d;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
  flex-shrink: 0;
  margin-top: 2px;
}

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

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

.form-group select {
  padding: 0.75rem;
  border: 2px solid #21262d;
  border-radius: var(--border-radius);
  background: #0d1117;
  color: var(--text-colour);
  font-size: 1rem;
  transition: all var(--transition-speed);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9d1d9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  padding-right: 3rem;
}

.form-group select:focus {
  outline: none;
  border-color: var(--accent-colour);
  box-shadow: 0 0 0 3px rgba(61, 169, 252, 0.1);
}

.form-group textarea {
  padding: 0.75rem;
  border: 2px solid #21262d;
  border-radius: var(--border-radius);
  background: #0d1117;
  color: var(--text-colour);
  font-size: 1rem;
  transition: all var(--transition-speed);
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-colour);
  box-shadow: 0 0 0 3px rgba(61, 169, 252, 0.1);
}

.form-group input[type="file"] {
  padding: 0.5rem;
  border: 2px dashed #21262d;
  border-radius: var(--border-radius);
  background: #0d1117;
  color: var(--text-colour);
  font-size: 1rem;
  transition: all var(--transition-speed);
  cursor: pointer;
}

.form-group input[type="file"]:hover {
  border-color: var(--accent-colour);
  background: rgba(61, 169, 252, 0.05);
}

.form-group input[type="file"]:focus {
  outline: none;
  border-color: var(--accent-colour);
  box-shadow: 0 0 0 3px rgba(61, 169, 252, 0.1);
}

.file-tip {
  font-size: 0.85rem;
  color: #8b949e;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: var(--border-radius);
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.student-info-box {
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-group small {
  color: #8b949e;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: block;
}

.form-group input[readonly] {
  background: #21262d;
  color: #8b949e;
  cursor: not-allowed;
}

.full-width {
  width: 100%;
}

.form-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #21262d;
}

.form-footer p {
  color: #8b949e;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-footer a {
  color: var(--accent-colour);
  text-decoration: none;
  transition: color var(--transition-speed);
}

.form-footer a:hover {
  color: var(--accent-colour-light);
}

/* hCaptcha styling adjustments */
.h-captcha {
  margin: 1rem 0;
  display: flex;
  justify-content: center;
}

/* Responsive adjustments for student form */
@media (max-width: 768px) {
  .auth-container {
    max-width: 100%;
  }
  
  .radio-label {
    padding: 0.5rem;
    font-size: 0.85rem;
  }
  
  .checkbox-label {
    font-size: 0.85rem;
  }
}