.auth-page {
  min-height: 100vh;
  padding-top: var(--safe-top);
  background-color: var(--sand);
  background-image: var(--grain);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(390px, .82fr) minmax(500px, 1.18fr);
}

.auth-visual {
  display: flex;
  padding: 38px clamp(36px, 5vw, 72px) 48px;
  flex-direction: column;
  color: var(--ink);
  background: var(--card-2);
  border-right: 1px solid var(--line);
}

.auth-brand .brand {
  color: var(--ink);
}

.auth-visual-copy {
  max-width: 560px;
  margin-top: clamp(72px, 12vh, 128px);
}

.auth-kicker {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.auth-visual-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 50px);
  letter-spacing: -.045em;
  line-height: 1.08;
}

.auth-visual-copy > p:last-child {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--choco-muted);
  font-size: 15px;
  line-height: 1.7;
}

.auth-workspace {
  width: min(100%, 510px);
  margin-top: 40px;
  overflow: hidden;
  color: var(--ink);
  background: var(--card);
  border: var(--edge) solid var(--choco-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-workspace-head,
.auth-workspace-body,
.auth-workspace-footer {
  display: flex;
  align-items: center;
}

.auth-workspace-head {
  min-height: 64px;
  padding: 12px 16px;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--card-2);
}

.auth-workspace-head span,
.auth-workspace-head small,
.auth-workspace-body b,
.auth-workspace-body span {
  display: block;
}

.auth-workspace-head span {
  font-size: 13px;
  font-weight: 750;
}

.auth-workspace-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.auth-workspace-head strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 11px;
}

.auth-workspace-head strong i {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
}

.auth-workspace-body {
  min-height: 116px;
  padding: 20px;
  gap: 14px;
}

.auth-document-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 9px;
}

.auth-document-icon svg {
  width: 24px;
  height: 24px;
}

.auth-workspace-body b {
  font-size: 13px;
}

.auth-workspace-body span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.auth-workspace-footer {
  min-height: 48px;
  padding: 0 16px;
  gap: 10px;
  background: var(--card-2);
  border-top: 2px solid var(--glass-border);
  font-size: 11px;
}

.auth-workspace-footer span {
  color: var(--muted);
}

.auth-workspace-footer > div {
  height: 6px;
  flex: 1;
  overflow: hidden;
  background: var(--line);
  border-radius: 4px;
}

.auth-workspace-footer > div i {
  display: block;
  width: 82%;
  height: 100%;
  background: var(--brand);
}

.auth-workspace-footer b {
  color: var(--brand-dark);
}

.register-visual {
  background: var(--card-2);
}

.register-visual .auth-kicker {
  color: var(--brand);
}

.auth-benefits {
  display: grid;
  max-width: 540px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  gap: 20px;
}

.auth-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.auth-benefits svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  padding: 4px;
  color: var(--choco-ink);
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 6px;
}

.auth-benefits b,
.auth-benefits span {
  display: block;
}

.auth-benefits b {
  font-size: 14px;
}

.auth-benefits span {
  margin-top: 3px;
  color: var(--choco-muted);
  font-size: 12px;
}

.auth-form-side {
  display: grid;
  padding: 48px 32px 28px;
  place-items: center;
  align-content: center;
  background: var(--surface);
}

.auth-mobile-brand {
  display: none;
}

.auth-card {
  width: min(100%, 440px);
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading h1,
.auth-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 35px);
  letter-spacing: -.04em;
  line-height: 1.12;
}

.auth-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-card > .alert {
  margin-bottom: 18px;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.label-row a {
  min-height: 30px;
  padding: 5px 0;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

/* .password-wrap and .form-errors moved to common/app.css -- the builder's
   account-claim modal needed them too, and this was the one auth-only
   piece of an otherwise shared form-field pattern. */

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 3px;
}

.auth-switch {
  margin: 24px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.auth-switch a {
  color: var(--brand-dark);
  font-weight: 750;
}

.auth-legal {
  align-self: end;
  margin: 36px 0 0;
  color: var(--subtle);
  text-align: center;
  font-size: 11px;
}

.simple-auth-page {
  background: var(--canvas);
}

.simple-auth {
  display: grid;
  min-height: 100vh;
  padding: 48px 20px;
  place-items: center;
  align-content: center;
}

.simple-auth .auth-mobile-brand {
  display: block;
  width: min(100%, 460px);
  margin-bottom: 28px;
}

.simple-auth .auth-card {
  width: min(100%, 460px);
  padding: 32px;
  background: var(--card);
  border: var(--edge) solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.back-link {
  display: inline-flex;
  min-height: 40px;
  margin: -6px 0 22px -7px;
  padding: 8px 7px;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.back-link:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.back-link svg {
  width: 17px;
  height: 17px;
}

.reset-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  place-items: center;
  color: var(--rust-deep);
  background: var(--gold-soft);
  border: var(--edge) solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.reset-icon svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 940px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-form-side {
    min-height: 100vh;
    padding: 34px 20px;
  }

  .auth-mobile-brand {
    display: block;
    width: min(100%, 440px);
    margin-bottom: 46px;
  }
}

@media (max-width: 520px) {
  .auth-form-side {
    place-items: stretch;
    align-content: start;
  }

  .auth-card {
    width: 100%;
  }

  .auth-heading h1,
  .auth-heading h2 {
    font-size: 30px;
  }

  .simple-auth {
    padding: 28px 14px;
  }

  .simple-auth .auth-card {
    padding: 25px 20px;
  }
}
/* ==========================================================================
   Touch and small screens
   ========================================================================== */

@media (max-width: 820px) {
  .auth-form input,
  .auth-form select,
  .simple-auth input,
  .simple-auth select {
    font-size: 16px;
  }

  .auth-submit,
  .auth-switch a,
  .back-link,
  .login-link,
  .password-wrap button,
  .label-row a {
    min-height: 44px;
  }

  /* The row centres its contents, so the taller link simply makes the row
     taller rather than knocking the label out of alignment. */
  .label-row a {
    display: inline-flex;
    align-items: center;
  }

  .password-wrap button {
    min-width: 44px;
  }

  .auth-legal,
  .auth-switch,
  .auth-kicker,
  .form-errors,
  .label-row a,
  .auth-heading p {
    font-size: 12px;
  }
}

/* Mobile browser chrome makes 100vh overshoot the visible area, which hides
   the bottom of a full-height sign-in screen behind the address bar. */
@supports (height: 100dvh) {
  .auth-page,
  .auth-shell,
  .simple-auth {
    min-height: 100dvh;
  }
}
