/* =====================================================================
   Xtender — Unified Auth Shell
   Shared chrome + brand-bound styling for ALL /xauth pages
   (login, forgot-password, reset-password, register, setup-password,
    verify-2fa, setup-2fa). One source of truth so the pages can't drift.

   Colour binds to the tenant branding token (--x-header-primary) and
   falls back to the canonical Xtender blue. Neutral/gray + danger/success
   bind to the shared --x-* / brand.css tokens with hex fallbacks so this
   renders correctly no matter which token file a page also loads.
   ===================================================================== */

:root {
  --auth-primary:       var(--x-header-primary, #0C5E94);
  --auth-primary-hover: var(--x-header-primary-dark, #0A4E7C);
  --auth-primary-ring:  rgba(12, 94, 148, 0.14);

  --auth-bg:        var(--x-bg-tertiary, #eef3f8);
  --auth-card-bg:   #ffffff;
  --auth-border:    var(--x-border, rgba(37, 64, 72, 0.14));
  --auth-line:      rgba(37, 64, 72, 0.08);

  --auth-text:      var(--x-text-primary, #254048);
  --auth-text-soft: var(--x-text-secondary, #5b6b73);
  --auth-text-mute: var(--x-text-tertiary, #8a979e);

  --auth-radius:    14px;
  --auth-radius-sm: 9px;
  --auth-shadow:    0 10px 40px rgba(37, 64, 72, 0.12);
  --auth-font:      'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- page frame ---- */
.auth-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--auth-bg);
  font-family: var(--auth-font);
  color: var(--auth-text);
  -webkit-font-smoothing: antialiased;
}
.auth-body * { box-sizing: border-box; }

/* ---- slim brand top-bar (logo only) ---- */
.auth-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--auth-card-bg);
  border-bottom: 1px solid var(--auth-border);
}
.auth-topbar a { display: inline-flex; align-items: center; text-decoration: none; }
.auth-topbar img { height: 30px; width: auto; display: block; }
.auth-topbar .auth-topbar-fallback {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--auth-primary);
}

/* ---- centred content ---- */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 20px;
}

/* ---- card ---- */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 40px;
}
.auth-card-logo { text-align: center; margin-bottom: 18px; }
.auth-card-logo img { height: 42px; width: auto; }
.auth-card-logo .auth-logo-fallback {
  font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--auth-primary);
}
.auth-card h1 {
  font-size: 24px; font-weight: 700; color: var(--auth-text);
  margin: 0 0 6px; text-align: center; letter-spacing: -0.01em;
}
.auth-sub {
  font-size: 14px; color: var(--auth-text-soft);
  margin: 0 0 24px; text-align: center; line-height: 1.5;
}

/* ---- fields ---- */
.auth-field { margin-bottom: 18px; }
.auth-field label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 600; color: var(--auth-text);
}
.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--auth-border);
  border-radius: var(--auth-radius-sm);
  font-size: 14px; font-family: inherit; color: var(--auth-text);
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
}
.auth-input::placeholder { color: var(--auth-text-mute); }
.auth-input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px var(--auth-primary-ring);
}
.auth-field small { display: block; margin-top: 5px; font-size: 12px; color: var(--auth-text-mute); }

/* ---- buttons ---- */
.auth-btn {
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: var(--auth-radius-sm);
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  background: var(--auth-primary); color: #fff;
  transition: background .18s, transform .1s, box-shadow .18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn:hover { background: var(--auth-primary-hover); transform: translateY(-1px); box-shadow: 0 5px 16px var(--auth-primary-ring); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.auth-btn-secondary {
  background: var(--x-bg-secondary, #eef2f6); color: var(--auth-text);
}
.auth-btn-secondary:hover { background: var(--auth-line); box-shadow: none; }

/* ---- links & helper rows ---- */
.auth-link { color: var(--auth-primary); text-decoration: none; font-weight: 500; }
.auth-link:hover { text-decoration: underline; }
.auth-altrow { text-align: center; margin-top: 20px; font-size: 14px; color: var(--auth-text-soft); }
.auth-altrow + .auth-altrow { margin-top: 10px; }

/* ---- info / alerts ---- */
.auth-note {
  background: var(--x-bg-secondary, #f3f6f9);
  border: 1px solid var(--auth-line);
  padding: 12px 16px; border-radius: var(--auth-radius-sm);
  margin-bottom: 20px; font-size: 14px; color: var(--auth-text-soft);
}
.auth-note strong { color: var(--auth-text); }
.auth-alert { padding: 12px 16px; border-radius: var(--auth-radius-sm); margin-bottom: 20px; font-size: 14px; }
.auth-alert-error {
  background: var(--x-danger-bg, #FDF2F2); color: var(--x-danger-dark, #B42318);
  border: 1px solid var(--x-danger-border, #F5A8A8);
}
.auth-alert-success {
  background: var(--x-success-bg, #E9F7EF); color: var(--x-success-dark, #157347);
  border: 1px solid var(--x-success-border, #7DD3A8);
}

/* ---- footer ---- */
.auth-shell-footer {
  text-align: center;
  padding: 22px 20px 28px;
  color: var(--auth-text-soft);
  font-size: 13px; line-height: 1.7;
}
.auth-shell-footer a { color: var(--auth-primary); text-decoration: none; font-weight: 500; }
.auth-shell-footer a:hover { text-decoration: underline; }
.auth-shell-footer .auth-aus {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px; font-size: 12px; color: var(--auth-text-mute);
}

@media (max-width: 520px) {
  .auth-card { padding: 28px 22px; }
  .auth-topbar { padding: 12px 18px; }
}
