/* ═══════════════════════════════════════════════════════════
   AUTH SPACE THEME — ORBIT CRM — "Mission Control"
   Dual theme: Light (Aurora) / Dark (Cosmic).
   Font: inherited from global app font (Admin → Ustawienia → Wygląd).
   ═══════════════════════════════════════════════════════════ */

/* ── Design tokens — light theme (default) ── */

.auth-page {
  --o-void: #eef1f8;
  --o-deep: #e2e7f3;
  --o-panel: #ffffff;
  --o-surface: #f0f2f8;
  --o-surface-hover: #e6e9f3;
  --o-border: rgba(91, 124, 250, 0.14);
  --o-border-focus: rgba(91, 124, 250, 0.30);
  --o-accent: #E94E1B;
  --o-accent-soft: rgba(233, 78, 27, 0.07);
  --o-accent-glow: rgba(233, 78, 27, 0.18);
  --o-blue: #5b7cfa;
  --o-blue-soft: rgba(91, 124, 250, 0.06);
  --o-text: #1b1f33;
  --o-text-secondary: #4a5274;
  --o-text-muted: #8891b0;
  --o-star: #99a4c8;
  --o-font: var(--bs-body-font-family, Inter, Helvetica, sans-serif);
}

/* ── Design tokens — dark theme ── */

html[data-bs-theme="dark"] .auth-page {
  --o-void: #060911;
  --o-deep: #0a0e1c;
  --o-panel: #0f1428;
  --o-surface: #151a32;
  --o-surface-hover: #1a2040;
  --o-border: rgba(99, 130, 255, 0.08);
  --o-border-focus: rgba(99, 130, 255, 0.22);
  --o-accent-soft: rgba(233, 78, 27, 0.12);
  --o-accent-glow: rgba(233, 78, 27, 0.35);
  --o-blue-soft: rgba(91, 124, 250, 0.08);
  --o-text: #e4e7f1;
  --o-text-secondary: #8891b0;
  --o-text-muted: #5a6384;
  --o-star: #c0ccf0;
}

/* ═══════════════════════════════════════
   PAGE-LEVEL — override Keenthemes on auth
   ═══════════════════════════════════════ */

.auth-page {
  font-family: var(--o-font);
  background: var(--o-void);
  min-height: 100vh;
}

/* ═══════════════════════════════════════
   SPACE PANEL (left)
   ═══════════════════════════════════════ */

.auth-space-panel {
  background: radial-gradient(
    ellipse 130% 90% at 50% 110%,
    #151b45 0%,
    #0e1230 35%,
    var(--o-deep) 70%
  );
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

/* Star field */

.auth-starfield {
  position: absolute;
  inset: 0;
}

.auth-starfield canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Shooting stars */

.auth-shootingstar {
  position: absolute;
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, rgba(192, 204, 240, 0.7), transparent);
  opacity: 0;
  pointer-events: none;
}

.auth-shootingstar::before {
  content: '';
  position: absolute;
  right: 0;
  top: -1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px 1px rgba(192, 204, 240, 0.5);
}

.auth-shootingstar--1 {
  top: 15%;
  left: -100px;
  transform: rotate(22deg);
  animation: auth-shoot 7s cubic-bezier(0.4, 0, 0.2, 1) 3s infinite;
}

.auth-shootingstar--2 {
  top: 55%;
  left: -80px;
  width: 80px;
  transform: rotate(28deg);
  animation: auth-shoot 9s cubic-bezier(0.4, 0, 0.2, 1) 8s infinite;
}

@keyframes auth-shoot {
  0% { opacity: 0; transform: translateX(0) rotate(22deg); }
  4% { opacity: 1; }
  25% { opacity: 0; transform: translateX(650px) rotate(22deg); }
  100% { opacity: 0; }
}

/* Nebula core */

.auth-nebula-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 320px;
  margin: -160px 0 0 -160px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(233, 78, 27, 0.07) 0%,
    rgba(91, 124, 250, 0.04) 45%,
    transparent 70%
  );
  filter: blur(50px);
  animation: auth-breathe 10s ease-in-out infinite;
  pointer-events: none;
}

@keyframes auth-breathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.12); opacity: 0.9; }
}

/* Nebula wisps */

.auth-nebula-wisp {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  animation: auth-drift 22s ease-in-out infinite;
}

.auth-nebula-wisp--1 {
  width: 350px;
  height: 200px;
  top: -8%;
  right: -12%;
  background: radial-gradient(ellipse, rgba(91, 124, 250, 0.1) 0%, transparent 70%);
}

.auth-nebula-wisp--2 {
  width: 280px;
  height: 300px;
  bottom: 8%;
  left: -10%;
  background: radial-gradient(ellipse, rgba(233, 78, 27, 0.06) 0%, transparent 70%);
  animation-delay: -8s;
  animation-duration: 28s;
}

@keyframes auth-drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, -8px); }
}

/* Constellation */

.auth-constellation {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-constellation line {
  stroke: rgba(140, 160, 220, 0.1);
  stroke-width: 0.7;
  stroke-dasharray: 3 5;
  animation: auth-draw 2.5s ease-out forwards;
}

.auth-constellation .node {
  fill: rgba(192, 204, 240, 0.45);
  animation: auth-appear 0.5s ease-out forwards;
  opacity: 0;
}

.auth-constellation .node--bright {
  fill: rgba(233, 78, 27, 0.6);
  filter: url(#auth-glow);
}

@keyframes auth-draw {
  from { stroke-dashoffset: 180; opacity: 0; }
  to { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes auth-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Orbital rings */

.auth-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid;
  pointer-events: none;
}

.auth-orbit--1 {
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  border-color: rgba(91, 124, 250, 0.06);
  transform: rotateX(68deg) rotateZ(-10deg);
  animation: auth-spin 45s linear infinite;
}

.auth-orbit--1::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  background: var(--o-accent);
  border-radius: 50%;
  box-shadow: 0 0 12px 3px var(--o-accent-glow);
}

.auth-orbit--2 {
  width: 460px;
  height: 460px;
  margin: -230px 0 0 -230px;
  border-color: rgba(91, 124, 250, 0.03);
  transform: rotateX(72deg) rotateZ(35deg);
  animation: auth-spin 70s linear infinite reverse;
}

.auth-orbit--2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 35%;
  width: 4px;
  height: 4px;
  background: var(--o-star);
  border-radius: 50%;
  box-shadow: 0 0 8px 2px rgba(192, 204, 240, 0.2);
  opacity: 0.6;
}

@keyframes auth-spin {
  from { transform: rotateX(68deg) rotateZ(0deg); }
  to { transform: rotateX(68deg) rotateZ(360deg); }
}

/* Scan line */

.auth-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, rgba(91, 124, 250, 0.06) 50%, transparent 90%);
  pointer-events: none;
  animation: auth-scan 14s ease-in-out infinite;
  z-index: 1;
}

@keyframes auth-scan {
  0%, 100% { top: -1px; opacity: 0; }
  8% { opacity: 1; }
  88% { opacity: 1; }
  95% { top: 100%; opacity: 0; }
}

/* ═══════════════════════════════════════
   BRAND CONTENT
   ═══════════════════════════════════════ */

.auth-brand {
  position: relative;
  z-index: 3;
  text-align: center;
}

.auth-brand-enter {
  animation: auth-rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-brand-logo img {
  max-height: 380px;
  height: auto;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(233, 78, 27, 0.1))
          drop-shadow(0 4px 20px rgba(0, 0, 0, 0.4));
  transition: filter 0.4s ease;
}

.auth-brand-logo:hover img {
  filter: drop-shadow(0 0 50px rgba(233, 78, 27, 0.18))
          drop-shadow(0 4px 20px rgba(0, 0, 0, 0.4));
}

/* ORBIT badge */

.auth-orbit-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.8rem;
  padding: 6px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  animation: auth-rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

.auth-orbit-badge .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--o-accent);
  box-shadow: 0 0 8px 2px var(--o-accent-glow);
  animation: auth-pulse 2.5s ease-in-out infinite;
}

@keyframes auth-pulse {
  0%, 100% { box-shadow: 0 0 6px 2px var(--o-accent-glow); }
  50% { box-shadow: 0 0 14px 5px var(--o-accent-glow); }
}

.auth-orbit-badge span {
  font-family: var(--o-font);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* Title */

.auth-title {
  font-family: var(--o-font);
  font-weight: 800;
  color: var(--o-text);
  font-size: 1.9rem;
  margin-top: 1.4rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  animation: auth-rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}

.auth-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--o-accent), #f0873a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  font-family: var(--o-font);
  font-weight: 400;
  color: var(--o-text-muted);
  font-size: 0.88rem;
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
  animation: auth-rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.65s both;
}

/* DateTime */

.auth-datetime {
  margin-top: 2.2rem;
  animation: auth-rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both;
}

.auth-datetime-date {
  font-family: var(--o-font);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--o-text-muted);
  letter-spacing: 0.06em;
}

.auth-datetime-time {
  font-family: var(--o-font);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 0.15rem;
  color: rgba(228, 231, 241, 0.12);
}

/* Horizon */

.auth-horizon {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(0deg, rgba(91, 124, 250, 0.02), transparent);
  pointer-events: none;
  z-index: 1;
}

.auth-horizon::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--o-border-focus), var(--o-accent-glow), var(--o-border-focus), transparent);
}

/* ═══════════════════════════════════════
   FORM PANEL (right)
   ═══════════════════════════════════════ */

.auth-form-panel {
  background: var(--o-panel);
  position: relative;
}

/* Divider edge */
.auth-form-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 10%,
    var(--o-border-focus) 50%,
    transparent 90%
  );
  z-index: 2;
}

/* Subtle noise texture on form panel */
.auth-form-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.015'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.auth-form-wrapper {
  position: relative;
  z-index: 1;
  animation: auth-form-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

@keyframes auth-form-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════
   FORM ELEMENTS — custom styling
   ═══════════════════════════════════════ */

/* Heading */
.auth-form-panel h1 {
  font-family: var(--o-font) !important;
  font-weight: 700 !important;
  color: var(--o-text) !important;
  font-size: 1.6rem !important;
  letter-spacing: -0.01em;
}

/* Labels */
.auth-form-panel .form-label {
  font-family: var(--o-font) !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--o-text-secondary) !important;
}

/* Inputs */
.auth-form-panel .form-control,
.auth-form-panel .form-control-solid {
  font-family: var(--o-font) !important;
  background-color: var(--o-surface) !important;
  border: 1px solid var(--o-border) !important;
  border-radius: 8px !important;
  color: var(--o-text) !important;
  font-size: 0.95rem !important;
  padding: 0.85rem 1rem !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease !important;
}

.auth-form-panel .form-control:focus,
.auth-form-panel .form-control-solid:focus {
  background-color: var(--o-surface-hover) !important;
  border-color: var(--o-border-focus) !important;
  box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  color: var(--o-text) !important;
}

.auth-form-panel .form-control::placeholder {
  color: var(--o-text-muted) !important;
}

/* Help text */
.auth-form-panel .form-text {
  font-family: var(--o-font);
  color: var(--o-text-muted);
  font-size: 0.8rem;
}

/* Links */
.auth-form-panel .link-primary,
.auth-form-panel a {
  color: var(--o-accent) !important;
  font-family: var(--o-font);
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-form-panel .link-primary:hover,
.auth-form-panel a:hover {
  color: #f0873a !important;
}

/* ── Login mode toggle — custom segmented control ── */

.auth-mode-toggle {
  display: inline-flex;
  background: var(--o-surface);
  border: 1px solid var(--o-border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.auth-mode-toggle .btn-check {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

.auth-mode-toggle .btn-check + label {
  font-family: var(--o-font);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--o-text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.auth-mode-toggle .btn-check + label i {
  font-size: 1rem;
}

.auth-mode-toggle .btn-check:checked + label {
  background: var(--o-accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--o-accent-glow);
}

/* ── Primary button ── */

.auth-form-panel .btn-primary,
.auth-form-panel #kt_sign_in_submit {
  font-family: var(--o-font) !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--o-accent), #d4410f) !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 0.9rem 1.5rem !important;
  color: #fff !important;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.3s ease !important;
  box-shadow: 0 4px 16px var(--o-accent-glow), 0 1px 3px rgba(0, 0, 0, 0.15) !important;
}

.auth-form-panel .btn-primary:hover,
.auth-form-panel #kt_sign_in_submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--o-accent-glow), 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

.auth-form-panel .btn-primary:active,
.auth-form-panel #kt_sign_in_submit:active {
  transform: translateY(0);
}

/* ── Light / secondary button ── */

.auth-form-panel .btn-light,
.auth-form-panel #back_to_phone_btn {
  font-family: var(--o-font) !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  background: var(--o-surface) !important;
  border: 1px solid var(--o-border) !important;
  border-radius: 10px !important;
  color: var(--o-text-secondary) !important;
  transition: all 0.2s ease !important;
}

.auth-form-panel .btn-light:hover,
.auth-form-panel #back_to_phone_btn:hover {
  background: var(--o-surface-hover) !important;
  border-color: var(--o-border-focus) !important;
  color: var(--o-text) !important;
}

/* Keenthemes icon color fix */
.auth-form-panel .btn-light i,
.auth-form-panel #back_to_phone_btn i {
  color: var(--o-text-muted) !important;
}

/* ── Alert ── */

.auth-form-panel .alert {
  font-family: var(--o-font);
  background: rgba(233, 78, 27, 0.08) !important;
  border: 1px solid rgba(233, 78, 27, 0.15) !important;
  border-radius: 10px !important;
  color: var(--o-text) !important;
}

.auth-form-panel .alert h4 {
  color: var(--o-accent) !important;
  font-family: var(--o-font);
}

.auth-form-panel .alert span {
  color: var(--o-text-secondary) !important;
}

.auth-form-panel .alert .btn-icon i {
  color: var(--o-accent) !important;
}

/* ── Form validation messages ── */

.auth-form-panel .invalid-feedback,
.auth-form-panel .fv-plugins-message-container {
  font-family: var(--o-font);
  color: var(--o-accent) !important;
  font-size: 0.8rem;
}

/* ── Footer ── */

.auth-form-panel #kt_app_footer {
  border-top: 1px solid var(--o-border);
}

.auth-form-panel #kt_app_footer .text-gray-900,
.auth-form-panel #kt_app_footer .text-muted,
.auth-form-panel #kt_app_footer .text-gray-800,
.auth-form-panel #kt_app_footer .text-gray-400 {
  color: var(--o-text-muted) !important;
}

.auth-form-panel #kt_app_footer .menu-link {
  color: var(--o-text-muted) !important;
}

.auth-form-panel #kt_app_footer .menu-link:hover {
  color: var(--o-text-secondary) !important;
}

.auth-form-panel #kt_app_footer .badge {
  background: var(--o-accent-soft) !important;
  color: var(--o-accent) !important;
}

/* Keenthemes gray text overrides */
.auth-form-panel .text-gray-900 {
  color: var(--o-text) !important;
}

.auth-form-panel .text-gray-400,
.auth-form-panel .text-gray-500 {
  color: var(--o-text-muted) !important;
}

/* ═══════════════════════════════════════
   LIGHT THEME — hardcoded color overrides
   (elements with colors not using CSS vars)
   ═══════════════════════════════════════ */

/* Space panel — atmospheric dawn gradient */
html:not([data-bs-theme="dark"]) .auth-space-panel {
  background: linear-gradient(
    168deg,
    #b8c4e2 0%,
    #c6d0ec 20%,
    #d4dcf2 45%,
    #dfe6f6 70%,
    #e6ecf8 100%
  );
}

/* Shooting stars — warm golden trails */
html:not([data-bs-theme="dark"]) .auth-shootingstar {
  background: linear-gradient(90deg, rgba(218, 160, 48, 0.55), transparent);
}

html:not([data-bs-theme="dark"]) .auth-shootingstar::before {
  background: #daa030;
  box-shadow: 0 0 5px 1px rgba(218, 160, 48, 0.4);
}

/* Nebula — softer pastel washes */
html:not([data-bs-theme="dark"]) .auth-nebula-core {
  background: radial-gradient(circle,
    rgba(233, 78, 27, 0.05) 0%,
    rgba(91, 124, 250, 0.06) 45%,
    transparent 70%
  );
  filter: blur(60px);
}

html:not([data-bs-theme="dark"]) .auth-nebula-wisp--1 {
  background: radial-gradient(ellipse, rgba(91, 124, 250, 0.12) 0%, transparent 70%);
}

html:not([data-bs-theme="dark"]) .auth-nebula-wisp--2 {
  background: radial-gradient(ellipse, rgba(233, 78, 27, 0.06) 0%, transparent 70%);
}

/* Constellation — more visible on light bg */
html:not([data-bs-theme="dark"]) .auth-constellation line {
  stroke: rgba(80, 100, 170, 0.16);
}

html:not([data-bs-theme="dark"]) .auth-constellation .node {
  fill: rgba(80, 100, 170, 0.35);
}

html:not([data-bs-theme="dark"]) .auth-constellation .node--bright {
  fill: rgba(233, 78, 27, 0.50);
}

/* Orbits — subtle but visible */
html:not([data-bs-theme="dark"]) .auth-orbit--1 {
  border-color: rgba(91, 124, 250, 0.12);
}

html:not([data-bs-theme="dark"]) .auth-orbit--2 {
  border-color: rgba(91, 124, 250, 0.07);
}

html:not([data-bs-theme="dark"]) .auth-orbit--2::after {
  box-shadow: 0 0 6px 2px rgba(100, 120, 180, 0.15);
}

/* Scan line — warm tint */
html:not([data-bs-theme="dark"]) .auth-scanline {
  background: linear-gradient(90deg, transparent 10%, rgba(91, 124, 250, 0.08) 50%, transparent 90%);
}

/* Brand logo — lighter shadow */
html:not([data-bs-theme="dark"]) .auth-brand-logo img {
  filter: drop-shadow(0 0 24px rgba(233, 78, 27, 0.08))
          drop-shadow(0 4px 16px rgba(0, 0, 0, 0.12));
}

html:not([data-bs-theme="dark"]) .auth-brand-logo:hover img {
  filter: drop-shadow(0 0 40px rgba(233, 78, 27, 0.14))
          drop-shadow(0 4px 16px rgba(0, 0, 0, 0.12));
}

/* ORBIT badge — glass on light */
html:not([data-bs-theme="dark"]) .auth-orbit-badge {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html:not([data-bs-theme="dark"]) .auth-orbit-badge span {
  color: rgba(30, 40, 80, 0.55);
}

/* DateTime — subtle watermark */
html:not([data-bs-theme="dark"]) .auth-datetime-time {
  color: rgba(80, 100, 170, 0.10);
}

/* Horizon — softer glow */
html:not([data-bs-theme="dark"]) .auth-horizon {
  background: linear-gradient(0deg, rgba(91, 124, 250, 0.03), transparent);
}

/* Form panel — subtle shadow instead of noise */
html:not([data-bs-theme="dark"]) .auth-form-panel::after {
  opacity: 0;
}

/* Focus shadow lighter in light mode */
html:not([data-bs-theme="dark"]) .auth-form-panel .form-control:focus,
html:not([data-bs-theme="dark"]) .auth-form-panel .form-control-solid:focus {
  box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.10), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

/* Dark mode specific — deeper focus shadow */
html[data-bs-theme="dark"] .auth-form-panel .form-control:focus,
html[data-bs-theme="dark"] .auth-form-panel .form-control-solid:focus {
  box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.08), 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

/* Dark mode specific — deeper button shadow */
html[data-bs-theme="dark"] .auth-form-panel .btn-primary,
html[data-bs-theme="dark"] .auth-form-panel #kt_sign_in_submit {
  box-shadow: 0 4px 16px var(--o-accent-glow), 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* ═══════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════ */

.auth-theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--o-border);
  background: var(--o-panel);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  outline: none;
  padding: 0;
}

html[data-bs-theme="dark"] .auth-theme-toggle {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.auth-theme-toggle:hover {
  border-color: var(--o-border-focus);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
  transform: scale(1.06);
}

html[data-bs-theme="dark"] .auth-theme-toggle:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.auth-theme-toggle:active {
  transform: scale(0.96);
}

.auth-theme-toggle svg {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

/* Sun icon — visible in light mode */
.auth-theme-toggle .auth-icon-sun {
  color: #c48a20;
  opacity: 1;
  transform: rotate(0deg);
}

/* Moon icon — visible in dark mode */
.auth-theme-toggle .auth-icon-moon {
  color: #a0b0d8;
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}

/* Dark mode: swap icons */
html[data-bs-theme="dark"] .auth-theme-toggle .auth-icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

html[data-bs-theme="dark"] .auth-theme-toggle .auth-icon-moon {
  opacity: 1;
  transform: rotate(0deg);
}

/* ═══════════════════════════════════════
   THEME TRANSITION ANIMATION
   ═══════════════════════════════════════ */

.auth-page.auth-switching {
  animation: auth-theme-switch 0.45s ease;
}

@keyframes auth-theme-switch {
  0% { opacity: 1; }
  35% { opacity: 0.55; }
  100% { opacity: 1; }
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 991.98px) {
  .auth-space-panel {
    min-height: 180px;
    padding: 1.5rem !important;
  }

  .auth-orbit,
  .auth-nebula-core,
  .auth-nebula-wisp,
  .auth-constellation,
  .auth-scanline,
  .auth-shootingstar {
    display: none;
  }

  .auth-brand-logo img {
    max-height: 160px;
  }

  .auth-title {
    font-size: 1.15rem;
    margin-top: 0.6rem;
  }

  .auth-subtitle,
  .auth-datetime {
    display: none;
  }

  .auth-orbit-badge {
    margin-top: 0.8rem;
    padding: 4px 12px;
  }

  .auth-orbit-badge span {
    font-size: 0.55rem;
  }

  .auth-form-panel::before {
    display: none;
  }

  .auth-form-panel {
    padding-top: 0 !important;
  }

  .auth-theme-toggle {
    top: 0.75rem;
    right: 0.75rem;
    width: 38px;
    height: 38px;
  }

  .auth-theme-toggle svg {
    width: 18px;
    height: 18px;
  }
}

/* ═══════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .auth-shootingstar,
  .auth-scanline {
    display: none;
  }

  .auth-orbit,
  .auth-nebula-core,
  .auth-nebula-wisp,
  .auth-starfield canvas {
    animation: none !important;
  }

  .auth-brand-enter,
  .auth-orbit-badge,
  .auth-title,
  .auth-subtitle,
  .auth-datetime,
  .auth-form-wrapper {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .auth-page.auth-switching {
    animation: none !important;
  }
}
