:root {
  --auth-ink: #160e27;
  --auth-paper: #fffdf8;
  --auth-paper-2: #f7f1e8;
  --auth-violet: #6630c9;
  --auth-violet-dark: #2b1761;
  --auth-gold: #f1c75b;
  --auth-rule: rgba(22, 14, 39, 0.18);
  --auth-danger: #a3392f;
  --auth-success: #176b46;
  --auth-shadow: 0 1.4rem 4rem rgba(22, 14, 39, 0.18);
  --auth-display: "Source Serif 4", Georgia, serif;
  --auth-body: "Source Sans 3", sans-serif;
  --auth-label: "IBM Plex Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--auth-paper);
  color: var(--auth-ink);
  font-family: var(--auth-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.65; }
a { color: inherit; }

:focus-visible {
  outline: 0.2rem solid var(--auth-gold);
  outline-offset: 0.2rem;
}

.auth-skip {
  position: fixed;
  inset: 1rem auto auto 1rem;
  z-index: 10;
  padding: 0.7rem 1rem;
  background: var(--auth-paper);
  color: var(--auth-ink);
  transform: translateY(-180%);
}

.auth-skip:focus { transform: none; }

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.auth-story {
  position: relative;
  isolation: isolate;
  min-height: 31rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 4.5rem);
  background:
    radial-gradient(circle at 83% 18%, rgba(241, 199, 91, 0.25) 0 1.1rem, transparent 1.15rem),
    linear-gradient(145deg, var(--auth-violet-dark), #3f1d86 65%, #5726aa);
  color: var(--auth-paper);
}

.auth-story::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 22rem;
  aspect-ratio: 1;
  inset: 48% -8rem auto auto;
  border: 0.08rem solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  box-shadow: 0 0 0 3.5rem rgba(255, 255, 255, 0.04), 0 0 0 7rem rgba(255, 255, 255, 0.03);
}

.auth-wordmark {
  width: max-content;
  color: inherit;
  font: 600 clamp(1.1rem, 3vw, 1.4rem)/1 var(--auth-label);
  letter-spacing: 0.09em;
  text-decoration: none;
}

.auth-story__copy {
  max-width: 42rem;
  display: grid;
  gap: 1rem;
}

.auth-kicker {
  margin: 0;
  font: 600 0.72rem/1.3 var(--auth-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-story h1 {
  max-width: 10ch;
  margin: 0;
  font: 650 clamp(3.2rem, 9vw, 6.8rem)/0.9 var(--auth-display);
  letter-spacing: -0.055em;
}

.auth-story__copy > p:last-child {
  max-width: 39rem;
  margin: 0;
  color: rgba(255, 253, 248, 0.78);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.auth-ledger {
  max-width: 43rem;
  border-top: 0.08rem solid rgba(255, 255, 255, 0.35);
}

.auth-ledger > div {
  display: grid;
  grid-template-columns: 2.3rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 0.08rem solid rgba(255, 255, 255, 0.2);
}

.auth-ledger span {
  color: var(--auth-gold);
  font: 600 0.7rem/1.5 var(--auth-label);
}

.auth-ledger p, .auth-story__note { margin: 0; }

.auth-story__note {
  color: rgba(255, 253, 248, 0.65);
  font: 500 0.7rem/1.4 var(--auth-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-stage {
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 5vw, 4.5rem);
  background:
    linear-gradient(rgba(22, 14, 39, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 14, 39, 0.045) 1px, transparent 1px),
    var(--auth-paper-2);
  background-size: 2.5rem 2.5rem;
}

.auth-card {
  width: min(100%, 34rem);
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 0.08rem solid var(--auth-rule);
  border-radius: 1.4rem 1.4rem 3.4rem 1.4rem;
  background: var(--auth-paper);
  box-shadow: var(--auth-shadow);
}

.auth-card__heading {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.6rem;
}

.auth-back {
  width: max-content;
  margin-bottom: 0.7rem;
  color: #5a4d6b;
  font-weight: 700;
  text-decoration: none;
}

.auth-back:hover { text-decoration: underline; }
.auth-card__heading .auth-kicker { color: var(--auth-violet); }

.auth-card h2 {
  margin: 0;
  font: 650 clamp(2.25rem, 8vw, 3.7rem)/0.98 var(--auth-display);
  letter-spacing: -0.045em;
}

.auth-card__heading > p:last-child { margin: 0; color: #665c73; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1.4rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: #eee8f5;
}

.auth-tabs[hidden] { display: none; }

.auth-tabs button {
  min-height: 2.75rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #665c73;
  font-weight: 800;
}

.auth-tabs button[aria-selected="true"] { background: var(--auth-ink); color: var(--auth-paper); }

.auth-message {
  margin-bottom: 1.2rem;
  padding: 0.85rem 1rem;
  border-left: 0.25rem solid var(--auth-violet);
  background: #f0eafb;
  color: #3a235d;
  font-weight: 650;
}

.auth-message[data-tone="error"] { border-color: var(--auth-danger); background: #fbebe8; color: #79261f; }
.auth-message[data-tone="success"] { border-color: var(--auth-success); background: #e7f5ed; color: #125238; }

.auth-confirmation {
  display: grid;
  gap: 1.15rem;
  outline: 0;
}

.auth-confirmation[hidden] { display: none; }

.auth-confirmation__mark {
  width: 3.25rem;
  height: 3.25rem;
  fill: #e7f5ed;
  stroke: var(--auth-success);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-confirmation__lead,
.auth-confirmation__email,
.auth-confirmation__hint { margin: 0; }

.auth-confirmation__lead { color: #665c73; }

.auth-confirmation__email {
  color: var(--auth-ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.auth-confirmation__steps {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 1rem 1rem 1rem 2.4rem;
  border-block: 0.08rem solid var(--auth-rule);
  color: #3c3149;
}

.auth-confirmation__steps li { padding-inline-start: 0.25rem; }

.auth-confirmation__hint {
  color: #665c73;
  font-size: 0.9rem;
}

.auth-form { display: grid; gap: 1rem; }
.auth-form[hidden] { display: none; }

.auth-form label:not(.auth-check) {
  display: grid;
  gap: 0.4rem;
  color: #3c3149;
  font-weight: 750;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.7rem 0.9rem;
  border: 0.1rem solid #cfc4d9;
  border-radius: 0.7rem;
  background: #fff;
  color: var(--auth-ink);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-form input:focus {
  border-color: var(--auth-violet);
  box-shadow: 0 0 0 0.22rem rgba(102, 48, 201, 0.13);
  outline: 0;
}

.auth-check { display: flex; align-items: flex-start; gap: 0.7rem; color: #5c5169; }
.auth-check input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; accent-color: var(--auth-violet); }

.auth-submit {
  min-height: 3.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.25rem;
  padding: 0.75rem 1.1rem;
  border: 0.1rem solid var(--auth-ink);
  border-radius: 0.8rem;
  background: var(--auth-violet);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0.28rem 0 var(--auth-ink);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.auth-submit:hover { transform: translateY(-0.08rem); }
.auth-submit:active { transform: translateY(0.18rem); box-shadow: none; }

.auth-text-button {
  width: max-content;
  justify-self: center;
  padding: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--auth-violet-dark);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.auth-form__intro { margin: 0 0 0.3rem; color: #5c5169; }

.auth-privacy {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 0.08rem solid var(--auth-rule);
  color: #756b80;
  font-size: 0.82rem;
}

.topbar__account {
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 0.2rem;
}

.topbar__account[hidden] { display: none; }

.topbar__avatar {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #6630c9;
  color: #fff;
  font-weight: 800;
}

.topbar__identity { min-width: 0; display: grid; line-height: 1.1; }

.topbar__identity strong,
.topbar__identity span {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__identity strong { font-size: 0.78rem; }
.topbar__identity span { color: #64748b; font-size: 0.68rem; }

.topbar__signout {
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  background: #fff;
  color: #334155;
  font-weight: 700;
  font-size: 0.72rem;
}

@media (min-width: 62rem) {
  .auth-layout { grid-template-columns: minmax(31rem, 1.08fr) minmax(31rem, 0.92fr); }
  .auth-story { min-height: 100vh; }
}

@media (max-width: 40rem) {
  .auth-stage { padding: 0; background: var(--auth-paper); }
  .auth-card { border: 0; border-radius: 0; box-shadow: none; }
  .topbar__identity { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
