/* Sign up, log in and onboarding (public/auth.html, Figma: Sign up & log in).
   Two columns: the dark panel (640px) and the form side, whose card swaps
   its steps in place (public/auth.js). Loads after shared.css. */

/* The page fades in from the landing page, and out into the app (not with
   reduced motion). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

:root {
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --panel-white-68: rgba(255, 255, 255, 0.68);
  --panel-white-50: rgba(255, 255, 255, 0.5);
}

/* The panel is 640px at 1440 wide, and narrows with the window so the card
   always fits beside it. */
body.auth-page {
  display: grid;
  grid-template-columns: clamp(420px, 44.5vw, 640px) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-canvas);
  font-size: 14px;
  line-height: 20px;
}

h1,
p,
ul,
ol,
figure {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 30;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--accent-solid);
  color: var(--on-accent);
}

.skip:focus {
  top: 12px;
}

.ico {
  width: 16px;
  height: 16px;
  flex: none;
}

a {
  color: inherit;
}

/* A button that reads as a link in the sentence around it. */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---------------------------------------------------------------- the dark panel */

.auth-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 48px clamp(40px, 4.45vw, 64px) 44px;
  overflow: hidden;
  background: var(--accent-solid);
  color: var(--on-accent);
}

.panel-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 12px;
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: -0.2px;
  text-decoration: none;
}

.panel-brand:focus-visible,
.auth-panel a:focus-visible {
  outline-color: var(--on-accent);
}

/* The variants share one grid cell; the one showing has .on. */
.panel-stage {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  align-content: center;
  padding-block: 32px;
}

.panel-copy {
  grid-area: 1 / 1;
  max-width: 460px;
  visibility: hidden;
  opacity: 0;
  translate: 0 10px;
  transition: opacity 0.24s ease, translate 0.24s ease, visibility 0s linear 0.24s;
}

.panel-copy.on {
  visibility: visible;
  opacity: 1;
  translate: 0 0;
  transition: opacity 0.42s var(--ease-out) 0.12s, translate 0.42s var(--ease-out) 0.12s, visibility 0s;
}

.panel-eyebrow {
  color: var(--panel-white-50);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.panel-title {
  margin-top: 20px;
  font-size: 48px;
  font-weight: 500;
  line-height: 56px;
  letter-spacing: -1.2px;
}

.panel-title em {
  font-family: 'Instrument Serif', serif;
  font-size: 58px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.panel-sub {
  margin-top: 24px;
  color: var(--panel-white-68);
  font-size: 17px;
  line-height: 26px;
}

.panel-checks {
  display: grid;
  gap: 14px;
  margin-top: 32px;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 22px;
}

.panel-checks li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-checks .ico {
  width: 18px;
  height: 18px;
}

/* Log-in: a passage, the original over its translation. */
.panel-passage {
  display: grid;
  gap: 16px;
  margin-top: 32px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.panel-passage > div + div {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-passage figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--panel-white-50);
  font-size: 12px;
  line-height: 16px;
}

.panel-passage .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--panel-white-50);
}

.panel-passage .dot.en {
  background: var(--accent-blue);
}

.panel-passage p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 24px;
}

.panel-passage p[lang='ko'] {
  font-family: 'Noto Sans KR', var(--ui-font);
  word-break: keep-all;
}

/* Onboarding: three steps; each ticks over to Done as it's finished. */
.panel-steps {
  display: grid;
  gap: 20px;
  margin-top: 32px;
  padding: 0;
  list-style: none;
}

.panel-steps li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
}

.panel-steps strong {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
}

.panel-steps small {
  display: block;
  color: var(--panel-white-50);
  font-size: 13px;
  line-height: 18px;
}

.step-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: -1px;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.step-mark > * {
  grid-area: 1 / 1;
  transition: opacity 0.2s, scale 0.3s var(--ease-out);
}

.step-mark .ico {
  width: 14px;
  height: 14px;
  opacity: 0;
  scale: 0.4;
  stroke-width: 2;
}

.panel-steps li.current .step-mark {
  border-color: var(--on-accent);
}

.panel-steps li:not(.current, .done) {
  color: rgba(255, 255, 255, 0.6);
}

.panel-steps li.done .step-mark {
  border-color: var(--on-accent);
  background: var(--on-accent);
  color: var(--accent-solid);
}

.panel-steps li.done .step-mark .ico {
  opacity: 1;
  scale: 1;
  transition-delay: 0.12s;
}

.panel-steps li.done .step-mark span {
  opacity: 0;
  scale: 0.4;
}

.panel-steps .when-done,
.panel-steps li.done .when-open {
  display: none;
}

.panel-steps li.done .when-done {
  display: inline;
}

.panel-footer {
  position: relative;
  z-index: 1;
  color: var(--panel-white-50);
  font-size: 13px;
  line-height: 18px;
}

.panel-footer a {
  text-decoration: none;
}

.panel-footer a:hover {
  color: var(--panel-white-68);
}

.panel-footer > * + *::before {
  content: '·';
  margin-inline: 10px;
}

/* 한국어 日本語 中文, very faint, cut off by the panel's bottom edge, and
   drifting so slowly it reads as still. */
.panel-glyphs {
  position: absolute;
  left: -12px;
  bottom: -52px;
  color: rgba(255, 255, 255, 0.05);
  font-family: 'Noto Serif KR', serif;
  font-size: 150px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  animation: drift 48s ease-in-out infinite alternate;
}

.panel-glyphs [lang='ja'] { font-family: 'Noto Serif JP', serif; }
.panel-glyphs [lang='zh-Hans'] { font-family: 'Noto Serif SC', serif; }

@keyframes drift {
  to { translate: -120px 0; }
}

/* ---------------------------------------------------------------- the form side */

.auth-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px clamp(24px, 2.8vw, 40px) 28px;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 20px;
  color: var(--text-secondary);
}

.auth-back {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--motion-fast), opacity 0.24s, visibility 0s;
}

.auth-back:hover {
  color: var(--text-primary);
}

/* Onboarding has Log out instead (top right). */
.auth-back.off {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0s linear 0.2s;
}

.auth-account {
  display: grid;
  justify-items: end;
  margin-left: auto;
  text-align: right;
}

.auth-account > p {
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0s linear 0.2s;
}

.auth-account > p.on {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s 0.08s, visibility 0s;
}

.auth-account a {
  color: var(--text-primary);
  font-weight: 500;
  text-underline-offset: 2px;
}

.auth-main {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 460px);
  place-content: center;
  justify-items: center;
  gap: 24px;
  padding-block: 32px;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  text-decoration: none;
}

.auth-card {
  width: 100%;
  padding: 40px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.05);
}

/* While two steps swap, the outgoing one is pinned on top of the incoming
   one and the stage animates between their heights (public/auth.js). */
.card-stage {
  position: relative;
}

.card-stage.swapping {
  overflow: clip;
  overflow-clip-margin: 6px;
}

.auth-help {
  color: var(--text-secondary);
  text-align: center;
}

.auth-help a {
  color: var(--text-primary);
  font-weight: 500;
  text-underline-offset: 2px;
}

/* The card's first appearance. */
.auth-card.enter {
  animation: card-in 0.5s var(--ease-out) both;
}

@keyframes card-in {
  from { opacity: 0; translate: 0 12px; }
}

/* ---------------------------------------------------------------- inside the card */

.screen {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card-head {
  display: grid;
  gap: 8px;
}

.card-title {
  font-size: 28px;
  font-weight: 500;
  line-height: 34px;
  letter-spacing: -0.42px;
}

.card-sub {
  color: var(--text-secondary);
}

.card-sub strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Sign-up and log-in share the method step; only the words differ. */
.screen[data-mode='signup'] [data-mode='login'],
.screen[data-mode='login'] [data-mode='signup'] {
  display: none;
}

.screen .swap-in {
  animation: words-in 0.3s var(--ease-out) both;
}

@keyframes words-in {
  from { opacity: 0; translate: 0 4px; }
}

/* Buttons: 40px, full width, 8px corners. */
.auth-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  transition: background-color var(--motion-fast), border-color var(--motion-fast), opacity 0.2s, transform var(--motion-fast);
}

.auth-btn:active {
  transform: translateY(1px);
}

.auth-btn.accent {
  border-color: var(--accent-blue);
  background: var(--accent-blue);
  color: var(--on-accent);
}

.auth-btn.accent:hover {
  border-color: var(--accent-blue-hover);
  background: var(--accent-blue-hover);
}

.auth-btn.accent:focus-visible {
  outline-color: var(--accent-blue);
}

.auth-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

/* Working: the label gives way to a spinner, and the button keeps its size. */
.is-loading > * {
  visibility: hidden;
}

.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.auth-btn.is-loading:disabled {
  opacity: 1;
}

.other-busy:disabled {
  opacity: 0.4;
}

@keyframes spin {
  to { rotate: 360deg; }
}

/* Google and Apple: equal height and weight, white with an outline. The
   hover and pressed overlays darken the fill only, never the logo. */
.providers {
  display: grid;
  gap: 10px;
}

.provider {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
}

.provider::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: transparent;
  transition: background-color var(--motion-fast);
}

.provider:hover::before { background: rgba(0, 0, 0, 0.04); }
.provider:active::before { background: rgba(0, 0, 0, 0.08); }

.provider.google {
  gap: 10px;
  box-shadow: inset 0 0 0 1px #747775;
  color: #1f1f1f;
}

.provider.apple {
  gap: 8px;
  box-shadow: inset 0 0 0 1px #bfbfbf;
  color: #000000;
}

.provider-logo {
  flex: none;
}

.provider[hidden] {
  display: none;
}

.provider:disabled {
  cursor: default;
}

.provider:disabled:not(.is-loading) {
  opacity: 0.5;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 16px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.field-label {
  display: grid;
  gap: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.field {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.field::placeholder {
  color: var(--text-tertiary);
}

.field:hover {
  border-color: var(--text-tertiary);
}

.field:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
  outline: none;
}

.field[aria-invalid='true'] {
  border-color: var(--danger-solid);
}

.email-form,
.name-form,
.role-form {
  display: grid;
}

.email-form .field {
  margin-top: 8px;
}

.email-form .auth-btn,
.name-form .auth-btn {
  margin-top: 12px;
}

/* Things that open under a field (L2, errors): they grow to their height
   rather than pushing the button down in one jump. */
.reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.28s var(--ease-out), opacity 0.2s;
}

.reveal.open {
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.32s var(--ease-out), opacity 0.28s 0.06s;
}

.reveal-inner {
  min-height: 0;
  overflow: hidden;
}

.reveal-inner > * {
  margin-top: 12px;
}

.notice {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.notice .ico {
  margin-top: 1px;
  color: var(--icon-default);
}

.notice strong {
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-all;
}

.notice-link {
  position: relative;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.notice-link.is-loading::after {
  inset: 0 auto 0 0;
  width: 12px;
  height: 12px;
  border-width: 1.5px;
}

.field-error {
  color: var(--danger-text);
  font-size: 13px;
  line-height: 18px;
}

.fineprint {
  margin-top: -8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
}

.fineprint a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------------------------------------------------------- the code */

.back-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
  transition: color var(--motion-fast);
}

.back-link:hover {
  color: var(--text-primary);
}

.code {
  position: relative;
}

.code-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.code-box {
  height: 60px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-surface);
  caret-color: var(--accent-blue);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 500;
  line-height: 32px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.25s, color 0.25s, opacity 0.2s, scale 0.25s var(--ease-out);
}

.code-box:hover {
  border-color: var(--text-tertiary);
}

/* 2px blue, drawn with the shadow so the box doesn't change size. */
.code-box:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
  outline: none;
}

.code-box:disabled {
  background: var(--bg-subtle);
  color: var(--text-tertiary);
}

.code.error .code-box {
  border-color: var(--danger-solid);
  background: var(--danger-soft);
  color: var(--danger-text);
}

.code.error .code-box:focus {
  box-shadow: 0 0 0 1px var(--danger-solid);
  caret-color: var(--danger-solid);
}

/* The code checked out: the digits fold away into one tick. */
.code-ok {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  scale: 0.6;
  pointer-events: none;
  transition: opacity 0.2s, scale 0.35s var(--ease-out);
}

.code-ok .ico {
  width: 28px;
  height: 28px;
  padding: 10px;
  box-sizing: content-box;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--on-accent);
  stroke-width: 2;
}

.code.ok .code-box {
  opacity: 0;
  scale: 0.85;
}

.code.ok .code-box:nth-child(2) { transition-delay: 0.03s; }
.code.ok .code-box:nth-child(3) { transition-delay: 0.06s; }
.code.ok .code-box:nth-child(4) { transition-delay: 0.09s; }
.code.ok .code-box:nth-child(5) { transition-delay: 0.12s; }
.code.ok .code-box:nth-child(6) { transition-delay: 0.15s; }

.code.ok .code-ok {
  opacity: 1;
  scale: 1;
  transition-delay: 0.16s;
}

.code-alert {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  color: var(--danger-text);
  font-size: 13px;
  line-height: 18px;
}

.code-alert .ico {
  margin-top: 1px;
}

.verify-actions {
  display: grid;
  gap: 16px;
}

.mail-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mail-links .btn {
  height: 34px;
}

.resend {
  margin-top: -4px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.resend .link-button {
  font-weight: 500;
}

.resend .count {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- onboarding */

.progress {
  display: grid;
  gap: 8px;
  margin-bottom: -4px;
}

.progress p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 16px;
}

.segments {
  display: flex;
  gap: 6px;
}

.segments i {
  position: relative;
  flex: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bg-muted);
}

.segments i.on::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--text-primary);
}

/* Arriving at step 2, its segment fills left to right. */
.segments i.fill::after {
  transform-origin: left;
  animation: fill 0.6s var(--ease-out) 0.25s both;
}

@keyframes fill {
  from { scale: 0 1; }
}

.name-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.roles {
  display: grid;
  gap: 8px;
}

.role {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.role:hover {
  border-color: var(--border-strong);
}

/* The real radio button, invisible but there for the keyboard and screen readers. */
.role input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.role-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--icon-default);
  transition: background-color 0.15s;
}

.role-text {
  flex: 1;
  min-width: 0;
}

.role-text strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.role-text small {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 16px;
}

.radio {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-surface);
  transition: border-color 0.15s, background-color 0.15s;
}

.radio::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 6px;
  height: 6px;
  margin: auto;
  border-radius: 50%;
  background: var(--on-accent);
  scale: 0;
  transition: scale 0.2s var(--ease-out);
}

.role:has(input:checked) {
  border-color: var(--text-primary);
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 0.5px var(--text-primary);
}

.role:has(input:checked) .role-icon {
  background: var(--bg-surface);
}

.role:has(input:checked) .radio {
  border-color: var(--text-primary);
  background: var(--text-primary);
}

.role:has(input:checked) .radio::after {
  scale: 1;
}

.role:has(input:focus-visible) {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.card-title:focus {
  outline: none;
}

.role-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.role-actions .btn.auth-btn {
  flex: none;
  width: auto;
  padding-inline: 14px;
}

.role-actions .auth-btn.accent {
  flex: 1;
}

/* ---------------------------------------------------------------- the toast (as in the app) */

.toast {
  position: fixed;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text-primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  font-size: 13px;
}

.toast[popover] {
  inset: auto 20px 20px auto;
  margin: 0;
  border: 0;
  transition: opacity var(--motion-fast), translate var(--motion-fast), display var(--motion-fast) allow-discrete, overlay var(--motion-fast) allow-discrete;
}

.toast:not(:popover-open) {
  opacity: 0;
  translate: 0 8px;
}

@starting-style {
  .toast:popover-open { opacity: 0; translate: 0 8px; }
}

.toast.error {
  background: var(--danger-text);
}

/* ---------------------------------------------------------------- smaller screens */

/* No panel: the logo sits above the card. */
@media (max-width: 1023px) {
  body.auth-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-panel {
    display: none;
  }

  .auth-side {
    padding: 20px 16px 24px;
  }

  .mobile-brand {
    display: inline-flex;
  }

  .auth-main {
    padding-block: 24px;
  }
}

/* The form sits on the page, without the card's border and shadow. */
@media (max-width: 479px) {
  .auth-card {
    padding: 8px 0;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .auth-main {
    place-content: start stretch;
  }

  .auth-top {
    font-size: 13px;
  }

  .code-row {
    gap: 6px;
  }

  .code-box {
    height: 52px;
    font-size: 22px;
  }

  .name-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .toast[popover] {
    inset: auto 16px 16px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel-glyphs,
  .auth-card.enter,
  .segments i.fill::after,
  .screen .swap-in {
    animation: none;
  }
}
