/* Auth pages — colorful background, solid white card, landing-page blue accents */
.auth-modern-page {
  --auth-primary: #3b82f6;
  --auth-primary-hover: #2563eb;
  --auth-headline: #0f172a;
  --auth-muted: #64748b;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #f0f4ff;
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(191, 219, 254, 0.95), transparent 50%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(186, 230, 253, 0.6), transparent 45%),
    radial-gradient(ellipse 60% 45% at 0% 30%, rgba(221, 214, 254, 0.55), transparent 45%),
    radial-gradient(ellipse 50% 40% at 80% 90%, rgba(167, 243, 208, 0.35), transparent 50%),
    linear-gradient(165deg, #f8fafc 0%, #eef2ff 40%, #f0fdfa 100%);
}

.auth-modern-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image:
    radial-gradient(rgba(59, 130, 246, 0.12) 1px, transparent 1px),
    radial-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 32px 32px, 64px 64px;
  background-position: 0 0, 16px 16px;
}

.auth-modern-page::after {
  content: "";
  position: fixed;
  inset: -15% -10%;
  pointer-events: none;
  z-index: 0;
  background: conic-gradient(
    from 200deg at 50% 45%,
    transparent 0deg,
    rgba(59, 130, 246, 0.1) 60deg,
    rgba(139, 92, 246, 0.12) 120deg,
    rgba(45, 212, 191, 0.08) 180deg,
    transparent 240deg
  );
  filter: blur(56px);
  animation: auth-aurora 20s ease-in-out infinite alternate;
}

@keyframes auth-aurora {
  0% { transform: translate3d(-1%, 0, 0) rotate(0deg); opacity: 0.8; }
  100% { transform: translate3d(1.5%, 1.5%, 0) rotate(6deg); opacity: 1; }
}

.auth-modern-page .landing-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth-modern-page .app-auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  padding: 2.5rem 1.25rem;
}

/* Solid white card — colors stay in the page background only */
.auth-modern-page .app-auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  overflow: hidden;
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid #e8eef5 !important;
  border-radius: 1.25rem !important;
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.06),
    0 20px 48px rgba(15, 23, 42, 0.12) !important;
  padding: 2rem 2rem 2.25rem !important;
}

.auth-modern-page .app-auth-brand {
  text-align: center;
  margin-bottom: 1.25rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.auth-modern-page .app-auth-brand .authentik-logo-wrap--auth,
.auth-modern-page .app-auth-brand .authentik-logo-wrap--md {
  display: block !important;
  width: 240px !important;
  max-width: 100% !important;
  height: 52px !important;
  max-height: 52px !important;
  margin: 0 auto !important;
  overflow: hidden !important;
  box-sizing: border-box;
}

.auth-modern-page .app-auth-brand .authentik-logo-wrap--auth .authentik-logo,
.auth-modern-page .app-auth-brand .authentik-logo-wrap--md .authentik-logo {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

.auth-modern-page .app-auth-brand h1 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--auth-headline) !important;
  letter-spacing: -0.02em;
}

.auth-modern-page .app-auth-brand .text-muted {
  color: var(--auth-muted) !important;
}

/* Logo — same blue gradient as landing page */
.auth-modern-page .landing-hero-icon {
  width: 3.25rem !important;
  height: 3.25rem !important;
  margin: 0 auto 1rem !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem !important;
  background: linear-gradient(135deg, #3b82f6, #60a5fa) !important;
  color: #fff !important;
  font-size: 1.5rem !important;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35) !important;
}

.auth-modern-page .landing-hero-icon i,
.auth-modern-page .landing-hero-icon i::before {
  color: #fff !important;
}

.auth-modern-page .app-auth-card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--auth-headline);
  letter-spacing: -0.01em;
}

.auth-modern-page .app-form .form-label {
  color: #334155;
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
}

.auth-modern-page .app-form .form-control {
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
  background: #ffffff !important;
  color: var(--auth-headline) !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-modern-page .app-form .form-control:hover {
  border-color: #cbd5e1 !important;
}

.auth-modern-page .app-form .form-control:focus {
  border-color: #3b82f6 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.auth-modern-page .app-form .form-control:-webkit-autofill,
.auth-modern-page .app-form .form-control:-webkit-autofill:hover,
.auth-modern-page .app-form .form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a;
  border: 1px solid #e2e8f0 !important;
}

.auth-modern-page .app-form .form-control:-webkit-autofill:focus {
  border-color: #3b82f6 !important;
}

.auth-modern-page .form-check-input:checked {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

.auth-modern-page .form-check-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2);
}

.auth-modern-page .form-check-label {
  color: var(--auth-muted);
  font-size: 0.875rem;
}

/* Sign in button — landing page blue */
.auth-modern-page .landing-btn-primary,
.auth-modern-page input.landing-btn-primary {
  width: 100%;
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35) !important;
}

.auth-modern-page .landing-btn-primary:hover,
.auth-modern-page input.landing-btn-primary:hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
}

/* Register link — same blue */
.auth-modern-page .auth-link-primary,
.auth-modern-page .app-auth-card a.auth-link-primary {
  color: #3b82f6 !important;
  font-weight: 600;
  text-decoration: none;
}

.auth-modern-page .auth-link-primary:hover {
  color: #2563eb !important;
  text-decoration: underline;
}

.auth-modern-page .auth-footer-link {
  font-size: 0.875rem;
}

.auth-modern-page .auth-footer-link .text-muted {
  color: var(--auth-muted) !important;
}

/* Invitation accept — summary panel */
.auth-modern-page .auth-invite-summary {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
}

.auth-modern-page .auth-invite-summary__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.auth-modern-page .auth-invite-summary__item:last-child {
  margin-bottom: 0;
}

.auth-modern-page .auth-invite-summary__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  font-size: 1rem;
}

.auth-modern-page .auth-invite-summary__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--auth-muted);
  margin-bottom: 0.15rem;
}

.auth-modern-page .auth-invite-summary__value {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-headline);
  word-break: break-word;
}

@media (prefers-reduced-motion: reduce) {
  .auth-modern-page::after,
  .auth-modern-page .landing-blob {
    animation: none !important;
  }
}
