html.wx-auth-pending,
html.wx-auth-pending body {
  min-height: 100%;
  overflow: hidden;
}

html.wx-auth-pending body {
  background: #090805;
}

html.wx-auth-pending .layout {
  display: none !important;
}

/* Every application page stays invisible until the shared guard validates an
   active staff account. The gate is the only body child allowed while locked. */
html:not(.wx-authenticated) body > *:not(.treatment-auth-gate) {
  display: none !important;
}

html.wx-authenticated #login,
html.wx-authenticated #loginModal {
  display: none !important;
}

.treatment-auth-gate {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #f8f2df;
  background:
    radial-gradient(circle at 18% 14%, rgba(194, 151, 63, .18), transparent 34%),
    radial-gradient(circle at 82% 82%, rgba(118, 32, 29, .24), transparent 36%),
    linear-gradient(145deg, #070604, #171109 54%, #090705);
  font-family: inherit;
}

.treatment-auth-gate[hidden] {
  display: none !important;
}

.treatment-auth-card {
  position: relative;
  isolation: isolate;
  width: min(480px, 100%);
  overflow: hidden;
  border: 1px solid rgba(218, 180, 91, .32);
  border-radius: 26px;
  background: rgba(20, 16, 10, .94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .55), inset 0 1px rgba(255, 255, 255, .05);
  backdrop-filter: blur(22px);
}

.treatment-auth-accent {
  height: 4px;
  background: linear-gradient(90deg, #6d1716, #d6aa52, #f5dd9d, #d6aa52, #6d1716);
}

.treatment-auth-body {
  padding: 32px;
}

.treatment-auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.treatment-auth-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(218, 180, 91, .18));
}

.treatment-auth-brand strong,
.treatment-auth-brand span {
  display: block;
}

.treatment-auth-brand strong {
  color: #f6dfaa;
  font-size: 18px;
}

.treatment-auth-brand span {
  margin-top: 2px;
  color: #95896e;
  font-size: 11px;
  letter-spacing: .14em;
}

.treatment-auth-body h1 {
  margin: 0 0 8px;
  color: #fff8e9;
  font-size: clamp(24px, 6vw, 31px);
}

.treatment-auth-lead {
  margin: 0 0 24px;
  color: #b9ad94;
  line-height: 1.65;
}

.treatment-auth-form label {
  display: block;
  margin: 0 0 15px;
  color: #d9c9a7;
  font-size: 13px;
}

.treatment-auth-form input {
  box-sizing: border-box;
  width: 100%;
  margin-top: 7px;
  padding: 13px 14px;
  border: 1px solid rgba(218, 180, 91, .22);
  border-radius: 12px;
  outline: 0;
  color: #fff9e9;
  background: rgba(255, 255, 255, .045);
  font: inherit;
}

.treatment-auth-form input:focus {
  border-color: #d8ae5a;
  box-shadow: 0 0 0 3px rgba(216, 174, 90, .12);
}

.treatment-auth-submit {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  color: #241505;
  background: linear-gradient(135deg, #f2d488, #bd8731);
  box-shadow: 0 12px 28px rgba(189, 135, 49, .2);
  font: inherit;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.treatment-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 32px rgba(189, 135, 49, .28);
}

.treatment-auth-submit:focus-visible {
  outline: 3px solid rgba(245, 221, 157, .3);
  outline-offset: 3px;
}

.treatment-auth-submit:disabled {
  cursor: wait;
  opacity: .65;
}

.treatment-auth-message {
  min-height: 21px;
  margin: 17px 0 0;
  color: #c7bca4;
  font-size: 13px;
  line-height: 1.55;
}

.treatment-auth-message.error {
  color: #ffaaa0;
}

.treatment-auth-message.denied {
  margin-bottom: 0;
  color: #d7c7a4;
}

.treatment-auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.treatment-auth-route-note {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
  align-items: center;
  margin-bottom: 4px;
  padding: 13px 14px;
  border: 1px solid rgba(218, 180, 91, .16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(214, 170, 82, .09), rgba(255, 255, 255, .025));
}

.treatment-auth-route-seal {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(245, 221, 157, .55);
  border-radius: 15px 15px 15px 5px;
  color: #f6d77f;
  background: linear-gradient(145deg, #8d2c24, #551713);
  box-shadow: inset 0 0 0 3px rgba(43, 8, 7, .42), 0 9px 24px rgba(0, 0, 0, .26);
  font: 700 24px serif;
}

.treatment-auth-route-copy strong,
.treatment-auth-route-copy span {
  display: block;
}

.treatment-auth-route-copy strong {
  color: #f7e7ba;
  font-size: 13px;
}

.treatment-auth-route-copy span {
  margin-top: 3px;
  color: #9f9276;
  font-size: 11px;
  line-height: 1.55;
}

.treatment-auth-submit--secondary {
  border: 1px solid rgba(218, 180, 91, .26);
  color: #e7d8b5;
  background: rgba(255, 255, 255, .035);
  box-shadow: none;
}

.treatment-auth-submit--secondary:hover {
  border-color: rgba(245, 221, 157, .5);
  background: rgba(255, 255, 255, .065);
  box-shadow: none;
}

.treatment-auth-action-arrow {
  margin-left: auto;
  font-family: sans-serif;
  font-size: 18px;
  line-height: 1;
}

.treatment-auth-gate[data-state="denied"] .treatment-auth-card::after {
  position: absolute;
  z-index: -1;
  right: -72px;
  bottom: -90px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(214, 170, 82, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(214, 170, 82, .025), 0 0 0 56px rgba(214, 170, 82, .018);
  content: '';
}

.treatment-auth-security {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .075);
  color: #807660;
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 520px) {
  .treatment-auth-gate {
    padding: 14px;
  }

  .treatment-auth-body {
    padding: 25px 21px;
  }

  .treatment-auth-brand {
    margin-bottom: 22px;
  }

  .treatment-auth-route-note {
    grid-template-columns: 42px 1fr;
    padding: 12px;
  }

  .treatment-auth-route-seal {
    width: 42px;
    height: 42px;
    border-radius: 13px 13px 13px 4px;
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .treatment-auth-submit {
    transition: none;
  }
}
