/* ==========================================================================
   Identity Platform — shared design tokens and component refresh.
   Independent of any consumer's own brand: per-client logo/name/link (see
   IBrandingService) is layered on top of this default via server-rendered
   values, never by editing this file. Blue is drawn from the platform's own
   mark (wwwroot/bitwiselab-icon.svg's #0057C7 -> #001b3d gradient).
   ========================================================================== */

:root {
  --ip-ink: #12172b;
  --ip-ink-soft: #565c79;
  --ip-accent: #0057c7;
  --ip-accent-hover: #00429b;
  --ip-accent-soft: #e8f1ff;
  /* Text/icon color to use ON TOP of --ip-accent (buttons, filled badges). Separate token
     because --ip-accent itself flips from dark-on-light to light-on-dark between themes —
     white text on the light-mode accent passes AA, but the same white on dark mode's lighter
     accent measured 2.67:1 (fails 4.5:1) until this was added. */
  --ip-accent-contrast: #ffffff;
  --ip-surface: #ffffff;
  --ip-bg: #f3f4fa;
  --ip-page: #fbfbfd;
  --ip-border: #e4e6f0;
  --ip-border-strong: #d3d6e6;
  --ip-danger: #c0392b;
  --ip-radius-lg: 20px;
  --ip-radius-md: 12px;
  --ip-radius-sm: 8px;
  --ip-shadow-card: 0 1px 2px rgba(18, 23, 43, 0.04), 0 16px 40px -12px rgba(18, 23, 43, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ip-ink: #f1f2f8;
    --ip-ink-soft: #a7acc8;
    --ip-accent: #6e9cff;
    --ip-accent-hover: #8fb2ff;
    --ip-accent-soft: rgba(110, 156, 255, 0.18);
    --ip-accent-contrast: #0b0c14;
    --ip-surface: #1c2036;
    --ip-bg: #10111c;
    --ip-page: #0b0c14;
    --ip-border: #2b2f48;
    --ip-border-strong: #3b4066;
    --ip-danger: #ff6b6b;
    --ip-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -12px rgba(0, 0, 0, 0.55);
  }
}

/* ---------- base ---------- */

body {
  background: var(--ip-page);
  color: var(--ip-ink);
}

a {
  color: var(--ip-accent);
}

a:hover {
  color: var(--ip-accent-hover);
}

:focus-visible {
  outline: 2px solid var(--ip-accent);
  outline-offset: 2px;
}

/* Visually hidden until keyboard-focused — see the skip link in _Layout.cshtml. */
.visually-hidden-focusable:not(:focus) {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- global Bootstrap component refresh ----------
   Every existing page already builds on .card/.btn-primary/.form-control, so
   retargeting those classes carries the refresh everywhere without touching
   each page's markup. Loaded after bootstrap.min.css and site.css, so plain
   cascade order wins here with no !important needed. */

.card {
  background: var(--ip-surface);
  border: 1px solid var(--ip-border);
  border-radius: var(--ip-radius-lg);
  box-shadow: var(--ip-shadow-card);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--ip-border);
  color: var(--ip-ink);
  font-weight: 600;
}

.card-header:first-child {
  border-radius: calc(var(--ip-radius-lg) - 1px) calc(var(--ip-radius-lg) - 1px) 0 0;
}

.form-control {
  background: var(--ip-surface);
  color: var(--ip-ink);
  border: 1.5px solid var(--ip-border-strong);
  border-radius: var(--ip-radius-md);
  padding: 0.6rem 0.85rem;
}

.form-control:focus {
  background: var(--ip-surface);
  color: var(--ip-ink);
  border-color: var(--ip-accent);
  box-shadow: 0 0 0 3px var(--ip-accent-soft);
}

.btn {
  border-radius: var(--ip-radius-md);
  font-weight: 600;
}

.btn-primary {
  background: var(--ip-accent);
  border-color: var(--ip-accent);
  color: var(--ip-accent-contrast);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--ip-accent-hover);
  border-color: var(--ip-accent-hover);
  color: var(--ip-accent-contrast);
}

.btn-secondary {
  background: transparent;
  border-color: var(--ip-border-strong);
  color: var(--ip-ink-soft);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--ip-bg);
  border-color: var(--ip-border-strong);
  color: var(--ip-ink);
}

.btn-outline-primary {
  border-color: var(--ip-accent);
  color: var(--ip-accent);
}

.btn-outline-primary:hover {
  background: var(--ip-accent);
  border-color: var(--ip-accent);
  color: var(--ip-accent-contrast);
}

.alert-info {
  background: var(--ip-accent-soft);
  border: 1px solid var(--ip-border);
  color: var(--ip-ink);
  border-radius: var(--ip-radius-md);
}

.alert-danger {
  border-radius: var(--ip-radius-md);
}

.dropdown-menu {
  border: 1px solid var(--ip-border);
  border-radius: var(--ip-radius-md);
  box-shadow: var(--ip-shadow-card);
  background: var(--ip-surface);
  color: var(--ip-ink);
}

.dropdown-item {
  color: var(--ip-ink);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--ip-bg);
  color: var(--ip-ink);
}

/* ---------- auth shell ----------
   Shared by Login, Logout, ForgotPassword and ResetPassword: a single
   centered card with the resolved brand's logo prominent above the
   heading, instead of each page rolling its own layout. */

.auth-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 56px;
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(560px 280px at 50% -40px, var(--ip-accent-soft), transparent 70%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--ip-surface);
  border: 1px solid var(--ip-border);
  border-radius: var(--ip-radius-lg);
  box-shadow: var(--ip-shadow-card);
  padding: 36px 32px 32px;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .auth-card {
    animation: auth-card-rise 0.4s ease both;
  }
}

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

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--ip-radius-sm);
  margin: 0 auto 18px;
  display: block;
}

.auth-card h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ip-ink);
}

.auth-card .auth-subtitle {
  font-size: 13.5px;
  color: var(--ip-ink-soft);
  margin: 0 0 26px;
  line-height: 1.5;
}

.auth-card form,
.auth-card .auth-section {
  text-align: left;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ip-ink);
  margin-bottom: 6px;
}

.auth-field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.auth-field-row label {
  margin-bottom: 0;
}

/* Password show/hide toggle (see wwwroot/js/password-toggle.js — a few lines of vanilla JS,
   no framework: there's no CSS-only way to actually swap an input's type). */
.auth-field-control {
  position: relative;
}

.auth-field-control input {
  padding-right: 42px;
}

.auth-eye-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--ip-radius-sm);
  padding: 6px;
  color: var(--ip-ink-soft);
  cursor: pointer;
}

.auth-eye-toggle:hover,
.auth-eye-toggle:focus-visible {
  color: var(--ip-ink);
  background: var(--ip-bg);
}

.auth-eye-toggle .icon-eye-off {
  display: none;
}

.auth-eye-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

.auth-eye-toggle[aria-pressed="true"] .icon-eye-off {
  display: block;
}

.auth-field-row a {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.auth-field-row a:hover {
  text-decoration: underline;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ip-ink-soft);
  margin-bottom: 22px;
}

.auth-remember input {
  accent-color: var(--ip-accent);
}

.auth-actions {
  display: flex;
  gap: 10px;
}

.auth-actions .btn {
  flex: 1;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: var(--ip-ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.auth-providers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-provider-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ip-surface);
  color: var(--ip-ink);
  border: 1.5px solid var(--ip-border-strong);
  border-radius: var(--ip-radius-md);
  padding: 0.6rem;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.auth-provider-btn:hover {
  background: var(--ip-bg);
  color: var(--ip-ink);
  border-color: var(--ip-border-strong);
}

.auth-links {
  margin-top: 20px;
  font-size: 13.5px;
  color: var(--ip-ink-soft);
}

.auth-links a {
  font-weight: 600;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Federated sign-out iframe (LoggedOut.cshtml) — invisible by design, not just by size. */
.signout {
  display: none;
}

/* ---------- top nav ----------
   Thin bordered bar instead of a heavy solid-color band, on every page
   (logged in or not) — the brand moment now lives on the auth card, not
   here. Native <details>/<summary> for the user menu needs no JavaScript
   and no Bootstrap/Popper — see _Nav.cshtml. */

.ip-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--ip-surface);
  border-bottom: 1px solid var(--ip-border);
}

.ip-nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ip-ink);
  text-decoration: none;
}

.ip-nav-brand:hover {
  color: var(--ip-ink);
}

.ip-nav-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}

.ip-nav-user {
  position: relative;
}

.ip-nav-user summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ip-ink);
  padding: 6px 10px;
  border-radius: var(--ip-radius-sm);
}

.ip-nav-user summary::-webkit-details-marker {
  display: none;
}

.ip-nav-user summary:hover,
.ip-nav-user[open] summary {
  background: var(--ip-bg);
}

.ip-nav-user summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ip-ink-soft);
  border-bottom: 1.5px solid var(--ip-ink-soft);
  transform: rotate(45deg);
  margin-top: -3px;
}

.ip-nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: var(--ip-surface);
  border: 1px solid var(--ip-border);
  border-radius: var(--ip-radius-md);
  box-shadow: var(--ip-shadow-card);
  padding: 6px;
  z-index: 10;
}

.ip-nav-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--ip-radius-sm);
  font-size: 14px;
  color: var(--ip-ink);
  text-decoration: none;
}

.ip-nav-menu a:hover,
.ip-nav-menu a:focus-visible {
  background: var(--ip-bg);
  color: var(--ip-ink);
}
