/* =========================================================
   AuthServer — authentication surfaces
   (tokens, chrome, buttons, avatars live in Shared.Web/shared.css)
   ========================================================= */

/* ---------------------------------------------------------
   Admin content rail (matches BrokerQuote)
   --------------------------------------------------------- */
.site-body.container-fluid {
  --admin-rail: 80rem;
  max-width: var(--admin-rail);
  margin-inline: auto;
  padding-left: clamp(1.25rem, 3.5vw, 2.75rem);
  padding-right: clamp(1.25rem, 3.5vw, 2.75rem);
}

.site-body.container-fluid main {
  width: 100%;
}

/* Brand primary actions → yellow (keep ink secondary) */
.btn-primary {
  --bs-btn-color: var(--text-on-yellow);
  --bs-btn-bg: var(--brand-yellow);
  --bs-btn-border-color: var(--brand-yellow-deep);
  --bs-btn-hover-color: var(--text-on-yellow);
  --bs-btn-hover-bg: var(--brand-yellow-bright);
  --bs-btn-hover-border-color: var(--brand-yellow-deep);
  --bs-btn-active-color: var(--text-on-yellow);
  --bs-btn-active-bg: var(--brand-yellow-deep);
  --bs-btn-active-border-color: var(--brand-yellow-deep);
  --bs-btn-disabled-color: var(--text-on-yellow);
  --bs-btn-disabled-bg: #f0e08a;
  --bs-btn-disabled-border-color: #e6d57a;
  font-weight: 700;
  border-radius: var(--radius-pill);
  box-shadow: none;
}

.btn-secondary,
.btn-info {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand-ink);
  --bs-btn-border-color: var(--brand-ink);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand-ink-soft);
  --bs-btn-hover-border-color: var(--brand-ink-soft);
  --bs-btn-active-bg: #111;
  --bs-btn-active-border-color: #111;
  font-weight: 650;
  border-radius: var(--radius-pill);
}

.btn-outline-secondary,
.btn-outline-info,
.btn-outline-danger {
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.btn-outline-secondary {
  --bs-btn-color: var(--brand-ink);
  --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-color: var(--brand-ink);
  --bs-btn-hover-bg: var(--surface-muted);
  --bs-btn-hover-border-color: var(--brand-ink);
}

.btn-outline-info {
  --bs-btn-color: var(--brand-ink);
  --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-color: var(--brand-ink);
  --bs-btn-hover-bg: var(--surface-tint);
  --bs-btn-hover-border-color: var(--brand-yellow-deep);
}

.btn-outline-danger {
  --bs-btn-color: var(--danger);
  --bs-btn-border-color: var(--danger-border);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--danger);
  --bs-btn-hover-border-color: var(--danger);
}

.btn-sm {
  border-radius: var(--radius-pill);
}

/* =========================================================
   App chrome — single sticky header (parity with BrokerQuote)
   ========================================================= */

.as-app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 45% at 100% -5%, rgba(255, 221, 0, 0.12), transparent 50%),
    var(--surface-page);
}

.as-app > .site-body {
  flex: 1 0 auto;
}

.as-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(34, 34, 32, 0.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

.as-header-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
  padding-block: 0.75rem;
}

.as-logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  text-decoration: none;
}

  .as-logo img {
    display: block;
    height: 2.15rem;
    width: auto;
  }

.as-nav {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: 0;
  overflow-x: auto;
}

.as-nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.as-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-pill);
  color: var(--brand-ink);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

  .as-nav-link:hover,
  .as-nav-link:focus {
    color: var(--brand-ink);
    background: rgba(34, 34, 32, 0.06);
  }

  .as-nav-link.is-active {
    color: var(--brand-ink);
    background: var(--brand-yellow);
  }

.as-header-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.as-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  font-weight: 750;
  text-decoration: none;
}

.as-cta-icon {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  color: #fff;
  background: var(--brand-ink);
  font-size: 0.85rem;
}

.as-menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
}

  .as-menu-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-ink);
  }

.as-mobile-nav {
  border-top: 1px solid var(--border);
  background: #fff;
}

  .as-mobile-nav .container {
    display: grid;
    gap: 1rem;
    padding-block: 1rem 1.25rem;
  }

  .as-mobile-nav .as-nav-list {
    flex-direction: column;
    align-items: stretch;
  }

  .as-mobile-nav .as-nav-link {
    justify-content: flex-start;
    padding: 0.85rem 1rem;
  }

.as-footer {
  margin-top: auto;
  padding: 2.5rem 0 1.25rem;
  color: rgba(247, 248, 245, 0.78);
  background: var(--brand-ink);
  border-top: 3px solid var(--brand-yellow);
}

.as-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
  margin-bottom: 2rem;
}

.as-footer-logo {
  display: block;
  height: 1.75rem;
  width: auto;
  margin-bottom: 0.85rem;
  filter: brightness(0) invert(1);
}

.as-footer-brand p {
  margin: 0;
  max-width: 22rem;
  color: rgba(247, 248, 245, 0.7);
  font-size: 0.92rem;
  line-height: 1.5;
}

.as-footer-col {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

  .as-footer-col h2 {
    margin: 0 0 0.35rem;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .as-footer-col a,
  .as-footer-col .cc-manage {
    color: rgba(247, 248, 245, 0.82);
    font-weight: 600;
    text-decoration: none;
  }

    .as-footer-col a:hover,
    .as-footer-col .cc-manage:hover {
      color: var(--brand-yellow);
    }

.as-footer-social {
  display: flex;
  gap: 0.5rem;
}

  .as-footer-social a {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    color: var(--brand-ink);
    background: var(--brand-yellow);
    font-size: 1rem;
  }

.as-footer-base {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

  .as-footer-base p {
    margin: 0;
  }

@media (max-width: 991.98px) {
  .as-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 575.98px) {
  .as-footer-grid {
    grid-template-columns: 1fr;
  }

  .as-header-bar {
    gap: 0.75rem;
    min-height: 3.75rem;
  }
}

body.auth-shell {
  background: #fff;
}

body.auth-shell .site-body,
body.auth-shell .site-body--flush {
  padding: 0;
  max-width: none;
  width: 100%;
}

body.auth-shell .site-body > main {
  padding: 0;
}

.auth-shell-page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100dvh;
  width: 100%;
}

.auth-promo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  color: #fff;
  background: #1c1c1a;
}

.auth-promo-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("/images/auth-hero-meeting.jpg") 62% center / cover no-repeat;
}

.auth-promo-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      90deg,
      rgba(20, 20, 18, 0.72) 0%,
      rgba(20, 20, 18, 0.38) 40%,
      rgba(20, 20, 18, 0.12) 70%,
      transparent 100%
    ),
    linear-gradient(
      0deg,
      rgba(20, 20, 18, 0.45) 0%,
      transparent 40%
    );
}

.auth-promo-inner {
  position: relative;
  z-index: 3;
  max-width: 28rem;
  margin-top: auto;
  align-self: flex-start;
}

.auth-promo-eyebrow {
  display: inline-flex;
  margin: 0 0 1.25rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  color: #222220;
  background: #ffdd00;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auth-promo-title {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.auth-promo-title > span {
  display: block;
}

.auth-promo-title-accent {
  color: #ffec00;
}

.auth-promo-title-light {
  color: #ffffff;
}

.auth-promo-copy {
  margin: 1.25rem 0 0;
  max-width: 24rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.55;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: #fff;
}

.auth-panel-inner {
  width: min(100%, 400px);
}

.auth-panel-logo {
  display: inline-flex;
  margin-bottom: 2rem;
  text-decoration: none;
}

  .auth-panel-logo img {
    display: block;
    height: 2rem;
    width: auto;
  }

/* Legacy centered auth pages (forgot / 2FA / consent, etc.) */
.auth-page {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 5.5rem);
  padding: clamp(1rem, 4vw, 3rem);
  overflow: hidden;
  background: var(--surface-page);
}

.auth-page::before {
  content: none;
}

.auth-decoration {
  display: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-width: 420px;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: none;
}

  .auth-card form,
  .auth-panel form {
    width: 100%;
  }

  .auth-card h1,
  .auth-card p {
    max-width: 100%;
  }

.auth-card--wide {
  width: min(100%, 520px);
  max-width: 520px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.auth-brand-logo {
  display: none;
}

.auth-brand-app {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--brand-ink);
  background: var(--brand-yellow);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auth-brand-mark,
.auth-brand-name,
.auth-brand-meta,
.auth-brand-product {
  display: none;
}

.auth-header {
  margin-bottom: 1.75rem;
}

.auth-eyebrow {
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-header h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.auth-header p {
  margin: 0.6rem 0 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.auth-field {
  margin-bottom: 1.15rem;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-field .form-label {
  display: inline-block;
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 650;
}

.auth-link {
  margin-bottom: 0.45rem;
  color: var(--brand-ink);
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

  .auth-link:hover {
    color: #000;
  }

  .auth-link:focus-visible {
    border-radius: 0.25rem;
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
  }

.auth-input-wrapper {
  position: relative;
}

  .auth-input-wrapper .form-control,
  .auth-input-wrapper .form-select {
    width: 100%;
    min-height: 3.35rem;
    padding: 0.85rem 3rem 0.85rem 2.85rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    color: var(--text);
    background: #f7f7f8;
    font-size: 0.95rem;
    caret-color: var(--brand-ink);
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  }

  .auth-input-wrapper .form-select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235e5e6e' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 14px 10px;
  }

    .auth-input-wrapper .form-control::placeholder {
      color: #9a9aa8;
    }

    .auth-input-wrapper .form-control:hover,
    .auth-input-wrapper .form-select:hover {
      border-color: #22222066;
      background: #fff;
    }

    .auth-input-wrapper .form-control:focus,
    .auth-input-wrapper .form-select:focus {
      border-color: var(--brand-ink);
      outline: none;
      background: #fff;
      box-shadow: 0 0 0 3px rgba(255, 221, 0, 0.45);
    }

    .auth-input-wrapper .form-control:-webkit-autofill,
    .auth-input-wrapper .form-control:-webkit-autofill:hover,
    .auth-input-wrapper .form-control:-webkit-autofill:focus {
      -webkit-text-fill-color: var(--text);
      -webkit-box-shadow: 0 0 0 1000px #fff inset;
      box-shadow: 0 0 0 1000px #fff inset;
      transition: background-color 9999s ease-out;
    }

.auth-input-wrapper--plain .form-control,
.auth-input-wrapper--plain .form-select {
  padding-left: 1.25rem;
}

.auth-input-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 1rem;
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  color: #8a919d;
  transform: translateY(-50%);
  pointer-events: none;
  transition: color 160ms ease;
}

.auth-input-wrapper:focus-within .auth-input-icon {
  color: var(--brand-ink);
}

.auth-input-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-password-toggle {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 0.85rem;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--brand-ink);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  transform: translateY(-50%);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

  .auth-password-toggle:hover {
    background: rgba(255, 221, 0, 0.35);
  }

  .auth-password-toggle:focus-visible {
    outline: 3px solid var(--focus-ring);
  }

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.35rem;
  margin-top: 0.65rem;
  padding: 0.35rem 0.35rem 0.35rem 1.4rem;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--brand-ink);
  background: var(--brand-yellow);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: none;
  transition: background-color 160ms ease, transform 160ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

  .auth-submit svg {
    flex: 0 0 auto;
    width: 2.65rem;
    height: 2.65rem;
    padding: 0.72rem;
    border-radius: 50%;
    color: #fff;
    background: #000;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease, background-color 160ms ease;
  }

  .auth-submit:hover {
    background: var(--brand-yellow-bright);
    box-shadow: none;
    transform: none;
  }

    .auth-submit:hover svg {
      transform: translateX(2px);
      background: #222220;
    }

  .auth-submit:active {
    transform: translateY(1px);
  }

  .auth-submit:focus-visible {
    outline: 4px solid var(--focus-ring);
    outline-offset: 2px;
  }

  .auth-submit:disabled,
  .auth-submit[aria-disabled="true"] {
    cursor: wait;
    opacity: 0.7;
    transform: none;
  }

.auth-submit--danger {
  justify-content: center;
  padding: 0.75rem 1.25rem;
  color: #fff;
  background: var(--danger);
}

  .auth-submit--danger svg {
    display: none;
  }

  .auth-submit--danger:hover {
    background: #912018;
  }

.auth-footnote {
  margin: 2rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: left;
}

@media (max-width: 991.98px) {
  .auth-shell-page {
    grid-template-columns: 1fr;
  }

  .auth-promo {
    justify-content: flex-end;
    align-items: flex-start;
    min-height: 240px;
    padding: 2rem 1.5rem;
  }

  .auth-promo-title {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .auth-promo-copy {
    margin-top: 0.85rem;
    font-size: 0.95rem;
  }

  .auth-panel {
    place-items: start center;
    padding: 1.75rem 1.25rem 2.5rem;
  }
}

@media (max-width: 575.98px) {
  .auth-promo {
    min-height: 220px;
  }
}

.auth-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.auth-actions--split {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 420px) {
  .auth-actions--split {
    grid-template-columns: 1fr;
  }
}

.auth-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  color: var(--text);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

  .auth-secondary:hover {
    color: var(--text);
    background: var(--surface-muted);
    border-color: var(--border-strong);
  }

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.25rem 0 1rem;
}

  .auth-check .form-check-input {
    margin-top: 0.2rem;
    border-color: var(--border-strong);
  }

    .auth-check .form-check-input:checked {
      background-color: var(--brand-ink);
      border-color: var(--brand-ink);
    }

  .auth-check .form-check-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 550;
  }

.auth-footer-note {
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.45;
}

  .auth-footer-note a {
    font-weight: 650;
  }

.auth-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}

  .auth-security-note svg {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: #77808d;
    stroke-width: 1.7px;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

.auth-password-rules__title {
  margin: 0 0 0.45rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 650;
}

.auth-password-rules {
  display: grid;
  gap: 0.3rem;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem 0.85rem 1.85rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  color: var(--text-muted);
  background: #f7f7f8;
  font-size: 0.85rem;
  line-height: 1.4;
}

.auth-status {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid #b6e3c2;
  border-radius: 0.75rem;
  color: #0f5132;
  background: #edf8f1;
  font-size: 0.85rem;
}

.auth-scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.auth-scope-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  color: var(--brand-ink);
  background: rgba(255, 221, 0, 0.28);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.validation-summary:empty,
.field-validation-error:empty {
  display: none;
}

.validation-summary {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--danger-border);
  border-radius: 0.75rem;
  color: #991b1b;
  background: var(--danger-bg);
  font-size: 0.85rem;
}

  .validation-summary ul {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding-left: 1.1rem;
  }

.field-validation-error {
  display: block;
  margin-top: 0.4rem;
  overflow-wrap: anywhere;
  color: var(--danger);
  font-size: 0.78rem;
}

.auth-input-wrapper .input-validation-error {
  border-color: #dc2626;
}

  .auth-input-wrapper .input-validation-error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
  }

/* Admin tables — light polish */
.admin-page {
  padding-block: 0.5rem 1.5rem;
}

.admin-page .table {
  --bs-table-bg: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-page .table thead th {
  background: var(--surface-muted);
  color: var(--brand-ink-muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom-width: 1px;
}

/* =========================================================
   Small-screen authentication layout
   ========================================================= */

@media (max-width: 575.98px) {
  .auth-page {
    place-items: start center;
    min-height: calc(100dvh - 4.25rem);
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  }

  .auth-card {
    margin-top: 0;
    padding: 1.25rem;
    border-radius: 1.1rem;
    box-shadow: var(--shadow-sm), 0 12px 30px rgba(34, 39, 32, 0.09);
  }

  .auth-brand {
    margin-bottom: 1.1rem;
  }

  .auth-header {
    margin-bottom: 1.2rem;
  }

    .auth-header p {
      margin-top: 0.45rem;
      line-height: 1.45;
    }

  .auth-field {
    margin-bottom: 1rem;
  }

  .auth-label-row {
    align-items: flex-end;
  }

  .auth-input-wrapper .form-control,
  .auth-input-wrapper .form-select {
    min-height: 3rem;
    font-size: 16px;
  }

  .auth-submit {
    min-height: 3.05rem;
  }

  .auth-security-note {
    margin-top: 1.1rem;
  }

  .auth-decoration {
    display: none;
  }
}

@media (max-width: 575.98px) and (max-height: 700px) {
  .auth-page {
    align-items: start;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .auth-card {
    padding: 1rem 1.15rem;
  }

  .auth-brand {
    margin-bottom: 0.75rem;
  }

  .auth-header {
    margin-bottom: 0.9rem;
  }

    .auth-header p {
      margin-top: 0.35rem;
    }

  .auth-field {
    margin-bottom: 0.8rem;
  }

  .auth-security-note {
    margin-top: 0.8rem;
  }
}

@media (max-width: 360px) {
  .auth-card {
    padding: 1.15rem;
  }

  .auth-header h1 {
    font-size: 1.55rem;
  }

  .auth-link {
    max-width: 8rem;
    text-align: right;
  }
}

@media (max-width: 340px) {
  .auth-card {
    padding-inline: 1rem;
  }

  .auth-label-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .auth-link {
    max-width: none;
    margin-top: -0.2rem;
    margin-bottom: 0.45rem;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit,
  .auth-submit svg,
  .auth-input-wrapper .form-control,
  .auth-input-wrapper .form-select,
  .auth-input-icon,
  .auth-decoration,
  .auth-card {
    animation: none;
    transition: none;
  }
}

/* =========================================================
   External providers + dividers
   ========================================================= */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.35rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

  .auth-divider::before,
  .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
  }

.auth-external {
  display: grid;
  gap: 0.65rem;
}

.auth-external-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.9rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  color: var(--text);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 650;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

  .auth-external-btn:hover {
    background: var(--surface-muted);
    border-color: var(--border-strong);
    transform: translateY(-1px);
  }

  .auth-external-btn i {
    font-size: 1.15rem;
  }

/* =========================================================
   Manage account shell
   ========================================================= */

.manage-shell {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding-block: 0.25rem 1.5rem;
}

.manage-hero {
  margin-bottom: 1.5rem;
}

.manage-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.manage-sidebar {
  position: sticky;
  top: 5.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.manage-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.manage-nav-link {
  display: block;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}

  .manage-nav-link:hover {
    color: var(--text);
    background: var(--surface-muted);
  }

  .manage-nav-link.active {
    color: var(--brand-ink);
    background: rgba(255, 221, 0, 0.35);
  }

.manage-content,
.manage-panel {
  min-width: 0;
}

.manage-panel,
.manage-content > *:not(.manage-panel) {
  /* Package pages render raw content into manage-content */
}

.manage-content {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm), var(--shadow-md);
}

.manage-panel-header {
  margin-bottom: 1.25rem;
}

.manage-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.manage-panel-lead {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.manage-status {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  font-size: 0.9rem;
}

  .manage-status strong {
    font-weight: 750;
  }

  .manage-status--ok {
    border-color: #b6e3c2;
    color: #0f5132;
    background: #edf8f1;
  }

  .manage-status--warn {
    border-color: #f5d78e;
    color: #7a5a00;
    background: #fff8e6;
  }

  .manage-status--danger {
    border-color: var(--danger-border);
    color: #991b1b;
    background: var(--danger-bg);
  }

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
}

.manage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.manage-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-page);
}

.manage-card-icon {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  color: var(--brand-ink);
  background: var(--brand-yellow);
  font-size: 1.1rem;
}

.manage-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
}

.manage-card-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.manage-card-text--ok {
  color: #0f5132;
}

.manage-steps {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding-left: 1.25rem;
}

  .manage-steps li::marker {
    font-weight: 800;
    color: #8a6d00;
  }

  .manage-steps p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
  }

.manage-key-row {
  margin: 0.75rem 0;
}

.manage-key {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  color: var(--brand-ink);
  background: rgba(255, 221, 0, 0.28);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.manage-qr {
  margin: 0.75rem 0;
  padding: 1rem;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.manage-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.manage-info-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.manage-form .auth-submit {
  margin-top: 0.25rem;
}

/* Soften Identity Default UI content inside manage shell */
.manage-content > h3,
.manage-content > h4 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.manage-content .btn-primary {
  border-color: var(--brand-yellow-deep);
  color: var(--brand-ink);
  background: var(--brand-yellow);
  font-weight: 700;
}

  .manage-content .btn-primary:hover {
    border-color: var(--brand-yellow-deep);
    color: var(--brand-ink);
    background: var(--brand-yellow-hover);
  }

.manage-content .form-floating > .form-control,
.manage-content .form-control {
  border-radius: var(--radius-md);
}

.manage-content .form-floating > .form-control:focus,
.manage-content .form-control:focus {
  border-color: var(--brand-yellow-deep);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

@media (max-width: 900px) {
  .manage-layout {
    grid-template-columns: 1fr;
  }

  .manage-sidebar {
    position: static;
  }

  .manage-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .manage-nav-link {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* =========================================================
   Admin surfaces
   ========================================================= */

.admin-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-block: 0.5rem 2rem;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.admin-search {
  position: relative;
  flex: 1 1 240px;
}

  .admin-search i {
    position: absolute;
    top: 50%;
    left: 0.85rem;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
  }

  .admin-search .form-control {
    padding-left: 2.35rem;
    min-height: 2.75rem;
  }

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.9rem;
}

  .admin-table thead th {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--brand-ink-muted);
    background: var(--surface-muted);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .admin-table tbody td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }

  .admin-table tbody tr:last-child td {
    border-bottom: 0;
  }

  .admin-table tbody tr:hover td {
    background: rgba(255, 221, 0, 0.08);
  }

.admin-primary {
  font-weight: 700;
}

.admin-id {
  display: inline-block;
  margin-top: 0.2rem;
  max-width: 12rem;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-empty {
  padding: 2rem 1rem !important;
  color: var(--text-muted);
  text-align: center;
}

.admin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 14rem;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  color: var(--brand-ink);
  background: rgba(255, 221, 0, 0.28);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-chip[title] {
  cursor: help;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 750;
}

.admin-badge--ok {
  color: #0f5132;
  background: #edf8f1;
}

.admin-badge--warn {
  color: #7a5a00;
  background: #fff8e6;
}

.admin-badge--danger {
  color: #991b1b;
  background: #fef2f2;
}

.admin-badge--muted {
  color: var(--text-muted);
  background: var(--surface-muted);
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-meta {
  margin-top: 0.85rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-form-card {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm), var(--shadow-md);
}

.admin-form-card--danger {
  border-color: #fecaca;
}

.admin-fieldset {
  margin: 1.25rem 0 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

  .admin-fieldset legend {
    padding: 0 0.35rem;
    float: none;
    width: auto;
    font-size: 0.8rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

.admin-role-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-role-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted, #f7f7f5);
  cursor: pointer;
}

  .admin-role-option:hover {
    border-color: rgba(34, 34, 32, 0.22);
    background: #fff;
  }

  .admin-role-option input {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0.15rem 0 0;
  }

  .admin-role-option__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
  }

  .admin-role-option__title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--brand-ink);
    line-height: 1.25;
  }

  .admin-role-option__code {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
  }

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.admin-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
  gap: 1.35rem;
  align-items: start;
}

.admin-actions-card {
  position: sticky;
  top: 5.75rem;
  padding: 1.35rem 1.25rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm), var(--shadow-md);
}

.admin-action-stack {
  display: grid;
  gap: 0.55rem;
}

  .admin-action-stack > form {
    margin: 0;
  }

  .admin-action-stack .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding-inline: 1rem;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
  }

.admin-inline-confirm__panel {
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-muted, #f7f7f5);
}

  .admin-inline-confirm__panel p {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    line-height: 1.4;
  }

.admin-inline-confirm__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

  .admin-inline-confirm__actions .btn {
    flex: 1 1 7rem;
  }

.admin-dl {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

  .admin-dl > div {
    display: grid;
    gap: 0.15rem;
  }

  .admin-dl dt {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .admin-dl dd {
    margin: 0;
  }

.admin-divider {
  margin: 1.25rem 0;
  border: 0;
  border-top: 1px solid var(--border);
  opacity: 1;
}

.admin-details {
  max-width: 28rem;
}

.admin-ua {
  margin-top: 0.25rem;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .admin-edit-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions-card {
    position: static;
  }
}

