:root {
  --auth-surface: #1a2332;
  --auth-surface-raised: #222d3f;
  --auth-brand: #3b6cb5;
  --auth-brand-hover: #4a7ec8;
  --auth-brand-light: #2a5298;
  --auth-title: #f1f5f9;
  --auth-text: #cbd5e1;
  --auth-border: rgba(255, 255, 255, 0.1);
  --auth-muted: #94a3b8;
  --auth-bg-start: #0f172a;
  --auth-radius: 12px;
  --auth-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --auth-focus-ring: 0 0 0 3px rgba(59, 108, 181, 0.35);
  --auth-card-width: 480px;
}

@keyframes authBackgroundZoom {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@keyframes authBtnGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--auth-text);
  background: var(--auth-bg-start);
}

.auth-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.auth-background__image {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-image: var(--auth-bg-image);
  background-size: cover;
  background-position: center;
  animation: authBackgroundZoom 28s ease-in-out infinite alternate;
  will-change: transform;
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem 1rem;
}

.auth-shell__inner {
  width: 100%;
  max-width: var(--auth-card-width);
}

.auth-shell__messages {
  margin-bottom: 1rem;
}

.auth-card {
  width: 100%;
  max-width: var(--auth-card-width);
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 2rem;
}

.auth-card__logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 2.75rem;
  margin: 0 auto 1.5rem;
  object-fit: contain;
}

.auth-card__title {
  color: var(--auth-title);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 0.375rem;
}

.auth-card__subtitle {
  color: var(--auth-muted);
  font-size: 0.9rem;
  text-align: center;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.auth-card__section-title {
  color: var(--auth-title);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.auth-card__body {
  color: var(--auth-text);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.auth-card__body p:last-child {
  margin-bottom: 0;
}

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

.auth-form-group label,
.auth-card .form-label {
  color: var(--auth-title);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.auth-input,
.auth-card .form-control {
  border-radius: 8px;
  border: 1px solid var(--auth-border);
  background: var(--auth-surface-raised);
  color: var(--auth-title);
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-card .form-control::placeholder {
  color: #64748b;
}

.auth-input:focus,
.auth-card .form-control:focus {
  border-color: var(--auth-brand);
  background: var(--auth-surface-raised);
  color: var(--auth-title);
  box-shadow: var(--auth-focus-ring);
  outline: none;
}

.auth-input-group .form-control {
  border-radius: 8px 0 0 8px;
}

.auth-input-append {
  border-radius: 0 8px 8px 0;
  border: 1px solid var(--auth-border);
  border-left: none;
  background: var(--auth-surface-raised);
  color: var(--auth-muted);
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.auth-input-append:hover {
  background: #2a3548;
}

.auth-card .form-text,
.auth-card .text-muted,
.auth-card .helptext,
.auth-card small.text-muted {
  color: var(--auth-muted) !important;
}

.auth-btn-primary {
  display: inline-block;
  width: 100%;
  background: var(--auth-brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.625rem 1rem;
  transition: background 0.2s;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.auth-btn-primary:hover,
.auth-btn-primary:focus {
  background: var(--auth-brand-hover);
  color: #fff;
  text-decoration: none;
}

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

.auth-btn-primary--animated {
  background: linear-gradient(135deg, #22447b, #2a5298, #3b6cb5, #22447b);
  background-size: 300% 300%;
  animation: authBtnGradient 6s ease infinite;
}

.auth-btn-primary--animated:hover,
.auth-btn-primary--animated:focus {
  background: linear-gradient(135deg, #2a5298, #3b6cb5, #4a7ec8, #2a5298);
  background-size: 300% 300%;
  color: #fff;
}

.auth-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: transparent;
  color: var(--auth-text);
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.625rem 1rem;
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.auth-btn-secondary:hover,
.auth-btn-secondary:focus {
  background: var(--auth-surface-raised);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--auth-title);
  text-decoration: none;
}

.auth-providers {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.auth-provider-item {
  margin: 0;
}

.auth-provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  border: 1px solid var(--auth-border);
  background: var(--auth-surface-raised);
  color: var(--auth-text);
}

.auth-provider-btn:hover {
  text-decoration: none;
  background: #2a3548;
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--auth-title);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--auth-muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

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

.auth-link {
  color: var(--auth-brand);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.auth-link:hover {
  color: var(--auth-brand-hover);
  text-decoration: underline;
}

.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--auth-border);
  color: var(--auth-muted);
  font-size: 0.8125rem;
  text-align: center;
  line-height: 1.5;
}

.auth-section {
  margin-top: 1.25rem;
}

.auth-section-label {
  color: var(--auth-muted);
  font-size: 0.8125rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

.auth-alert {
  border-radius: 8px;
  font-size: 0.875rem;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1.25rem;
  color: var(--auth-muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.auth-back-link:hover {
  color: var(--auth-brand);
  text-decoration: none;
}

.auth-trust-note {
  margin-top: 1rem;
  color: var(--auth-muted);
  font-size: 0.8125rem;
  text-align: center;
  line-height: 1.5;
}

.auth-card .invalid-feedback {
  display: block !important;
  color: #f87171;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

.auth-card .valid-feedback {
  display: block !important;
  color: #4ade80;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

.auth-password-toggle {
  border-left: none;
  background: var(--auth-surface-raised);
  color: var(--auth-muted);
  cursor: pointer;
  user-select: none;
}

.auth-password-toggle:hover {
  background: #2a3548;
}

@media (prefers-reduced-motion: reduce) {
  .auth-background__image {
    animation: none;
  }

  .auth-btn-primary--animated {
    animation: none;
    background: var(--auth-brand);
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1.25rem;
  }

  .auth-card__logo {
    max-height: 2.25rem;
  }
}
