#authGate[hidden],
#appShell[hidden] {
  display: none;
}

.auth-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  padding: clamp(42px, 6.25vw, 96px);
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 246, 218, .96), transparent 32%),
    linear-gradient(90deg, #ead3a8 0%, #dfc393 41%, #a57945 62%, #24180e 100%);
  color: #283a2e;
}

.auth-shell::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(241, 219, 178, .22), transparent 48%),
    radial-gradient(ellipse at center, transparent 48%, rgba(24, 14, 7, .28) 115%);
}

.auth-scene {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 auto;
  width: 66%;
  background: url("./assets/lampstand-study-desk.webp") right center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .2) 8%, #000 28%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .2) 8%, #000 28%);
}

.auth-card {
  position: relative;
  z-index: 2;
  width: min(540px, 44vw);
  min-height: calc(100svh - clamp(84px, 12.5vw, 192px));
  display: flex;
  flex-direction: column;
}

.auth-brand {
  padding: 0;
  color: #182d23;
}

.auth-brand .brand-mark {
  width: 45px;
  height: 45px;
  padding: 8px;
  border-radius: 50%;
  background: #274b3b;
  box-shadow: 0 5px 16px rgba(39, 75, 59, .18);
}

.auth-brand .brand-mark span {
  width: 6px;
  background: #e7c88e;
}

.auth-brand .brand-mark span:nth-child(1) { height: 12px; }
.auth-brand .brand-mark span:nth-child(2) { height: 22px; }
.auth-brand .brand-mark span:nth-child(3) { height: 16px; }

.auth-brand strong {
  font-size: 19px;
}

.auth-brand small {
  color: rgba(40, 48, 40, .78);
  font-size: 12px;
}

.auth-copy {
  margin-top: clamp(46px, 7vh, 72px);
}

.auth-copy .panel-kicker {
  margin-bottom: 14px;
  color: #4e4636;
  font-size: 11px;
  letter-spacing: .15em;
}

.auth-copy h1 {
  max-width: 540px;
  margin: 0 0 14px;
  color: #173526;
  font-size: clamp(38px, 2.85vw, 44px);
  line-height: 1.04;
  letter-spacing: -.055em;
  white-space: nowrap;
}

.auth-description {
  max-width: 49ch;
  margin: 0;
  color: #463f33;
  font-size: 15px;
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
  width: min(495px, 100%);
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field span {
  font: 700 10px var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #574c3b;
}

.auth-field input,
.invite-form input {
  border: 1px solid rgba(87, 68, 41, .38);
  background: rgba(255, 250, 238, .82);
  border-radius: 8px;
  padding: 14px 16px;
  color: #2e3029;
  font: 14px var(--sans);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 5px 18px rgba(72, 51, 27, .06);
}

.auth-field input:focus,
.invite-form input:focus {
  border-color: rgba(198,107,61,.45);
  box-shadow: 0 0 0 3px rgba(198,107,61,.08);
}

.auth-submit {
  width: fit-content;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 9px;
  background: #214d3a;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(33, 77, 58, .16);
}

.auth-result {
  width: min(495px, 100%);
  margin-top: 26px;
  border: 1px solid rgba(87, 68, 41, .28);
  background: rgba(239, 222, 190, .54);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 9px;
  backdrop-filter: blur(4px);
}

.auth-result strong {
  font: 700 13px var(--sans);
}

.auth-result p {
  margin: 0;
  color: #5c5140;
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}

.auth-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.auth-note {
  max-width: 495px;
  margin: 22px 0 0;
  color: #574d3f;
  font-size: 10px;
  line-height: 1.6;
}

.auth-wordmark {
  width: min(500px, 100%);
  margin-top: auto;
  padding-top: clamp(18px, 2.5vh, 28px);
  text-align: center;
  color: #5b4427;
}

.ornament-line,
.lamp-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ornament-line span,
.lamp-emblem span {
  height: 1px;
  flex: 1;
  background: rgba(91, 68, 39, .38);
}

.ornament-line i,
.ornament-line b {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  opacity: .72;
}

.auth-wordmark > strong {
  display: block;
  margin: 13px 0 4px;
  font: 400 clamp(48px, 5vw, 72px)/1 var(--serif);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-wordmark > p {
  margin: 0 0 7px;
  font: 400 15px/1.4 var(--serif);
  letter-spacing: .05em;
}

.lamp-emblem svg {
  width: 42px;
  height: 34px;
  fill: #5b4427;
  stroke: #5b4427;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.lamp-emblem .flame-inner {
  fill: #e5c37e;
  stroke: none;
}

.auth-wordmark blockquote {
  margin: 8px 0 3px;
  font: italic 14px/1.5 var(--serif);
}

.auth-wordmark > small {
  font: 500 10px var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
}

.designer-credit {
  position: absolute;
  z-index: 3;
  right: 24px;
  bottom: 22px;
  width: 204px;
  padding: 10px 13px 9px;
  border: 1px solid rgba(240, 218, 178, .44);
  border-radius: 11px;
  background: rgba(246, 233, 206, .88);
  box-shadow: 0 12px 32px rgba(12, 8, 4, .3);
  backdrop-filter: blur(8px);
  text-align: center;
}

.designer-credit img {
  display: block;
  width: 100%;
  height: auto;
}

.designer-credit span {
  display: block;
  margin-top: 4px;
  color: #493927;
  font: 600 10px var(--sans);
  letter-spacing: .06em;
}

.account-summary {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.5);
  margin-bottom: 16px;
}

.account-summary strong {
  font: 700 15px var(--sans);
}

.account-summary small {
  color: var(--muted);
}

.invite-form {
  display: grid;
  gap: 14px;
}

.modal-field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.modal-field span {
  font: 700 10px var(--sans);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal-field input,
.modal-field select,
.modal-field textarea {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.58);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  font: 13px var(--sans);
  outline: none;
}

.modal-field textarea {
  resize: vertical;
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
  border-color: rgba(198,107,61,.45);
  box-shadow: 0 0 0 3px rgba(198,107,61,.08);
}

.modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-row {
  gap: 12px;
  flex-wrap: wrap;
}

.danger-button {
  color: var(--terracotta);
}

@media (max-width: 980px) {
  .auth-shell {
    padding: 42px;
  }

  .auth-card {
    width: min(520px, 56vw);
  }

  .auth-brand {
    justify-content: flex-start;
  }

  .auth-brand div:last-child,
  .auth-brand strong,
  .auth-brand small {
    display: block;
    font-size: revert;
  }

  .auth-brand strong {
    font-size: 17px;
  }

  .auth-brand small {
    font-size: 11px;
  }

  .auth-scene {
    width: 72%;
  }

  .designer-credit {
    width: 190px;
  }
}

@media (max-width: 780px) {
  .auth-shell {
    min-height: 100svh;
    height: auto;
    overflow: visible;
    padding: 20px 16px 24px;
    background: #dfc393;
  }

  .auth-shell::before {
    background: linear-gradient(180deg, transparent 18%, rgba(228, 204, 161, .72) 36%, #dfc393 55%);
  }

  .auth-scene {
    width: 100%;
    height: 340px;
    background-position: 68% 38%;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  }

  .auth-card {
    width: 100%;
    min-height: 0;
    margin-top: 238px;
    padding: 23px 20px 25px;
    border: 1px solid rgba(87, 68, 41, .23);
    border-radius: 15px;
    background: rgba(244, 226, 190, .91);
    box-shadow: 0 18px 45px rgba(63, 42, 19, .16);
    backdrop-filter: blur(9px);
  }

  .auth-copy {
    margin-top: 36px;
  }

  .auth-copy h1 {
    font-size: clamp(36px, 11vw, 48px);
    white-space: normal;
  }

  .auth-description {
    font-size: 14px;
  }

  .auth-wordmark {
    margin-top: 36px;
    padding-top: 0;
  }

  .auth-wordmark > strong {
    font-size: clamp(34px, 10vw, 42px);
    letter-spacing: .06em;
  }

  .auth-wordmark > p {
    font-size: 13px;
  }

  .designer-credit {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(218px, 70vw);
    margin: 20px 0 0 auto;
  }
}
