/* auth.css - Authentication Page Styles */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-color-rgb: 37, 99, 235;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
}

/* Auth page layout */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-container {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-header {
  text-align: center;
  padding: 2rem 2rem 1rem;
}

.brand-logo {
  max-height: 60px;
  margin-bottom: 1rem;
}

.auth-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

/* Form styles */
.auth-form {
  padding: 0 2rem 2rem;
}

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

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

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

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(var(--primary-color-rgb) / 0.1);
}

.form-group input:invalid {
  border-color: var(--error-color);
}

/* Button styles */
.auth-button {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
  margin-bottom: 1rem;
}

.auth-button:hover {
  background: var(--primary-dark);
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-button:disabled:hover {
  background: var(--primary-color);
}

/* Message styles */
.message-container {
  padding: 0 2rem;
}

.error-message {
  background: #fef2f2;
  color: var(--error-color);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #fecaca;
  font-size: 0.875rem;
}

.success-message {
  background: #f0fdf4;
  color: var(--success-color);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #bbf7d0;
  font-size: 0.875rem;
}

.warning-message {
  background: #fffbeb;
  color: var(--warning-color);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #fed7aa;
  font-size: 0.875rem;
}

/* Auth links */
.auth-links {
  text-align: center;
  padding: 0 2rem 2rem;
}

.auth-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
  margin: 0 0.5rem;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Brand switcher */
.brand-switcher {
  margin: 1rem 2rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.brand-switcher > div:first-child {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.brand-option {
  display: inline-block;
  margin: 0 0.25rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.875rem;
  transition: all 0.15s ease-in-out;
}

.brand-option:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.brand-option.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading .auth-button {
  position: relative;
}

.loading .auth-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Password requirements */
.password-requirements {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.password-requirements ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.password-requirements li {
  margin: 0.25rem 0;
  transition: color 0.15s ease-in-out;
}

.requirement-met {
  color: var(--success-color);
}

.requirement-not-met {
  color: var(--error-color);
}

/* Responsive design */
@media (max-width: 480px) {
  .auth-container {
    margin: 1rem;
    border-radius: 0;
  }
  
  .auth-header,
  .auth-form,
  .auth-links,
  .message-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  .brand-switcher {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }
}

/* Print styles */
@media print {
  .auth-page {
    background: white;
  }
  
  .brand-switcher {
    display: none;
  }
}
