.preauth-shell {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-items: stretch;
  background:
    radial-gradient(circle at 78% 20%, rgb(27 42 48 / 46%) 0, transparent 34%),
    radial-gradient(circle at 22% 84%, rgb(77 55 20 / 18%) 0, transparent 30%),
    #05090b;
  color: #ece8df;
}

.preauth-frame {
  position: relative;
  min-height: calc(100vh - 56px);
  border: 1px solid #263239;
  background:
    linear-gradient(90deg, transparent 0 49.9%, rgb(196 154 88 / 5%) 50%, transparent 50.1%),
    linear-gradient(0deg, transparent 0 49.9%, rgb(196 154 88 / 4%) 50%, transparent 50.1%),
    rgb(6 11 14 / 94%);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.preauth-frame::after {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  right: -180px;
  top: 90px;
  border: 1px solid rgb(196 154 88 / 17%);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgb(196 154 88 / 3%),
    0 0 0 150px rgb(196 154 88 / 2%);
  pointer-events: none;
}

.preauth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 28px;
  border-bottom: 1px solid #263239;
  max-width: none;
  margin: 0;
}

.preauth-mark {
  width: 34px;
  height: 34px;
  border: 1px solid #c49a58;
  display: grid;
  place-items: center;
  color: #c49a58;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.preauth-brand div {
  display: grid;
  gap: 3px;
}

.preauth-brand strong {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
}

.preauth-brand span:last-child {
  font-size: 0.58rem;
  letter-spacing: 0.13em;
  color: #778289;
}

.preauth-content {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 56px));
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 72px;
  align-items: center;
  padding: 64px 0;
}

.preauth-heading {
  max-width: 720px;
}

.preauth-kicker {
  margin: 0 0 22px;
  color: #c49a58;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.preauth-heading h1 {
  margin: 0;
  max-width: 700px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 6.5vw, 6.7rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.045em;
  text-transform: none;
}

.preauth-lead {
  margin: 30px 0 0;
  max-width: 620px;
  color: #a5adb0;
  line-height: 1.8;
  font-size: 1rem;
}

.preauth-access {
  border: 1px solid #344148;
  background: rgb(8 14 17 / 88%);
  padding: 28px;
  box-shadow: 0 20px 80px rgb(0 0 0 / 28%);
}

.preauth-access-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid #263239;
}

.preauth-access-top p {
  margin: 0;
  color: #c7cdcf;
  font-size: 0.82rem;
  line-height: 1.5;
}

.preauth-status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #54b77b;
  box-shadow: 0 0 0 5px rgb(84 183 123 / 10%);
}

.preauth-google-signin {
  min-height: 44px;
  display: flex;
  align-items: center;
  margin-top: 24px;
}

.preauth-invite {
  margin: 18px 0 0;
  color: #778289;
  font-size: 0.72rem;
  line-height: 1.6;
}

.preauth-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  border-top: 1px solid #263239;
  color: #69747a;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.preauth-footer a {
  color: #c49a58;
  text-decoration: none;
}

.preauth-footer a:hover,
.preauth-footer a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .preauth-shell {
    padding: 14px;
  }

  .preauth-frame {
    min-height: calc(100vh - 28px);
  }

  .preauth-content {
    width: min(680px, calc(100% - 40px));
    grid-template-columns: 1fr;
    gap: 42px;
    padding: 50px 0;
  }

  .preauth-heading h1 {
    font-size: clamp(3rem, 12vw, 5.4rem);
  }

  .preauth-frame::after {
    opacity: 0.45;
    right: -390px;
  }
}

@media (max-width: 560px) {
  .preauth-brand,
  .preauth-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .preauth-content {
    width: calc(100% - 36px);
  }

  .preauth-footer {
    flex-direction: column;
  }
}

/* Failure is actionable without changing the existing identity controls. */
.preauth-access[data-state="error"] .preauth-status-dot {
  background: #c49a58;
  box-shadow: 0 0 0 5px rgb(196 154 88 / 10%);
}

.preauth-access[data-state="error"] .preauth-google-signin {
  display: block;
}

.preauth-retry {
  padding: 12px 18px;
  border: 1px solid #c49a58;
  background: #c49a58;
  color: #05090b;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.preauth-retry:focus-visible {
  outline: 2px solid #ece8df;
  outline-offset: 4px;
}

.preauth-retry:disabled {
  opacity: 0.65;
  cursor: wait;
}

.preauth-diagnostic {
  margin-top: 18px;
  color: #c7cdcf;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.preauth-diagnostic summary { cursor: pointer; }
