/* Auth screens - login, forgot password, reset */
/* =============================================
     AUTH SCREENS (Login, Forgot Password, Reset)
     ============================================= */

.auth-screen {
  display: none;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f9ff 0%, #f0fdf4 50%, #fefce8 100%);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-screen.active {
  display: flex;
}

.auth-card {
  background: white;
  border-radius: 20px;
  box-shadow:
    0 20px 60px rgba(15, 23, 42, 0.12),
    0 8px 20px rgba(15, 23, 42, 0.08);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  overflow: hidden;
}

.auth-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-logo-icon-fallback {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(102, 187, 106, 0.25), rgba(179, 229, 252, 0.6));
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: rgba(15, 23, 42, 0.85);
}

.auth-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 28px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
  color: var(--text);
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: white;
}

.auth-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-input-wrap .toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 10px;
  line-height: 0;
  display: flex;
  align-items: center;
}

.auth-input-wrap .toggle-password:hover {
  color: var(--text);
}

.auth-input-wrap .toggle-password:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.auth-error {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #dc2626;
  font-size: 14px;
  line-height: 1.4;
}

.auth-error.visible {
  display: flex;
}

.auth-error-icon {
  flex-shrink: 0;
}

.auth-success {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  color: #16a34a;
  font-size: 14px;
  line-height: 1.4;
}

.auth-success.visible {
  display: flex;
}

.auth-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.auth-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.auth-link {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

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

.auth-btn {
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn:hover {
  background: #1d4ed8;
}

.auth-btn:active {
  transform: scale(0.98);
}

.auth-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

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

.auth-btn .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.auth-btn.loading .spinner {
  display: block;
}

.auth-btn.loading .btn-text {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 20px;
}

.auth-back-link:hover {
  color: var(--accent);
}

.password-strength {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin-top: 8px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition:
    width 0.3s,
    background 0.3s;
}

.password-strength-bar.weak {
  width: 33%;
  background: #ef4444;
}
.password-strength-bar.medium {
  width: 66%;
  background: #f59e0b;
}
.password-strength-bar.strong {
  width: 100%;
  background: #22c55e;
}

.password-hint {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}
