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

:root {
  --primary-color: #0066cc;
  --primary-hover: #0052a3;
  --error-color: #dc3545;
  --success-color: #28a745;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --border-color: #dee2e6;
  --shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  --shadow-lg: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.login-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 100vh;
}

.login-card {
  background: var(--card-bg);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  padding: 3rem;
  width: 100%;
  max-width: 400px;
}

.logo-container {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  height: 40px;
  width: auto;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;
}

.subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.login-form {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0,102,204,0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  position: relative;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
  width: 100%;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #5a6268;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.loader {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-primary .loader {
  border-color: rgba(255,255,255,0.3);
  border-top-color: white;
}

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

.hidden {
  display: none !important;
}

.help-section {
  text-align: center;
  color: var(--text-secondary);
}

.help-section a {
  color: var(--primary-color);
  text-decoration: none;
}

.help-section a:hover {
  text-decoration: underline;
}

.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 0.5rem;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 1rem;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.practice-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.practice-item {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  background: var(--card-bg);
}

.practice-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.practice-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.practice-code {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Error page styles */
.error-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.error-container h1 {
  font-size: 5rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.error-container p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Signup Styles */
.signup-card {
  max-width: 480px;
}

.signup-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background-color: var(--bg-color);
  padding: 0.25rem;
  border-radius: 0.375rem;
}

.tab-button {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease-in-out;
}

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

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

.signup-form {
  margin-bottom: 1.5rem;
}

.form-help {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.divider {
  position: relative;
  text-align: center;
  margin: 2rem 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.divider span {
  position: relative;
  padding: 0 1rem;
  background: var(--card-bg);
  color: var(--text-secondary);
}

.btn-google {
  width: 100%;
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.btn-google:hover {
  background: var(--bg-color);
  border-color: var(--text-secondary);
}

.google-icon {
  width: 20px;
  height: 20px;
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

input[type="checkbox"] {
  margin-right: 0.5rem;
}

.form-group label {
  display: flex;
  align-items: flex-start;
  font-weight: normal;
  cursor: pointer;
}

.form-group label input[type="checkbox"] {
  margin-top: 0.25rem;
}

.btn-text {
  display: inline-block;
}

/* Passkey button */
.btn-passkey {
  width: 100%;
  background: var(--text-primary);
  color: white;
  margin-bottom: 1rem;
}

.btn-passkey:hover {
  background: #343a40;
}

.passkey-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Responsive */
@media (max-width: 640px) {
  .login-card {
    padding: 2rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .signup-tabs {
    flex-direction: column;
  }
}