/*--------------------------------------------------------------
# Barrelstopper Console
Styles for the Console, following the StyleGuide. Load after brand/tokens.css
(copied from Barrelstopper-Site by scripts/sync-brand.mjs) and, on Blazor pages,
after MudBlazor.min.css. Tokens only: never hard-code a colour here.

The General, Buttons, Section title and Plan sections mirror the same sections
of the site's global.css; keep them in step when the site changes.
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# Fonts
The site's four typefaces, self-hosted (wwwroot/brand/fonts).
--------------------------------------------------------------*/
@font-face {
  font-family: "Fraunces";
  src: url("../brand/fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pirata One";
  src: url("../brand/fonts/pirata-one.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Raleway";
  src: url("../brand/fonts/raleway.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("../brand/fonts/open-sans.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("../brand/fonts/open-sans-italic.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --font-brand: "Fraunces", Georgia, serif;
  --font-display: "Pirata One", Georgia, serif;
  --font-heading: "Raleway", sans-serif;
  --font-body: "Open Sans", sans-serif;
  color-scheme: dark;
}

/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--navy-900);
}

a {
  color: var(--gold-light);
  text-decoration: none;
  transition: color var(--duration);
}

a:hover {
  color: var(--gold);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--white);
}

/* The "Barrelstopper" wordmark. Use only for the name itself. */
.wordmark {
  font-family: var(--font-brand);
  font-weight: 800;
  font-variation-settings: "SOFT" 100;
  letter-spacing: -0.01em;
}

/* Short gold label above a big title. */
.eyebrow {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 4px;
}

/* One visible focus style for every interactive element. */
:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

/* Blazor moves focus to the page's h1 (and the skip link to main) for screen readers;
   they aren't interactive, so no ring. */
h1:focus,
main:focus {
  outline: none;
}

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.muted {
  color: var(--text-muted);
}

.mono,
.mono textarea,
.mono input,
.mono .mud-input > .mud-input-slot.mud-input-root {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
}

.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 8px 16px;
  color: var(--navy-900);
  background: var(--gold);
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Parchment surface: things people read closely or compare. */
.parchment {
  color-scheme: light;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(160, 120, 60, 0.18), transparent 55%),
    var(--parchment);
  border: 1px solid var(--parchment-edge);
  box-shadow: var(--shadow-parchment-inset), var(--shadow-card);
}

.parchment h1,
.parchment h2,
.parchment h3,
.parchment h4 {
  color: var(--ink);
}

/* Gold fails contrast on parchment: eyebrows turn leather. */
.parchment .eyebrow {
  color: var(--leather);
}

.parchment a:not([class*="btn-"]) {
  color: var(--leather);
  text-decoration: underline;
}

.parchment a:not([class*="btn-"]):hover {
  color: var(--ink);
}

/*--------------------------------------------------------------
# Buttons
Links that go somewhere, or <button> for in-page actions, same classes.
--------------------------------------------------------------*/
.btn-gold,
.btn-ghost,
.btn-outline-ink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  line-height: 1.2;
  padding: 13px 30px;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--duration-fast);
}

.btn-gold {
  color: var(--navy-900);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 4px 0 var(--gold-deep), 0 8px 20px rgba(227, 169, 59, 0.25);
}

.btn-gold:hover {
  color: var(--navy-900);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--gold-deep), 0 12px 24px rgba(227, 169, 59, 0.35);
}

.btn-ghost {
  color: var(--text);
  background: transparent;
  border: 2px solid rgba(219, 229, 238, 0.35);
}

.btn-ghost:hover {
  color: var(--white);
  border-color: var(--gold-light);
}

.btn-outline-ink {
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
}

.btn-outline-ink:hover {
  color: var(--parchment);
  background: var(--ink);
}

.btn-sm {
  padding: 8px 20px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

/* A button that looks like a text link, for small secondary actions. */
.btn-link {
  padding: 0;
  font: inherit;
  color: var(--gold-light);
  background: none;
  border: 0;
  cursor: pointer;
}

.btn-link:hover {
  color: var(--gold);
}

/*--------------------------------------------------------------
# Section title
--------------------------------------------------------------*/
.section-title {
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.section-title h1,
.section-title h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(42px, 6vw, 56px);
  line-height: 1.1;
  margin: 0;
  color: var(--parchment);
}

.section-title .divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 20px;
  color: var(--gold);
  font-size: 20px;
}

.section-title .divider span {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.section-title .divider span:last-child {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.section-title p {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

/*--------------------------------------------------------------
# Badges
--------------------------------------------------------------*/
.save {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--white);
  background: var(--success);
  border-radius: var(--radius-pill);
}

/*--------------------------------------------------------------
# Plans (Shop)
--------------------------------------------------------------*/
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: start;
}

.plan {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 36px 28px 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.plan.featured {
  border: 2px solid var(--gold);
  box-shadow: var(--shadow-parchment-inset), 0 0 0 6px var(--gold-ring), var(--shadow-raised);
}

.ribbon {
  position: absolute;
  top: 22px;
  right: -42px;
  width: 160px;
  padding: 4px 0;
  transform: rotate(45deg);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy-900);
  background: var(--gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.plan h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 4px;
  padding-right: 32px;
}

.plan-blurb {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.plan-prices {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--parchment-edge);
}

.price-main {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.price-main span {
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-soft);
}

.price-alt {
  margin-top: 12px;
  font-size: 15px;
  color: var(--ink-soft);
}

.price-alt strong {
  color: var(--ink);
}

.plan-items {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  font-size: 14px;
}

.plan-items li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
}

.plan-items .icon {
  margin-top: 4px;
  color: var(--sea);
}

.plan-action {
  margin-top: auto;
}

.shop-notes {
  max-width: 860px;
  margin: 48px auto 0;
  font-size: 14px;
  color: var(--text-muted);
}

.shop-notes p:last-child {
  margin-bottom: 0;
}

.shop-notes strong {
  color: var(--text);
}

.text-center {
  text-align: center;
}

/* Billing period switch above the plans. */
.period-switch {
  display: inline-flex;
  padding: 4px;
  margin: 0 auto 40px;
  background: var(--surface-glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}

.period-switch button {
  padding: 8px 20px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--duration);
}

.period-switch button[aria-pressed="true"] {
  color: var(--navy-900);
  background: var(--gold);
}

/*--------------------------------------------------------------
# Glass cards and panels
--------------------------------------------------------------*/
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 32px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.feature-card h2,
.feature-card h3 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 8px;
}

.feature-card p {
  flex: 1;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  font-size: 28px;
  color: var(--gold);
  background: var(--gold-tint);
  border: 1px solid rgba(227, 169, 59, 0.35);
  border-radius: 50%;
}

.panel {
  padding: 24px;
  background: var(--navy-800);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* Label/value pairs. */
.details {
  margin: 0;
}

.details > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-subtle);
}

.details > div:last-child {
  border-bottom: 0;
}

.details dt {
  font-weight: 400;
  color: var(--text-muted);
}

.details dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  color: var(--white);
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state .icon {
  display: block;
  margin: 0 auto 12px;
  font-size: 40px;
  color: var(--gold);
}

/*--------------------------------------------------------------
# Page header (Console pages)
--------------------------------------------------------------*/
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 44px);
  line-height: 1.1;
  margin: 0;
  color: var(--parchment);
}

.page-header .lead {
  margin: 8px 0 0;
  max-width: 72ch;
  color: var(--text-muted);
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumbs .icon {
  font-size: 16px;
}

.section-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.2;
  margin: 40px 0 16px;
  color: var(--white);
}

/*--------------------------------------------------------------
# Header (app bar)
--------------------------------------------------------------*/
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 26px;
  line-height: 1;
  color: var(--parchment);
  text-decoration: none;
}

.logo:hover {
  color: var(--parchment);
}

.logo .icon,
.logo .mud-icon-root {
  font-size: 26px;
  width: 26px;
  height: 26px;
  color: var(--gold);
}

.logo-label {
  margin-left: 4px;
  padding-left: 12px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  border-left: 1px solid var(--line-strong);
}

.account-menu {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  font-weight: 600;
}

.account-menu form {
  margin: 0;
}

.account-menu a,
.account-menu button {
  white-space: nowrap;
}

.account-menu .who {
  color: var(--text-muted);
  font-weight: 400;
}

.account-menu a:not([class*="btn-"]),
.account-menu .btn-link {
  font-weight: 600;
  color: var(--text);
}

.account-menu a:not([class*="btn-"]):hover,
.account-menu .btn-link:hover {
  color: var(--gold-light);
}

@media (max-width: 767px) {
  .logo-label,
  .account-menu .who {
    display: none;
  }

  .account-menu {
    gap: 12px;
  }
}

@media (max-width: 575px) {
  .logo {
    font-size: 22px;
  }

  .logo .icon,
  .logo .mud-icon-root {
    font-size: 22px;
    width: 22px;
    height: 22px;
  }

  .account-menu .btn-sm {
    padding: 8px 12px;
  }
}

/* Register is one tap away on the home and log in pages; drop it from the header on small phones. */
@media (max-width: 419px) {
  .account-menu .register {
    display: none;
  }
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 32px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--navy-950);
  border-top: 1px solid var(--line);
}

.site-footer .disclaimer {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.75;
}

.site-footer .discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 22px;
  color: var(--white);
  background: var(--discord);
  border-radius: 50%;
  transition: var(--duration);
}

.site-footer .discord:hover {
  color: var(--white);
  background: var(--discord-light);
}

@media (max-width: 767px) {
  .site-footer {
    flex-direction: column;
    padding: 24px 16px;
    text-align: center;
  }
}

/*--------------------------------------------------------------
# Account pages (Identity: log in, register, manage account)
--------------------------------------------------------------*/
.account-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.account-header {
  position: sticky;
  top: 0;
  z-index: 997;
  height: var(--header-height);
  background: rgba(8, 26, 44, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-header);
}

.account-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

.account-main {
  flex: 1;
  padding: 60px 16px 90px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(42, 111, 151, 0.22), transparent 60%),
    var(--navy-900);
}

@media (max-width: 575px) {
  .account-header .inner {
    padding: 0 16px;
  }

  .account-main {
    padding: 36px 12px 60px;
  }
}

/* One form on a parchment card, centred. */
.auth-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 40px 32px;
  border-radius: var(--radius-lg);
}

.auth-card.wide {
  max-width: 860px;
}

@media (max-width: 575px) {
  .auth-card {
    padding: 28px 20px 24px;
  }
}

.auth-card h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 44px);
  line-height: 1.1;
  margin: 0 0 8px;
  color: var(--ink);
}

.auth-card h2 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  margin: 32px 0 12px;
  color: var(--ink);
}

.auth-card h2:first-child {
  margin-top: 0;
}

.auth-card .intro {
  margin: 0 0 24px;
  color: var(--ink-soft);
}

.auth-card p {
  color: var(--ink);
}

.auth-card hr {
  border: 0;
  border-top: 1px dashed var(--parchment-edge);
  margin: 24px 0;
  opacity: 1;
}

.auth-card .alt-links {
  margin: 24px 0 0;
  padding: 16px 0 0;
  list-style: none;
  font-size: 14px;
  border-top: 1px dashed var(--parchment-edge);
}

.auth-card .alt-links li + li {
  margin-top: 8px;
}

.auth-card .recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 16px;
  margin: 0 0 24px;
  list-style: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--parchment-edge);
  border-radius: var(--radius-sm);
}

.auth-card .qr {
  display: inline-block;
  padding: 12px;
  margin: 8px 0 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
}

.auth-card .hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.auth-card .hint.confirmed {
  font-weight: 700;
  color: var(--success);
}

/* Numbered set-up steps (authenticator app). */
.auth-card .steps {
  padding-left: 20px;
  margin: 0;
}

.auth-card .steps > li + li {
  margin-top: 16px;
}

.auth-card .key {
  display: inline-block;
  padding: 4px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--parchment-edge);
  border-radius: var(--radius-sm);
}

/* Linked external logins. */
.auth-card .login-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.auth-card .login-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--parchment-edge);
}

.auth-card .login-list form,
.inline-form {
  display: inline;
  margin: 0;
}

/* Destructive actions only (delete account, reset keys). */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  line-height: 1.2;
  padding: 13px 30px;
  color: var(--white);
  background: var(--danger);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: var(--duration-fast);
}

.parchment a.btn-danger,
.btn-danger:hover {
  color: var(--white);
  text-decoration: none;
}

.btn-danger:hover {
  filter: brightness(0.92);
}

/* Manage account: section nav beside the form. */
.manage-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
}

@media (max-width: 767px) {
  .manage-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.manage-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 600;
}

.manage-nav a {
  display: block;
  padding: 8px 12px;
  color: var(--ink-soft) !important;
  text-decoration: none !important;
  border-radius: var(--radius-sm);
}

.manage-nav a:hover {
  color: var(--ink) !important;
  background: rgba(200, 168, 104, 0.2);
}

.manage-nav a[aria-current="page"] {
  color: var(--ink) !important;
  background: var(--parchment-deep);
  box-shadow: inset 3px 0 0 var(--leather);
}

/*--------------------------------------------------------------
# Forms
Visible labels; fields with a 1px edge and --radius-sm; errors under the field
in --danger with an icon, linked with aria-describedby.
--------------------------------------------------------------*/
.field {
  margin-bottom: 20px;
}

.field label,
.field .label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.field .hint {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--parchment-edge);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration);
}

.input:hover {
  border-color: var(--leather);
}

.input:focus {
  border-color: var(--leather);
}

.input[readonly],
.input:disabled {
  color: var(--ink-soft);
  background: rgba(230, 210, 164, 0.5);
}

.input.input-validation-error {
  border-color: var(--danger);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--leather);
}

/* Errors: an icon and a sentence saying how to fix it. Empty ones take no space. */
.field-error,
.form-errors {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--danger);
}

.field-error::before,
.form-errors::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: currentColor;
  -webkit-mask: url("../brand/error-warning.svg") center / contain no-repeat;
  mask: url("../brand/error-warning.svg") center / contain no-repeat;
}

.field-error:empty,
.field-error.field-validation-valid,
.form-errors.validation-summary-valid {
  display: none;
}

.form-errors {
  padding: 12px 16px;
  margin: 0 0 20px;
  background: rgba(194, 69, 58, 0.08);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
}

.form-errors ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

/* Status messages on parchment ("Your profile has been updated"). */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--ink);
  background: rgba(63, 125, 58, 0.12);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
}

.notice.error {
  background: rgba(194, 69, 58, 0.08);
  border-color: var(--danger);
}

.notice.warning {
  background: rgba(138, 90, 43, 0.1);
  border-color: var(--leather);
}

.g-recaptcha {
  margin-bottom: 20px;
}

/*--------------------------------------------------------------
# MudBlazor
The theme (Brand/BrandTheme.cs) sets colours and type; these rules cover what
the theme can't: button shapes, the nav, panels and the Blazor error bar.
--------------------------------------------------------------*/
.mud-layout {
  background: var(--navy-900);
}

.mud-typography,
.mud-input,
.mud-table-cell {
  font-family: var(--font-body);
}

/* Buttons: filled primary is the gold button, outlined is the ghost button. */
.mud-button-root.mud-button {
  white-space: nowrap;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: none;
  transition: var(--duration-fast);
}

.mud-button-root.mud-button.mud-button-size-small {
  min-height: 36px;
  padding: 6px 16px;
  font-size: 14px;
}

.mud-button-root.mud-button.mud-button-size-large {
  padding: 13px 30px;
}

.mud-button-filled.mud-button-filled-primary {
  color: var(--navy-900);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 4px 0 var(--gold-deep), 0 8px 20px rgba(227, 169, 59, 0.25);
}

.mud-button-filled.mud-button-filled-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 6px 0 var(--gold-deep), 0 12px 24px rgba(227, 169, 59, 0.35);
}

.mud-button-filled.mud-button-filled-primary.mud-button-size-small {
  box-shadow: 0 3px 0 var(--gold-deep);
}

.mud-button-filled.mud-button-filled-error {
  box-shadow: none;
}

.mud-button-filled:disabled,
.mud-button-filled.mud-disabled {
  color: var(--text-muted) !important;
  background: var(--surface-glass) !important;
  box-shadow: none !important;
}

.mud-button-outlined {
  border-width: 2px;
  border-color: rgba(219, 229, 238, 0.35);
  color: var(--text);
}

.mud-button-outlined.mud-button-outlined-primary,
.mud-button-outlined.mud-button-outlined-default {
  color: var(--text);
  border-color: rgba(219, 229, 238, 0.35);
}

.mud-button-outlined:hover:not(:disabled) {
  color: var(--white);
  border-color: var(--gold-light);
  background: transparent;
}

.mud-button-outlined.mud-button-outlined-error {
  color: var(--danger);
  border-color: var(--danger);
}

.mud-button-text.mud-button-text-primary {
  color: var(--gold-light);
}

/* Status-coloured text buttons (Activate, Disable…) fail contrast as text on navy:
   keep the words readable and let the icon carry the colour. */
.mud-button-text.mud-button-text-success,
.mud-button-text.mud-button-text-error,
.mud-button-text.mud-button-text-info,
.mud-button-text.mud-button-text-warning {
  color: var(--text);
}

.mud-button-text.mud-button-text-success .mud-button-icon-start {
  color: var(--success);
}

.mud-button-text.mud-button-text-error .mud-button-icon-start {
  color: var(--danger);
}

.mud-button-text.mud-button-text-info .mud-button-icon-start {
  color: var(--text-muted);
}

.mud-icon-button {
  color: var(--text-muted);
}

.mud-icon-button:hover {
  color: var(--gold-light);
}

/* Up means interactive: only buttons lift. */
@media (prefers-reduced-motion: reduce) {
  .mud-button-filled.mud-button-filled-primary:hover:not(:disabled),
  .btn-gold:hover {
    transform: none;
  }
}

/* App bar */
.mud-appbar.bs-appbar {
  background: rgba(5, 14, 25, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-header);
}

.bs-appbar .mud-toolbar {
  gap: 12px;
  padding: 0 24px;
}

@media (max-width: 575px) {
  .bs-appbar .mud-toolbar {
    padding: 0 12px;
  }
}

/* Drawer and nav */
.mud-drawer.bs-drawer {
  background: var(--navy-950);
  border-right: 1px solid var(--line);
}

.bs-nav {
  padding: 16px 12px;
}

.bs-nav .nav-heading {
  margin: 24px 12px 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
}

.bs-nav .mud-nav-link {
  min-height: 44px;
  padding: 8px 12px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius-md);
  transition: var(--duration);
}

.bs-nav .mud-nav-link .mud-nav-link-icon {
  color: var(--text-muted);
  font-size: 20px;
}

.bs-nav .mud-nav-link:hover:not(.mud-nav-link-disabled),
.bs-nav .mud-nav-link:focus-visible {
  color: var(--gold-light);
  background: var(--surface-glass);
}

.bs-nav .mud-nav-link.active:not(.mud-nav-link-disabled) {
  color: var(--gold-light);
  background: var(--gold-tint);
  box-shadow: inset 3px 0 0 var(--gold);
}

.bs-nav .mud-nav-link.active .mud-nav-link-icon,
.bs-nav .mud-nav-link:hover .mud-nav-link-icon {
  color: var(--gold);
}

/* Main column */
.mud-main-content.bs-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(42, 111, 151, 0.18), transparent 50%),
    var(--navy-900);
}

.bs-page {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 32px 90px;
}

@media (max-width: 767px) {
  .bs-page {
    padding: 28px 16px 60px;
  }
}

/* Surfaces: Mud papers and cards are glass panels on navy. */
.mud-paper:not(.mud-popover):not(.mud-dialog):not(.mud-drawer):not(.mud-appbar):not(.mud-snackbar) {
  background-color: var(--navy-800);
  border-radius: var(--radius-lg);
}

.mud-paper.mud-paper-outlined {
  background: var(--surface-glass);
  border: 1px solid var(--line);
}

.mud-elevation-1,
.mud-elevation-2,
.mud-elevation-3,
.mud-elevation-4,
.mud-elevation-25 {
  box-shadow: var(--shadow-card);
}

.mud-card,
.mud-table,
.mud-expand-panel,
.mud-tabs-tabbar {
  border: 1px solid var(--line);
}

.mud-tabs-tabbar {
  border-radius: var(--radius-lg);
}

.mud-tab {
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.3px;
}

.mud-tab.mud-tab-active {
  color: var(--gold-light);
}

.mud-tab-slider {
  background: var(--gold);
}

.mud-expand-panel.mud-panel-expanded {
  border-color: var(--line-strong);
}

/* Tables */
.mud-table-head .mud-table-cell {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--navy-800);
}

.mud-table-cell {
  font-size: 14px;
  border-bottom-color: var(--line-subtle);
}

.mud-table-pagination {
  color: var(--text-muted);
}

/* Inputs */
.mud-input.mud-input-outlined .mud-input-outlined-border {
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
}

.mud-input.mud-input-outlined:hover:not(.mud-disabled) .mud-input-outlined-border {
  border-color: var(--gold-light);
}

.mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
  border-color: var(--gold);
}

.mud-input-label {
  color: var(--text-muted);
}

.mud-input-helper-text.mud-input-error,
.mud-input-error .mud-input-helper-text {
  color: var(--danger);
}

/* Chips are badges: small, rounded, always with words. */
.mud-chip {
  font-weight: 700;
  border-radius: var(--radius-pill);
}

.mud-chip.mud-chip-size-small {
  height: 22px;
  font-size: 12px;
}

.mud-chip.mud-chip-filled.mud-chip-color-default {
  color: var(--text);
  background: var(--surface-glass);
  border: 1px solid var(--line);
}

.mud-chip.mud-chip-outlined {
  border-color: var(--line-strong);
}

/* Text chips put status colour on the words, which fails contrast on navy for --success,
   --sea and --danger. Keep the words readable; the tint and icon carry the colour. */
.mud-chip.mud-chip-text {
  color: var(--text);
}

.mud-chip.mud-chip-text .mud-chip-icon {
  opacity: 1;
}

/* Dialogs */
.mud-dialog {
  background: var(--navy-800);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
}

.mud-dialog .mud-dialog-title .mud-typography {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--white);
}

.mud-overlay-dark {
  background-color: rgba(5, 14, 25, 0.8);
}

/* Menus, selects and tooltips */
.mud-popover.mud-paper {
  background: var(--navy-700);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.mud-tooltip {
  font-size: 13px;
  color: var(--text);
  background: var(--navy-700);
  border: 1px solid var(--line);
}

/* Alerts and snackbars keep MudBlazor's status colours; soften the corners. */
.mud-alert,
.mud-snackbar {
  border-radius: var(--radius-md);
}

/* Text alerts colour their words with the status colour, which fails contrast on navy. */
.mud-alert[class*="mud-alert-text-"] .mud-alert-message {
  color: var(--text);
}

.mud-switch .mud-switch-track {
  background-color: var(--text-muted);
}

.mud-progress-circular {
  color: var(--gold);
}

.mud-divider {
  border-color: var(--line);
}

/*--------------------------------------------------------------
# Blazor error bar
--------------------------------------------------------------*/
#blazor-error-ui {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 2000;
  padding: 12px 48px 12px 20px;
  font-size: 14px;
  color: var(--white);
  background: var(--danger);
  box-shadow: var(--shadow-header);
}

#blazor-error-ui .reload {
  margin-left: 8px;
  font-weight: 700;
  color: var(--white);
  text-decoration: underline;
}

#blazor-error-ui .dismiss {
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  color: var(--white);
  background: none;
  border: 0;
  cursor: pointer;
}

/*--------------------------------------------------------------
# Admin
Helpers for the admin pages (Pages/Admin) and their dialogs.
--------------------------------------------------------------*/
.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.text-nowrap {
  white-space: nowrap;
}

.mud-width-full {
  width: 100%;
}

.admin-strong {
  font-weight: 700;
}

/* Long emails, paths and IDs wrap instead of pushing the table sideways. */
.admin-break {
  overflow-wrap: anywhere;
}

.admin-search {
  max-width: 320px;
}

.admin-col-actions {
  width: 180px;
}

.admin-col-status {
  width: 120px;
}

.admin-click {
  cursor: pointer;
}

.admin-inline-icon {
  vertical-align: middle;
}

/* A table row whose details are open, and the cell holding those details. */
.mud-table-row.row-open > .mud-table-cell {
  background: var(--gold-tint);
}

.admin-child-cell {
  padding: 16px !important;
  background: var(--navy-900);
}

.mud-table-row.admin-group-header .mud-table-cell,
.admin-group-header .mud-table-cell {
  background: var(--navy-900);
}

.admin-dialog-scroll {
  max-height: 60vh;
  overflow-y: auto;
}
