:root {
  color-scheme: light;
  --app-background: #f5f7fb;
  --app-surface: #ffffff;
  --app-text: #17243b;
  --app-muted: #64748b;
  --app-border: #e3e9f1;
  --app-primary: #465dc8;
  --app-primary-hover: #394da9;
  --bs-body-bg: var(--app-background);
  --bs-body-color: var(--app-text);
  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bs-body-line-height: 1.6;
  --bs-primary: var(--app-primary);
  --bs-primary-rgb: 70, 93, 200;
  --bs-secondary-color: var(--app-muted);
  --bs-border-color: var(--app-border);
  --bs-link-color: var(--app-primary);
  --bs-link-hover-color: var(--app-primary-hover);
  --bs-link-color-rgb: 70, 93, 200;
  --bs-link-hover-color-rgb: 57, 77, 169;
  --bs-focus-ring-color: rgba(70, 93, 200, 0.25);
  --bs-border-radius: 0.75rem;
  --bs-border-radius-lg: 1rem;
}

body {
  min-width: 280px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1080px;
  padding-right: 1.5rem;
  padding-left: 1.5rem;
}

.site-header {
  padding: 2rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 0.7rem;
  background: var(--app-primary);
  color: #ffffff;
}

.welcome {
  max-width: 650px;
  margin: clamp(2rem, 10vh, 7rem) auto 4rem;
}

.welcome-heading {
  margin-bottom: 2.5rem;
}

.welcome-badge {
  padding: 0.625rem 0.875rem;
  margin-bottom: 1.5rem;
  background: #e9edf9;
  color: #4054aa;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.welcome h1 {
  max-width: 580px;
  margin-bottom: 1.25rem;
  font-size: clamp(2.125rem, 5.8vw, 3.25rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.welcome-description {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--app-muted);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.card {
  --bs-card-bg: var(--app-surface);
  --bs-card-border-color: var(--app-border);
  --bs-card-border-radius: 1rem;
}

.welcome-state {
  box-shadow: 0 4px 16px rgb(23 36 59 / 3%);
}

.welcome-state .card-body {
  padding: 1.5rem;
}

.welcome-state p {
  align-self: center;
  font-size: 0.9375rem;
  font-weight: 500;
}

.state-icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 0.75rem;
  background: var(--app-background);
  color: var(--app-muted);
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-hover);
  --bs-btn-hover-border-color: var(--app-primary-hover);
  --bs-btn-active-bg: var(--app-primary-hover);
  --bs-btn-active-border-color: var(--app-primary-hover);
  --bs-btn-disabled-bg: var(--app-primary);
  --bs-btn-disabled-border-color: var(--app-primary);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 0.2rem rgb(var(--bs-primary-rgb), 0.15);
}

.auth-panel {
  max-width: 460px;
  margin: clamp(1.5rem, 5vh, 4rem) auto 4rem;
}

.auth-eyebrow {
  margin-bottom: 0.75rem;
  color: var(--app-primary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.auth-title {
  margin-bottom: 1rem;
  font-size: clamp(1.75rem, 4vw, 2.125rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.auth-card .card-body {
  padding: clamp(1.25rem, 4vw, 2rem);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.form-control,
.form-select,
.auth-card .btn {
  min-height: 2.875rem;
}

.form-control[aria-invalid="true"] {
  border-color: var(--bs-danger);
}

.workspace-link {
  color: var(--app-muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.workspace-link:hover,
.workspace-link:focus-visible {
  color: var(--app-primary);
  text-decoration: underline;
}

.settings-panel {
  max-width: 620px;
  margin: 2rem auto 4rem;
}

.settings-card .card-body {
  padding: clamp(1.25rem, 4vw, 2rem);
}

.settings-section-title {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.enrollment-qr {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--app-border);
  border-radius: var(--bs-border-radius);
  background: #ffffff;
}

.recovery-code-list code {
  color: var(--app-text);
  font-size: clamp(0.625rem, 2.6vw, 0.9375rem);
  overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
  .site-header > .app-container {
    flex-wrap: wrap;
  }

  .site-header {
    padding-top: 1.5rem;
  }

  .welcome-heading {
    margin-bottom: 2rem;
  }

  .welcome-state .card-body {
    padding: 1.25rem;
  }
}

.nav-pills {
  --bs-nav-pills-link-active-bg: var(--app-primary);
  --bs-nav-link-color: var(--app-primary);
  --bs-nav-link-hover-color: var(--app-primary-hover);
}

.site-header .navbar-nav .nav-link {
  color: var(--app-muted);
  font-size: 0.9375rem;
}

.site-header .navbar-nav .nav-link:hover,
.site-header .navbar-nav .nav-link:focus-visible,
.site-header .navbar-nav .nav-link.active {
  color: var(--app-primary);
}

.site-header .navbar-nav .nav-link.active {
  font-weight: 600;
}

.site-header .navbar-collapse {
  gap: 1rem;
}

@media (max-width: 991.98px) {
  .site-header .navbar-collapse {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--bs-border-radius-lg);
    background: var(--app-surface);
    box-shadow: 0 0.25rem 1rem rgba(23, 36, 59, 0.06);
  }
}

.btn-outline-primary {
  --bs-btn-color: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary);
  --bs-btn-hover-border-color: var(--app-primary);
  --bs-btn-active-bg: var(--app-primary-hover);
  --bs-btn-active-border-color: var(--app-primary-hover);
  --bs-btn-focus-shadow-rgb: 70, 93, 200;
}

.text-bg-primary {
  background-color: var(--app-primary) !important;
}

.form-check-input:checked {
  border-color: var(--app-primary);
  background-color: var(--app-primary);
}

.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-bottom: 0.5rem;
}

.page-heading > h1 {
  min-width: 0;
  margin-bottom: 0;
}

.help-link {
  border-radius: 0.375rem;
  color: var(--app-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.help-link svg {
  margin-right: 0.375rem;
  vertical-align: -0.1875em;
}

.help-link:hover,
.help-link:focus-visible {
  color: var(--app-primary);
  text-decoration: underline;
}

.help-link:focus-visible,
.help-toc a:focus-visible,
.help-section a:focus-visible {
  outline: 2px solid var(--app-primary);
  outline-offset: 2px;
}

.help-toc {
  position: sticky;
  top: 1.5rem;
}

.help-toc ol {
  padding-left: 0;
  list-style: none;
}

.help-toc a {
  display: block;
  padding: 0.3rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--app-muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.help-toc a:hover,
.help-toc a:focus-visible {
  background: #e9edf9;
  color: var(--app-primary);
}

.help-section {
  scroll-margin-top: 1.5rem;
}

.help-section h2 {
  margin-bottom: 0.75rem;
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.help-section h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
  scroll-margin-top: 1.5rem;
}

.help-section p,
.help-section li,
.help-section td,
.help-section th {
  max-width: 72ch;
}

.help-section ol > li,
.help-section ul > li {
  margin-bottom: 0.375rem;
}

.help-section table {
  font-size: 0.9375rem;
}

.help-section .table th {
  color: var(--app-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .help-toc {
    position: static;
  }
}
