.tenant-auth {
  --accent: #ad3810;
  --accent-hover: #8b280a;
  --soft: #fbecdf;
  --ink: #2a1b15;
  --stroke: #dfd6d0;
  --line: #eee4dd;
  background: #fbf6f1;
}

.tenant-auth-page {
  padding: clamp(16px, 4vw, 64px);
  background:
    radial-gradient(ellipse at 8% 88%, #f6ddca 0, transparent 48%),
    radial-gradient(ellipse at 96% 8%, #fffdfb 0, transparent 52%),
    #f9f3ed;
}

.tenant-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(350px, .87fr);
  width: min(100%, 1100px);
  min-height: 548px;
  overflow: hidden;
  border: 1px solid #e9d9cf;
  border-radius: 26px;
  background: #fffdfb;
  box-shadow: 0 22px 65px #53230e1a, 0 3px 12px #53230e0b;
  animation: tenant-auth-arrive .46s ease-out both;
}
@keyframes tenant-auth-arrive {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.tenant-auth-visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 56% 43%, #a7532f 0, #6d3729 30%, transparent 70%),
    radial-gradient(ellipse at 88% 91%, #713a22, transparent 62%),
    linear-gradient(146deg, #271c1c 5%, #402723 66%, #271c1c);
}
.tenant-auth-visual::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle, #ffdfbe 1px, transparent 1.6px) center / 20px 20px;
  mask-image: radial-gradient(ellipse at center, transparent 12%, black 62%);
  opacity: .24;
  content: "";
}
.tenant-auth-visual::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(145deg, transparent 40%, #ffb87e19 49%, transparent 57%);
  content: "";
}

.tenant-auth-art {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 470px;
  height: 374px;
  transform: translate(-50%, -50%);
  color: #ffd4b5;
}
.tenant-auth-art > * { position: absolute; }
.tenant-network-bus {
  width: 1px;
  background: #e69862;
  box-shadow: 0 0 8px #f99c6199;
}
.tenant-network-bus--in { left: 124px; top: 65px; height: 242px; }
.tenant-network-bus--out { left: 343px; top: 116px; height: 148px; }
.tenant-network-line {
  height: 1px;
  background: linear-gradient(90deg, #ffb17180, #ffb171);
  box-shadow: 0 0 7px #f9a06b70;
}
.tenant-network-line::after {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: #ffe3cc;
  box-shadow: 0 0 8px #ffd09cba;
  content: "";
}
.tenant-network-line--database, .tenant-network-line--fields, .tenant-network-line--request { left: 90px; width: 34px; }
.tenant-network-line--database { top: 65px; }
.tenant-network-line--fields { top: 186px; }
.tenant-network-line--request { top: 306px; }
.tenant-network-line--in { top: 186px; left: 124px; width: 53px; }
.tenant-network-line--out { top: 186px; left: 291px; width: 52px; }
.tenant-network-line--api, .tenant-network-line--event { left: 343px; width: 36px; }
.tenant-network-line--api { top: 116px; }
.tenant-network-line--event { top: 263px; }
.tenant-network-line--api::after, .tenant-network-line--event::after {
  top: -3px;
  right: 2px;
  transform: rotate(45deg);
  border-radius: 0;
  border-block-start: 1.5px solid #ffd1a9;
  border-inline-end: 1.5px solid #ffd1a9;
  box-shadow: none;
  background: transparent;
}

.tenant-network-node {
  display: grid;
  width: 76px;
  height: 60px;
  place-items: center;
  border: 1px solid #e5a88398;
  border-radius: 11px;
  background: linear-gradient(145deg, #593526, #37221c);
  box-shadow: 0 6px 20px #260e0b48, inset 0 1px #ffe3bc20;
}
.tenant-network-node--database, .tenant-network-node--fields, .tenant-network-node--request { left: 14px; }
.tenant-network-node--database { top: 35px; }
.tenant-network-node--fields { top: 156px; }
.tenant-network-node--request { top: 276px; }
.tenant-network-node--api, .tenant-network-node--event { left: 379px; }
.tenant-network-node--api { top: 86px; }
.tenant-network-node--event { top: 233px; }
.tenant-network-node i { position: relative; display: block; font-style: normal; }
.tenant-network-node--database i {
  width: 28px;
  height: 30px;
  border: 1.5px solid;
  border-radius: 50% / 19%;
  background: repeating-linear-gradient(to bottom, transparent 0 7px, #f9c8a471 8px 9px);
}
.tenant-network-node--database i::before {
  position: absolute;
  inset: -1px -1px auto;
  height: 11px;
  border: 1.5px solid;
  border-radius: 50%;
  background: #603720;
  content: "";
}
.tenant-network-node--fields i {
  width: 31px;
  height: 26px;
  border: 1.5px solid;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent 34%, currentColor 35% 39%, transparent 40%),
    repeating-linear-gradient(to bottom, transparent 0 6px, #f9c8a4a0 7px 8px);
}
.tenant-network-node--request i::before { content: "{ }"; font: 24px Consolas, monospace; }
.tenant-network-node--api i::before { content: "</>"; font: 19px Consolas, monospace; }
.tenant-network-node--event i {
  width: 29px;
  height: 21px;
  border: 1.5px solid;
  border-radius: 4px;
}
.tenant-network-node--event i::before {
  position: absolute;
  top: -4px;
  left: 6px;
  width: 13px;
  height: 13px;
  border-inline-end: 1.5px solid;
  border-block-end: 1.5px solid;
  transform: rotate(45deg);
  content: "";
}

.tenant-network-gateway {
  top: 129px;
  left: 177px;
  display: grid;
  width: 114px;
  height: 114px;
  place-items: center;
  border: 1px solid #ffd0aa;
  border-radius: 21px;
  background:
    radial-gradient(circle at 55% 30%, #ffb07759, transparent 70%),
    linear-gradient(140deg, #aa4f25, #5f2d1d);
  box-shadow: inset 0 2px #ffe0b643, 0 0 34px #ffad6d74, 0 14px 28px #2a0e0b58;
}
.tenant-network-gateway::before, .tenant-network-gateway::after {
  position: absolute;
  top: 33px;
  width: 5px;
  height: 46px;
  background: repeating-linear-gradient(180deg, #ffcb9e 0 2px, transparent 2px 11px);
  content: "";
}
.tenant-network-gateway::before { left: -6px; }
.tenant-network-gateway::after { right: -6px; }
.tenant-network-gateway img { width: 53px; height: 53px; box-shadow: 0 5px 13px #5c1e1e59; border-radius: 13px; }
.login.tenant-auth-form {
  align-self: center;
  width: 100%;
  min-width: 0;
  padding: clamp(26px, 4vw, 62px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.tenant-auth-header { margin-bottom: 25px; }
.tenant-auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 21px;
  color: #5c3827;
  font-size: 14px;
  font-weight: 650;
}
.tenant-auth-brand img { display: block; width: 32px; height: 32px; }
.tenant-auth-header h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: -.025em; }
.tenant-auth-form form { gap: 16px; }
.tenant-auth-form label { color: #442c20; }
.tenant-auth-form input { min-height: 44px; padding-inline: 12px; border-radius: 8px; }
.tenant-auth :is(input, select, textarea):focus-visible { outline-color: #edab86; }
.tenant-auth-form form .button.primary { min-height: 44px; margin-top: 4px; border-radius: 8px; }
.tenant-auth-form .registration-nav { flex-wrap: wrap; }
.tenant-auth-form .registration-nav .button { margin: 0; border-radius: 7px; }
.tenant-auth-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 16px;
  padding: 8px 13px 8px 10px;
  border: 1px solid #efd6c4;
  border-radius: 8px;
  background: #fff5ed;
  color: #843316;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.tenant-auth-link:is(:hover, :focus-visible) {
  border-color: #d98c61;
  background: #ffeddf;
  box-shadow: 0 3px 9px #8f321011;
}
.tenant-auth-link-mark {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  background: #f7ddcb;
}
.tenant-auth-link-mark::before {
  width: 12px;
  height: 12px;
  background:
    linear-gradient(currentColor, currentColor) center / 12px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 12px no-repeat;
  content: "";
}
.tenant-auth-link-arrow {
  width: 8px;
  height: 8px;
  margin-inline: 2px;
  border-block-start: 1.5px solid;
  border-inline-end: 1.5px solid;
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.tenant-auth-link:is(:hover, :focus-visible) .tenant-auth-link-arrow {
  transform: translateX(3px) rotate(45deg);
}
.tenant-auth-link--back { grid-template-columns: auto minmax(0, 1fr); padding-inline-start: 15px; }
.tenant-auth-link--back .tenant-auth-link-arrow { transform: rotate(-135deg); }
.tenant-auth-link--back:is(:hover, :focus-visible) .tenant-auth-link-arrow {
  transform: translateX(-3px) rotate(-135deg);
}
.tenant-auth-form .hint:empty { display: none; }
.tenant-auth #challenge-range {
  appearance: none;
  display: block;
  height: 42px;
  margin: 4px 0 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
  touch-action: none;
  cursor: grab;
}
.tenant-auth #challenge-range:active { cursor: grabbing; }
.tenant-auth #challenge-range::-webkit-slider-runnable-track {
  height: 14px;
  border: 1px solid #e7c3ae;
  border-radius: 20px;
  background: #fae5d7;
}
.tenant-auth #challenge-range::-moz-range-track {
  height: 14px;
  border: 1px solid #e7c3ae;
  border-radius: 20px;
  background: #fae5d7;
}
.tenant-auth #challenge-range::-webkit-slider-thumb {
  appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -9px;
  border: 2px solid #fff4ea;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 5px #7534195e;
}
.tenant-auth #challenge-range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 2px solid #fff4ea;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 5px #7534195e;
}
.tenant-auth .challenge-click { cursor: crosshair; touch-action: manipulation; }
.tenant-auth .challenge-click:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 740px) {
  .tenant-auth-page { padding: clamp(12px, 3vw, 24px); }
  .tenant-auth-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 460px);
    min-height: 0;
    border-radius: 18px;
  }
  .tenant-auth-visual { min-height: clamp(142px, 41vw, 182px); }
  .tenant-auth-art { transform: translate(-50%, -50%) scale(.44); }
  .login.tenant-auth-form { padding: clamp(20px, 5vw, 30px); }
  .tenant-auth-header { margin-bottom: 19px; }
  .tenant-auth-brand { margin-bottom: 14px; }
  .tenant-auth-form input { font-size: 16px; }
}

@media (forced-colors: active) {
  .tenant-auth-shell { grid-template-columns: minmax(0, 1fr); width: min(100%, 460px); }
  .tenant-auth-visual { display: none; }
  .tenant-auth #challenge-range { appearance: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .tenant-auth-shell { animation: none; }
  .tenant-auth-link, .tenant-auth-link-arrow { transition: none; }
}
.tenant-login-error { width: min(100% - 28px, 420px); border-color: #ead9cd; }
.tenant-login-error h2 { font-size: 18px; color: #302019; }
.tenant-login-error p { color: var(--muted); overflow-wrap: anywhere; }
.tenant-login-error button { min-width: 75px; }
