/**
 * XBoard / Stellar auth — match Landing light + dark.
 * Shared theme: stellar_dark / html.dark (same as landing).
 */

.auth-page {
  /* Dark (landing .landing-page.dark) */
  --auth-bg: #0a0f1a;
  --auth-ink: #f8fafc;
  --auth-muted: rgba(248, 250, 252, 0.58);
  --auth-panel: rgba(255, 255, 255, 0.045);
  --auth-panel-border: rgba(255, 255, 255, 0.08);
  --auth-primary: #3b82f6;
  --auth-primary-hover: #2563eb;
  --auth-link: #60a5fa;
  --auth-grid: rgba(59, 130, 246, 0.09);
  --auth-glow-blue: rgba(59, 130, 246, 0.2);
  --auth-glow-purple: rgba(139, 92, 246, 0.15);
  --auth-input-bg: rgba(255, 255, 255, 0.06);
  --auth-input-border: rgba(255, 255, 255, 0.14);
  --auth-input-text: #f1f5f9;
  --auth-nav-bg: rgba(10, 15, 26, 0.8);
  --auth-nav-border: rgba(255, 255, 255, 0.06);
  --auth-nav-btn-bg: rgba(255, 255, 255, 0.05);
  --auth-nav-btn-border: rgba(255, 255, 255, 0.1);
  --auth-nav-btn-color: rgba(255, 255, 255, 0.78);

  position: relative !important;
  min-height: 100vh !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  background: var(--auth-bg) !important;
  color: var(--auth-ink) !important;
  box-sizing: border-box !important;
}

html.xb-auth-route .auth-page {
  padding-top: 64px !important;
}

/* Light (landing-page:not(.dark) → #f8fafc) */
html:not(.dark) .auth-page {
  --auth-bg: #f8fafc;
  --auth-ink: #1e293b;
  --auth-muted: #64748b;
  --auth-panel: #ffffff;
  --auth-panel-border: rgba(15, 23, 42, 0.08);
  --auth-link: #2563eb;
  --auth-grid: rgba(59, 130, 246, 0.07);
  --auth-glow-blue: rgba(59, 130, 246, 0.12);
  --auth-glow-purple: rgba(139, 92, 246, 0.08);
  --auth-input-bg: #ffffff;
  --auth-input-border: rgba(15, 23, 42, 0.16);
  --auth-input-text: #0f172a;
  --auth-nav-bg: rgba(255, 255, 255, 0.8);
  --auth-nav-border: rgba(0, 0, 0, 0.06);
  --auth-nav-btn-bg: rgba(15, 23, 42, 0.04);
  --auth-nav-btn-border: rgba(15, 23, 42, 0.08);
  --auth-nav-btn-color: rgba(15, 23, 42, 0.72);
}

/* Landing-style top bar — lives on document.body, outside Vue */
.xb-auth-nav {
  --auth-nav-bg: rgba(10, 15, 26, 0.92);
  --auth-nav-border: rgba(255, 255, 255, 0.1);
  --auth-ink: #f8fafc;
  --auth-nav-btn-bg: rgba(255, 255, 255, 0.08);
  --auth-nav-btn-border: rgba(255, 255, 255, 0.16);
  --auth-nav-btn-color: rgba(248, 250, 252, 0.9);

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--auth-nav-bg);
  border-bottom: 1px solid var(--auth-nav-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

html:not(.dark) .xb-auth-nav {
  --auth-nav-bg: rgba(255, 255, 255, 0.94);
  --auth-nav-border: rgba(15, 23, 42, 0.1);
  --auth-ink: #0f172a;
  --auth-nav-btn-bg: rgba(15, 23, 42, 0.05);
  --auth-nav-btn-border: rgba(15, 23, 42, 0.12);
  --auth-nav-btn-color: rgba(15, 23, 42, 0.78);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.xb-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--auth-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.92;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--auth-nav-btn-border);
  background: var(--auth-nav-btn-bg);
  transition: background 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.xb-auth-back:hover {
  opacity: 1;
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

.xb-auth-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.xb-auth-theme-btn {
  width: 38px !important;
  height: 38px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 10px !important;
  border: 1px solid var(--auth-nav-btn-border) !important;
  background: var(--auth-nav-btn-bg) !important;
  color: var(--auth-nav-btn-color) !important;
  cursor: pointer;
  padding: 0 !important;
}

.xb-auth-theme-btn:hover {
  color: var(--auth-ink) !important;
  border-color: rgba(59, 130, 246, 0.45) !important;
  background: rgba(59, 130, 246, 0.12) !important;
}

/* Landing hero grid */
.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--auth-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--auth-grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 72%);
  animation: xb-auth-grid 18s linear infinite;
}

.auth-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle 340px at 80% 10%, var(--auth-glow-blue), transparent 70%),
    radial-gradient(circle 380px at 10% 90%, var(--auth-glow-purple), transparent 70%);
}

@keyframes xb-auth-grid {
  to {
    background-position: 56px 56px;
  }
}

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

.auth-page .auth-brand,
.auth-page .auth-bg,
.auth-page .auth-overlay {
  display: none !important;
}

.auth-page .auth-container {
  position: relative;
  z-index: 2;
  display: block !important;
  width: min(100%, 440px) !important;
  max-width: 440px !important;
  min-height: 0 !important;
  margin: 20px 16px !important;
  background: var(--auth-panel) !important;
  border: 1px solid var(--auth-panel-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: visible !important;
}

html:not(.dark) .auth-page .auth-container {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08) !important;
}

.auth-page .auth-form-wrap {
  padding: 36px 36px 32px !important;
  max-height: none !important;
  align-items: stretch !important;
  background: transparent !important;
}

.auth-page .auth-form-inner {
  max-width: 100% !important;
}

/* Keep built-in theme btn in DOM for click() proxy; hide visually */
.auth-page .auth-top-actions {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.auth-page .auth-mobile-brand {
  display: block !important;
  text-align: center !important;
  margin: 0 0 28px !important;
}

.auth-page .auth-mobile-brand-title {
  font-size: clamp(2rem, 4.5vw, 2.5rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.1 !important;
  opacity: 1 !important;
  color: transparent !important;
  background: linear-gradient(120deg, #3b82f6, #60a5fa, #a78bfa, #3b82f6);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: xb-auth-grad 4.5s ease-in-out infinite;
}

@keyframes xb-auth-grad {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

.auth-page .auth-mobile-brand-desc {
  margin-top: 10px !important;
  font-size: 0.95rem !important;
  color: var(--auth-muted) !important;
  line-height: 1.5 !important;
  -webkit-text-fill-color: var(--auth-muted);
}

.auth-page .auth-title {
  display: block !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: var(--auth-ink) !important;
  margin-bottom: 6px !important;
  text-align: left !important;
}

.auth-page .auth-subtitle {
  display: block !important;
  font-size: 0.9rem !important;
  color: var(--auth-muted) !important;
  margin-bottom: 24px !important;
  text-align: left !important;
}

.auth-page .logo-placeholder {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
}

.auth-page .auth-link {
  color: var(--auth-link) !important;
}

.auth-page .auth-footer,
.auth-page .language-toggle {
  color: var(--auth-muted) !important;
}

.auth-page .n-form-item-label,
.auth-page .n-form-item-label__text {
  color: var(--auth-muted) !important;
}

/* Inputs always bordered (light + dark) */
.auth-page .n-input,
.auth-page .n-base-selection,
.auth-page .n-input-wrapper {
  --n-border: 1px solid var(--auth-input-border) !important;
  --n-border-hover: 1px solid rgba(59, 130, 246, 0.45) !important;
  --n-border-focus: 1px solid #3b82f6 !important;
  --n-color: var(--auth-input-bg) !important;
  --n-color-focus: var(--auth-input-bg) !important;
  --n-text-color: var(--auth-input-text) !important;
  --n-placeholder-color: color-mix(in srgb, var(--auth-input-text) 38%, transparent) !important;
  --n-caret-color: #3b82f6 !important;
  --n-box-shadow: none !important;
  background: var(--auth-input-bg) !important;
  color: var(--auth-input-text) !important;
  border: 1px solid var(--auth-input-border) !important;
  border-radius: 10px !important;
  min-height: 42px !important;
  box-shadow: none !important;
}

.auth-page .n-input .n-input__input-el,
.auth-page .n-input .n-input__textarea-el,
.auth-page .n-base-selection .n-base-selection-label,
.auth-page .n-base-selection .n-base-selection-input {
  color: var(--auth-input-text) !important;
  -webkit-text-fill-color: var(--auth-input-text) !important;
  min-height: 40px !important;
  height: 40px !important;
}

.auth-page .n-input .n-input__placeholder,
.auth-page .n-base-selection .n-base-selection-placeholder {
  color: color-mix(in srgb, var(--auth-input-text) 38%, transparent) !important;
}

.auth-page .n-input .n-input__prefix,
.auth-page .n-input .n-input__suffix,
.auth-page .n-input .n-base-clear {
  color: color-mix(in srgb, var(--auth-input-text) 48%, transparent) !important;
}

.auth-page .n-checkbox .n-checkbox__label {
  color: var(--auth-muted) !important;
}

.auth-page .n-button--primary-type {
  --n-color: #3b82f6 !important;
  --n-color-hover: #2563eb !important;
  --n-color-pressed: #1d4ed8 !important;
  --n-color-focus: #3b82f6 !important;
  --n-border: 1px solid #3b82f6 !important;
  --n-border-hover: 1px solid #2563eb !important;
  --n-border-pressed: 1px solid #1d4ed8 !important;
  --n-border-focus: 1px solid #3b82f6 !important;
  --n-text-color: #fff !important;
  --n-ripple-color: #3b82f6 !important;
  height: 42px !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-page .n-button--primary-type:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.auth-page .n-button:not(.n-button--primary-type) {
  --n-text-color: var(--auth-link) !important;
  color: var(--auth-link) !important;
}

.auth-page .n-input-group,
.auth-page .email-input-group {
  width: 100%;
}

.auth-page .n-input-group .n-button,
.auth-page .email-input-group .n-button {
  border: 1px solid var(--auth-input-border) !important;
  background: rgba(59, 130, 246, 0.12) !important;
  color: var(--auth-link) !important;
  min-height: 42px !important;
}

@media (max-width: 1023px) {
  .auth-page {
    align-items: stretch !important;
  }

  .xb-auth-nav {
    padding: 0 16px;
  }

  .auth-page .auth-container {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: calc(100vh - 64px) !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
  }

  .auth-page .auth-form-wrap {
    padding: 28px 20px 28px !important;
  }

  .auth-page .auth-title,
  .auth-page .auth-subtitle {
    display: block !important;
  }

  .auth-page .auth-login-form .n-form-item-label,
  .auth-page .auth-register-form .n-form-item-label {
    display: flex !important;
  }

  .auth-page .auth-login-form .n-form-item,
  .auth-page .auth-register-form .n-form-item {
    grid-template-rows: auto auto auto !important;
    margin-bottom: 16px !important;
  }
}

@media (max-width: 420px) {
  .auth-page .auth-form-wrap {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .xb-auth-back-label {
    font-size: 13px;
  }
}
