/* Self-hosted Manrope (variable woff2) — avoids render-blocking Google Fonts CDN */
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

html, body {
  font-family: Manrope, system-ui, sans-serif;
  min-height: 100%;
}

:root {
  --tx-ink: #14213d;
  --tx-accent: #3a5a8c;
  --tx-sand: #eef1f5;
  --tx-chrome: #f1f3f5;
  --tx-panel: #1b2a4a;
  --tx-panel-end: #334e75;
  --tx-muted: #64748b;
  --tx-btn: #14213d;
  --tx-btn-hover: #0d1628;
}

a, .btn-link {
  color: var(--tx-accent);
}

.btn-primary {
  color: #fff;
  background-color: var(--tx-btn);
  border-color: var(--tx-btn);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(58, 90, 140, 0.35);
}

.content {
  padding-top: 1.1rem;
}

h1:focus {
  outline: none;
}

.valid.modified:not([type=checkbox]) {
  outline: 1px solid #26b050;
}

.invalid {
  outline: 1px solid #e50000;
}

.validation-message {
  color: #e50000;
}

.blazor-error-boundary {
  background: #b32121;
  padding: 1rem 1rem 1rem 1.5rem;
  color: white;
}

.blazor-error-boundary::after {
  content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
  border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

body {
  color: var(--tx-ink);
  background:
    radial-gradient(circle at top left, rgba(58, 90, 140, 0.1), transparent 30%),
    linear-gradient(180deg, #f7f8fa 0%, #eef1f5 100%);
  font-family: Manrope, system-ui, sans-serif;
}

body.is-nav-open {
  overflow: hidden;
}

/* Buttons: readable contrast everywhere */
.btn {
  font-family: Manrope, system-ui, sans-serif;
  font-weight: 600;
  border-radius: 0.5rem;
  letter-spacing: 0.01em;
}

.btn-dark,
a.btn-dark {
  color: #fff !important;
  background-color: var(--tx-btn) !important;
  border-color: var(--tx-btn) !important;
}

.btn-dark:hover,
a.btn-dark:hover,
.btn-dark:focus,
a.btn-dark:focus {
  color: #fff !important;
  background-color: var(--tx-btn-hover) !important;
  border-color: var(--tx-btn-hover) !important;
}

.btn-outline-dark,
a.btn-outline-dark {
  color: var(--tx-ink) !important;
  background-color: transparent !important;
  border-color: var(--tx-ink) !important;
}

.btn-outline-dark:hover,
a.btn-outline-dark:hover,
.btn-outline-dark:focus,
a.btn-outline-dark:focus {
  color: #fff !important;
  background-color: var(--tx-btn) !important;
  border-color: var(--tx-btn) !important;
}

.brand, .brand-kicker {
  letter-spacing: 0.04em;
}

.hero {
  min-height: calc(100vh - 80px);
  min-height: calc(100dvh - 80px);
  display: flex;
  align-items: center;
}

.hero > .container {
  width: 100%;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.hero-panel {
  background: linear-gradient(155deg, var(--tx-panel) 0%, var(--tx-panel-end) 55%, #4a6288 100%);
  color: #f8fafc;
  border-radius: 1.25rem;
  min-height: 420px;
  box-shadow: 0 24px 60px rgba(20, 33, 61, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.hero-flow__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 4.5rem;
  text-align: center;
  min-width: 4.5rem;
}

.hero-flow__num {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(248, 250, 252, 0.14);
  border: 1px solid rgba(248, 250, 252, 0.28);
  color: #f8fafc;
}

.hero-flow__label {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.hero-mock {
  background: rgba(8, 14, 28, 0.28);
  border: 1px solid rgba(248, 250, 252, 0.14);
  border-radius: 1rem;
  padding: 1.15rem 1.25rem 1.2rem;
}

.hero-mock__title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.62);
  margin-bottom: 0.85rem;
}

.hero-mock__stat {
  margin-bottom: 1rem;
}

.hero-mock__stat--primary .hero-mock__value {
  display: block;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-mock__meta {
  display: block;
  margin-top: 0.2rem;
  color: rgba(248, 250, 252, 0.72);
  font-size: 0.95rem;
}

.hero-mock__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.hero-mock__list li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  color: rgba(248, 250, 252, 0.78);
  font-size: 0.95rem;
}

.hero-mock__list li span {
  font-weight: 700;
  color: #f8fafc;
  min-width: 1.1rem;
}

.app-shell {
  min-height: 100vh;
  background: #f7f8fa;
}

.demo-banner {
  background: #eef6ff;
  border-bottom: 1px solid #c7ddf7;
  color: #1e3a5f;
  font-size: 0.925rem;
}

.demo-banner a {
  color: #0f4c81;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.app-sidebar {
  width: 240px;
  flex: 0 0 240px;
  max-width: 240px;
  min-width: 240px;
  min-height: 100vh;
  background: #fff;
}

.app-sidebar .nav-link {
  color: #334155;
  border-radius: 0.5rem;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
}

.app-sidebar .nav-link:hover {
  background: var(--tx-sand);
  color: var(--tx-ink);
}

.app-sidebar .nav-link.active {
  background: var(--tx-ink);
  color: #fff !important;
  font-weight: 700;
}

.app-sidebar .nav-unread-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #b32121;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}

.app-sidebar .nav-link.active .nav-unread-badge {
  background: #fff;
  color: var(--tx-ink);
}

.notification-unread {
  background: #f8fafc;
  border-left: 3px solid var(--tx-ink);
}

.notification-dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: var(--tx-accent, #3a5a8c);
  flex: 0 0 auto;
}

.public-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.public-shell > main {
  flex: 1 0 auto;
}

.public-shell > footer {
  margin-top: auto;
  flex-shrink: 0;
  background: var(--tx-chrome);
}

.site-header {
  background: var(--tx-chrome);
}

.public-shell a:not(.btn) {
  color: inherit;
  text-decoration-color: currentColor;
}

.public-shell footer a:not(.btn) {
  color: var(--tx-muted);
}

.min-vh-60 {
  min-height: 60vh;
}

.page-help {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #475569;
  background: #f8fafc;
}

.min-w-0 {
  min-width: 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  position: relative;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--tx-ink);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle__bar {
  display: block;
  width: 1.15rem;
  height: 2px;
  margin-inline: auto;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.is-nav-open .nav-toggle .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.is-nav-open .nav-toggle .nav-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.is-nav-open .nav-toggle .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s 0.25s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.is-nav-open .nav-backdrop {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0s 0s;
}

.nav__drawer-head {
  display: none;
}

.nav__drawer-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tx-muted);
}

.nav__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--tx-ink);
  cursor: pointer;
  touch-action: manipulation;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1rem;
  margin-left: auto;
}

.site-nav .nav-text-link {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav .nav-text-link:hover {
  color: var(--tx-ink);
}

.site-nav .nav-text-link.active {
  color: var(--tx-ink);
  font-weight: 700;
  border-bottom-color: var(--tx-ink);
}

.hero-title {
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  line-height: 1.15;
}

.hero-title__line {
  display: block;
  margin-bottom: 0.12em;
}

.hero-title__steady {
  white-space: pre;
}

.hero-title__rest {
  display: block;
  margin-bottom: 0.12em;
}

.hero-title__rest:last-child {
  margin-bottom: 0;
}

.typewriter-rotate {
  display: inline-grid;
  justify-items: start;
  vertical-align: baseline;
}

.typewriter-rotate__ghost,
.typewriter-rotate__word {
  grid-area: 1 / 1;
  white-space: nowrap;
}

.typewriter-rotate__ghost {
  visibility: hidden;
}

.typewriter-rotate__word {
  border-right: 2px solid var(--tx-ink);
  padding-right: 1px;
  animation: typewriter-caret 0.7s step-end infinite;
}

.typewriter-rotate.is-done .typewriter-rotate__word {
  border-right: none;
  padding-right: 0;
  animation: none;
}

@keyframes typewriter-caret {
  50% { border-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .typewriter-rotate__word {
    border-right: none;
    animation: none;
  }

  .typewriter-rotate__word:empty::before {
    content: "testers.";
  }
}

.hero-actions .btn {
  flex: 1 1 auto;
}

.hero-members {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tx-accent);
  letter-spacing: 0.01em;
}

@media (min-width: 576px) {
  .hero-actions .btn {
    flex: 0 0 auto;
  }
}

.app-main main,
.public-shell main {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

img, svg, video {
  max-width: 100%;
  height: auto;
}

/* Public mobile drawer (from the left, matches app) */
@media (max-width: 767.98px) {
  .site-header .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: min(85vw, 300px);
    height: 100dvh;
    margin: 0;
    z-index: 51;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.55rem;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 8px 0 32px rgba(20, 33, 61, 0.18);
    padding: max(1rem, env(safe-area-inset-top, 0px)) 0.85rem max(1.5rem, env(safe-area-inset-bottom, 0px)) max(0.85rem, env(safe-area-inset-left, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.28s;
  }

  .is-nav-open .site-nav {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s;
  }

  .site-nav .nav__drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 0.65rem;
    border-bottom: 1px solid #e2e8f0;
  }

  .site-nav .nav-text-link,
  .site-nav .btn {
    width: 100%;
    text-align: center;
    min-height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 0.65rem;
  }

  .site-nav .nav-text-link {
    padding: 0.9rem 1rem;
    border-bottom: none;
    color: var(--tx-ink);
  }

  .site-nav .nav-text-link.active {
    background: var(--tx-sand);
  }

  .site-nav .btn {
    padding: 0.9rem 1rem;
  }

  .site-nav .btn-sm {
    padding: 0.9rem 1rem;
    font-size: 1.05rem;
    line-height: 1.2;
  }
}

@media (min-width: 768px) {
  .site-header .nav-toggle,
  .site-header .nav-backdrop,
  .site-nav .nav__drawer-head {
    display: none !important;
  }
}

/* App / admin mobile drawer */
@media (max-width: 991.98px) {
  .hero {
    min-height: 0;
    display: block;
  }

  .hero > .container {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .min-vh-60 {
    min-height: 0;
  }

  .hero-panel {
    min-height: 0;
    border-radius: 1rem;
  }

  .hero-mock__stat--primary .hero-mock__value {
    font-size: 1.45rem;
  }

  .lead {
    font-size: 1.05rem;
  }

  .app-shell .nav-toggle {
    display: flex;
  }

  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 51;
    flex: none;
    width: min(288px, 86vw);
    min-width: 0;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.28s;
    box-shadow: 8px 0 32px rgba(20, 33, 61, 0.14);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #fff;
  }

  .is-nav-open .app-sidebar {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s;
  }

  .app-sidebar .nav__drawer-head {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
  }

  .container.py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

@media (min-width: 992px) {
  .app-shell .nav-toggle,
  .app-shell .nav-backdrop,
  .app-sidebar .nav__drawer-head,
  .admin-mobile-bar {
    display: none !important;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Enum status tags */
.enum-tag {
  display: inline-block;
  padding: 0.2em 0.55em;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0.01em;
  border-radius: 0.375rem;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
}

.enum-tag-success {
  color: #0f5132;
  background: #d1e7dd;
  border-color: #a3cfbb;
}

.enum-tag-warning {
  color: #664d03;
  background: #fff3cd;
  border-color: #ffe69c;
}

.enum-tag-danger {
  color: #842029;
  background: #f8d7da;
  border-color: #f1aeb5;
}

.enum-tag-info {
  color: #055160;
  background: #cff4fc;
  border-color: #9eeaf9;
}

.enum-tag-accent {
  color: #1a365d;
  background: #dbe4f0;
  border-color: #b6c7de;
}

.enum-tag-neutral {
  color: #495057;
  background: #e9ecef;
  border-color: #ced4da;
}
