:root {
  /* ADHD-Friendly Color Scheme */
  --primary-sage: rgb(89, 128, 89);
  --primary-green: rgb(140, 191, 140);
  --primary-mint: rgb(201, 230, 220);
  --secondary-lavender: rgb(220, 216, 235);
  --accent-blue: rgb(179, 217, 255);
  --accent-orange: rgb(255, 204, 128);
  --accent-progress: rgb(140, 179, 255);
  --bg-main: rgb(247, 248, 250);
  --bg-card: #ffffff;
  --bg-soft: rgb(220, 216, 235);
  --bg-section: rgb(201, 230, 220);
  
  --text-primary: rgb(64, 70, 80);
  --text-secondary: rgb(89, 128, 89);
  --text-light: rgb(140, 191, 140);
  --text-muted: rgb(220, 216, 235);
  --border-light: rgb(220, 216, 235);
  --border-medium: rgb(140, 191, 140);
  --shadow-soft: 0 1px 3px rgba(89, 128, 89, 0.1);
  --shadow-medium: 0 4px 6px rgba(89, 128, 89, 0.07);
  --shadow-large: 0 10px 15px rgba(89, 128, 89, 0.1);
  
  /* Modern gradients using the ADHD-friendly color scheme */
  --gradient-primary: linear-gradient(135deg, var(--primary-sage), var(--primary-green));
  --gradient-secondary: linear-gradient(135deg, var(--secondary-lavender), var(--primary-mint));
  --gradient-accent: linear-gradient(135deg, var(--accent-orange), var(--accent-blue));
  --gradient-purple: linear-gradient(135deg, var(--secondary-lavender), var(--accent-progress));
  
  /* Status colors using the ADHD-friendly palette */
  --status-success: rgb(140, 191, 140);
  --status-warning: rgb(255, 204, 128);
  --status-error: rgb(217, 220, 230);
  --status-info: rgb(179, 217, 255);
}


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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Login Container */
.login-container {
  width: 100%;
  max-width: 450px;
  padding: 20px;
  position: relative;
}

.login-card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 2px solid #d1d5db;
  padding: 40px;
  box-shadow: var(--shadow-large);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

/* Login Header */
.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.logo-image {
  height: 100px;
  width: auto;
  max-width: 250px;
  object-fit: contain;
  object-position: center;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.login-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Role Selection */
.role-selection {
  margin-bottom: 30px;
}

.role-tabs {
  display: flex;
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 4px;
  border: 2px solid var(--border-light);
}

.role-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.role-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-soft);
}

.role-tab:hover:not(.active) {
  color: var(--text-primary);
}

.role-icon {
  font-size: 1.2rem;
}

/* Form Styles */
.login-form {
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

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

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-medium);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(184, 212, 227, 0.1);
}

.form-input::placeholder {
  color: var(--text-light);
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

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

.checkbox-container input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-medium);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

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

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

.forgot-password {
  color: var(--primary-blue);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

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

/* Buttons */
.btn-login-submit,
.btn-signup-submit {
  width: 100%;
  padding: 14px 20px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-login-submit:hover,
.btn-signup-submit:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.btn-login-submit:disabled,
.btn-signup-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

/* Sign Up Section */
.signup-section {
  text-align: center;
  margin-bottom: 20px;
}

.signup-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.btn-signup {
  background: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-signup:hover {
  background: var(--primary-blue);
  color: white;
}

/* Back Home */
.back-home {
  text-align: center;
}

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text-primary);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  border: 2px solid #d1d5db;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-large);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.modal-header h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-soft);
  color: var(--text-primary);
}

.signup-form {
  margin-top: 20px;
}

.doctor-fields,
.patient-fields {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.terms-link {
  color: var(--primary-blue);
  text-decoration: none;
}

.terms-link:hover {
  text-decoration: underline;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top: 3px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-container {
    padding: 15px;
  }
  
  .login-card {
    padding: 30px 25px;
  }
  
  .modal-content {
    padding: 25px 20px;
    width: 95%;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .role-tab {
    padding: 12px 8px;
    font-size: 0.85rem;
  }
  
  .role-icon {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 25px 20px;
  }
  
  .login-title {
    font-size: 1.5rem;
  }
  
  .form-options {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
}
