/* ============================================================
   PaiPai — Auth + Onboarding (standalone)
   Resend-style dark (default) / light theme via CSS variables.
   ============================================================ */

:root {
  /* palette — dark (default) */
  --page: #020304;
  --text: #ededed;
  --sec: #a3a3a3;
  --muted: #8c8c8c;
  --faint: #6b6b6b;
  --placeholder: #5c5c5c;
  --surface: rgba(255, 255, 255, 0.05);
  --hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.28);
  --focus-ring: rgba(255, 255, 255, 0.16);
  --danger: #f87171;
  --danger-ring: rgba(248, 113, 113, 0.14);
  --primary-bg: #f2f2f2;
  --primary-hover: #ffffff;
  --primary-border: #f2f2f2;
  --primary-text: #0a0a0a;
  --step-active-bg: #ffffff;
  --step-active-text: #000000;
  --step-done-bg: rgba(255, 255, 255, 0.1);
  --step-done-border: rgba(255, 255, 255, 0.38);
  --step-done-text: rgba(255, 255, 255, 0.82);
  --menu-bg: #161616;
  --success-fg: #6ee7b7;
  --success-border: rgba(52, 211, 153, 0.2);
  --success-bg: rgba(52, 211, 153, 0.07);

  /* silk backdrop — dark */
  --bd-base: #020304;
  --sheet0: #3a3a3a;
  --sheet1: #6e6e6e;
  --sheet2: #909090;
  --sheet3: #a4a4a4;
  --sheet4: #989898;
  --edge-a0: 0.55;
  --edge-a1: 0.18;
  --crease-dark: #000000;
  --crease-light: #ffffff;
  --facet-a0: #8f8f8f;
  --facet-a1: #3f3f3f;
  --facet-a2: #0a0a0a;
  --facet-b0: #333333;
  --facet-b1: #141414;
  --facet-b2: #000000;
  --crease: #cfcfcf;
  --vignette: #000000;
  --vignette-a0: 0.5;
  --vignette-a1: 0.22;
  --grain-o: 1;
}

[data-theme="light"] {
  --page: #f2f2f2;
  --text: #1a1a1a;
  --sec: #555555;
  --muted: #6f6f6f;
  --faint: #8a8a8a;
  --placeholder: #a0a0a0;
  --surface: rgba(0, 0, 0, 0.04);
  --hover: rgba(0, 0, 0, 0.08);
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.4);
  --focus-ring: rgba(0, 0, 0, 0.12);
  --danger: #b42318;
  --danger-ring: rgba(180, 35, 24, 0.12);
  --primary-bg: #1a1a1a;
  --primary-hover: #2d2d2d;
  --primary-border: #1a1a1a;
  --primary-text: #ffffff;
  --step-active-bg: #1a1a1a;
  --step-active-text: #ffffff;
  --step-done-bg: rgba(0, 0, 0, 0.07);
  --step-done-border: rgba(0, 0, 0, 0.28);
  --step-done-text: rgba(0, 0, 0, 0.72);
  --menu-bg: #ffffff;
  --success-fg: #047857;
  --success-border: rgba(4, 120, 87, 0.25);
  --success-bg: rgba(4, 120, 87, 0.07);

  --bd-base: #f4f4f4;
  --sheet0: #e6e6e6;
  --sheet1: #dcdcdc;
  --sheet2: #d2d2d2;
  --sheet3: #cbcbcb;
  --sheet4: #d0d0d0;
  --edge-a0: 0.1;
  --edge-a1: 0.04;
  --crease-dark: #9a9a9a;
  --crease-light: #ffffff;
  --facet-a0: #d0d0d0;
  --facet-a1: #e0e0e0;
  --facet-a2: #efefef;
  --facet-b0: #d8d8d8;
  --facet-b1: #e8e8e8;
  --facet-b2: #f4f4f4;
  --crease: #ffffff;
  --vignette: #ffffff;
  --vignette-a0: 0.45;
  --vignette-a1: 0.2;
  --grain-o: 0.7;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ----------------------------- backdrop ----------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle 72vw at 50% 8%, #020304 0%, #020304 52%, rgba(2, 3, 4, 0.87) 65%, rgba(2, 3, 4, 0.6) 76%, rgba(2, 3, 4, 0.3) 88%, rgba(2, 3, 4, 0.08) 96%, transparent 100%),
    linear-gradient(180deg, #020304 0%, #020304 46%, #0f1113 58%, #2d3033 72%, #74777b 87%, #b2b3b5 100%);
}

[data-theme="light"] .backdrop {
  background: var(--bd-base);
}

.backdrop::before {
  content: "";
  position: absolute;
  left: clamp(-300px, -18vw, -180px);
  bottom: clamp(-340px, -26vh, -180px);
  width: clamp(520px, 48vw, 760px);
  height: clamp(620px, 78vh, 900px);
  background: url("assets/light-rib-pattern-v2.png") center bottom / cover no-repeat;
  filter: contrast(1.03) drop-shadow(20px 18px 38px rgba(20, 20, 18, 0.1));
  mix-blend-mode: multiply;
  opacity: 0;
  transform: rotate(9deg);
  transform-origin: 48% 60%;
  -webkit-mask-image: linear-gradient(36deg, #000 0 48%, rgba(0, 0, 0, 0.72) 62%, transparent 82%);
  mask-image: linear-gradient(36deg, #000 0 48%, rgba(0, 0, 0, 0.72) 62%, transparent 82%);
}

.backdrop::after {
  content: "";
  position: absolute;
  top: clamp(-360px, -28vh, -190px);
  right: clamp(-300px, -18vw, -170px);
  width: clamp(520px, 48vw, 760px);
  height: clamp(620px, 78vh, 900px);
  background: url("assets/light-rib-pattern-v2.png") center top / cover no-repeat;
  filter: contrast(1.04) drop-shadow(-20px 22px 40px rgba(20, 20, 18, 0.11));
  mix-blend-mode: multiply;
  opacity: 0;
  transform: rotate(-9deg);
  transform-origin: 52% 40%;
  -webkit-mask-image: linear-gradient(216deg, #000 0 48%, rgba(0, 0, 0, 0.72) 62%, transparent 82%);
  mask-image: linear-gradient(216deg, #000 0 48%, rgba(0, 0, 0, 0.72) 62%, transparent 82%);
}

[data-theme="light"] .backdrop::before {
  opacity: 0.5;
}

[data-theme="light"] .backdrop::after {
  opacity: 0.52;
}

[data-theme="light"] .backdrop svg {
  opacity: 0;
}

.backdrop svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.backdrop .bd-base { fill: var(--bd-base); }
.backdrop .s0 { stop-color: var(--sheet0); }
.backdrop .s1 { stop-color: var(--sheet1); }
.backdrop .s2 { stop-color: var(--sheet2); }
.backdrop .s3 { stop-color: var(--sheet3); }
.backdrop .s4 { stop-color: var(--sheet4); }
.backdrop .e0 { stop-color: #000; stop-opacity: var(--edge-a0); }
.backdrop .e1 { stop-color: #000; stop-opacity: var(--edge-a1); }
.backdrop .fa0 { stop-color: var(--facet-a0); }
.backdrop .fa1 { stop-color: var(--facet-a1); }
.backdrop .fa2 { stop-color: var(--facet-a2); }
.backdrop .fb0 { stop-color: var(--facet-b0); }
.backdrop .fb1 { stop-color: var(--facet-b1); }
.backdrop .fb2 { stop-color: var(--facet-b2); }
.backdrop .v0 { stop-color: var(--vignette); stop-opacity: var(--vignette-a0); }
.backdrop .v1 { stop-color: var(--vignette); stop-opacity: var(--vignette-a1); }
.backdrop .crease-dark { fill: var(--crease-dark); }
.backdrop .crease-light { fill: var(--crease-light); }
.backdrop .crease { fill: var(--crease); }
.backdrop .grain { opacity: var(--grain-o); }

@media (max-width: 720px) {
  html:not([data-theme="light"]) .backdrop {
    background:
      radial-gradient(circle 150vw at 50% 45%, #020304 0%, #020304 52%, rgba(2, 3, 4, 0.88) 70%, rgba(2, 3, 4, 0.58) 82%, rgba(2, 3, 4, 0.24) 92%, rgba(2, 3, 4, 0.06) 98%, transparent 100%),
      linear-gradient(180deg, #020304 0%, #020304 58%, #111315 68%, #35383b 80%, #85888c 92%, #b2b3b5 100%);
  }

  .backdrop::before {
    left: -250px;
    bottom: -250px;
    width: 480px;
    height: 620px;
  }

  .backdrop::after {
    top: -250px;
    right: -250px;
    width: 480px;
    height: 620px;
  }

  [data-theme="light"] .backdrop::before {
    opacity: 0.3;
  }

  [data-theme="light"] .backdrop::after {
    opacity: 0.32;
  }
}

/* ------------------------------ layout ------------------------------ */

.stage {
  position: relative;
  z-index: 10;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(32px, 6vh, 64px) 20px;
}

.card-col {
  width: min(100%, 440px);
  margin: auto;
}

/* logo tile */
.logo-tile-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 3px;
}

.logo-tile {
  width: 108px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-tile img {
  display: block;
  width: 108px;
  height: 108px;
  object-fit: contain;
}

[data-theme="light"] .logo-tile img {
  filter: invert(1);
}

/* ------------------------------- type ------------------------------- */

.title {
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.subtitle {
  margin: 5px 0 24px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.subtitle strong {
  color: var(--text);
  font-weight: 600;
}

.account-route {
  font-size: 12px;
  color: var(--sec);
  font-weight: 400;
}

.account-route .link-btn {
  color: var(--text);
  font-weight: 600;
}

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  padding: 0;
  text-underline-offset: 3px;
}

.link-btn:hover,
.link-btn:focus-visible {
  text-decoration: underline;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--border-strong);
  outline-offset: 3px;
}

.quiet-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  padding: 0;
}

.quiet-btn:hover {
  color: var(--text);
}

/* ------------------------------ forms ------------------------------ */

.field {
  position: relative;
  margin-bottom: 14px;
}

.form-row > div {
  position: relative;
}

.example-tip {
  position: absolute;
  left: clamp(8px, 18%, 72px);
  top: calc(100% + 7px);
  z-index: 40;
  max-width: calc(100% - 16px);
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  color: #252525;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: none;
}

.example-tip::before {
  content: "";
  position: absolute;
  left: 14px;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: #ffffff;
  transform: rotate(45deg);
}

.example-tip span {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field:focus-within > .example-tip,
.form-row > div:focus-within > .example-tip {
  display: block;
}

.example-tip:hover {
  background: #f2f2f2;
}

.example-tip:hover::before {
  background: #f2f2f2;
}

.example-tip.is-used {
  display: none !important;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--sec);
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: var(--placeholder);
}

.input:hover:not(:focus):not(.is-invalid) {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.065);
}

[data-theme="light"] .input:hover:not(:focus):not(.is-invalid) {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.055);
}

.input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--hover);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input.has-value:not(.is-invalid):not(:focus) {
  border-color: rgba(255, 255, 255, 0.17);
}

[data-theme="light"] .input.has-value:not(.is-invalid):not(:focus) {
  border-color: rgba(0, 0, 0, 0.18);
}

.input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-ring);
}

.pw-wrap {
  position: relative;
}

.pw-wrap .input {
  padding-right: 44px;
}

.pw-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--faint);
  display: flex;
}

.pw-toggle:hover {
  color: var(--text);
}

.pw-toggle[aria-pressed="true"] {
  color: var(--text);
}

.hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.hint strong {
  color: var(--text);
  font-weight: 600;
}

.field-error {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--danger);
}

.field-help {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--faint);
  text-wrap: pretty;
}

/* buttons */
.btn-primary {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--primary-border);
  background: var(--primary-bg);
  color: var(--primary-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.995);
  box-shadow: none;
}

.btn-primary:disabled {
  opacity: 1;
  cursor: not-allowed;
  color: var(--faint);
  border-color: var(--border);
  background: var(--surface);
}

.btn-ghost {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--sec);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:active {
  transform: scale(0.995);
}

.social-row {
  display: flex;
  gap: 12px;
}

.btn-social {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.btn-social:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-social:active {
  transform: translateY(0) scale(0.995);
}

/* divider */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 22px 0;
  font-size: 12px;
  color: var(--faint);
}

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

/* terms footer */
.terms {
  width: 100%;
  max-width: 400px;
  margin: 18px auto 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--faint);
  white-space: normal;
  overflow-wrap: break-word;
}

.terms a {
  color: inherit;
  text-decoration: underline;
}

.terms a:hover {
  color: var(--sec);
}

.right-row {
  text-align: right;
  margin-bottom: 18px;
}

.right-row a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.right-row a:hover {
  color: var(--text);
}

/* verification code */
.code-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.code-digit {
  width: 44px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.code-digit:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--hover);
}

.resend-row {
  margin-bottom: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
}

.center-row {
  margin-top: 16px;
  text-align: center;
}

/* custom select */
.select {
  position: relative;
}

.select-trigger {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.select-trigger:hover {
  border-color: var(--border-strong);
  background: var(--hover);
}

.select-trigger:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.select.open .select-trigger {
  border-color: var(--border-strong);
  background: var(--hover);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.select-trigger .select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-trigger.placeholder .select-value {
  color: var(--placeholder);
}

.select-trigger svg {
  flex-shrink: 0;
  color: var(--faint);
  transition: transform 0.15s;
}

.select.open .select-trigger svg {
  transform: rotate(180deg);
}

.select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  padding: 6px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--menu-bg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.select-menu button {
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--sec);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  transition: background 0.12s;
}

.select-menu button:hover {
  background: var(--hover);
}

.select-menu button.selected {
  color: var(--text);
  font-weight: 600;
  background: var(--surface);
}

.select-menu button.selected::after {
  content: "✓";
  color: var(--text);
}

/* upload area */
.upload-area {
  margin-bottom: 4px;
  padding: 28px 24px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--border-strong);
  background: var(--hover);
}

.upload-area svg {
  color: var(--muted);
  margin-bottom: 12px;
}

.upload-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.upload-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--faint);
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.file-preview img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  margin-top: 2px;
  font-size: 11px;
  color: var(--faint);
}

.file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--faint);
  display: flex;
}

.file-remove:hover {
  color: var(--text);
}

/* status blocks */
.status-processing {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--sec);
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-success {
  margin-bottom: 16px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--success-border);
  background: var(--success-bg);
  font-size: 12px;
  color: var(--success-fg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* two-column row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.stack {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#reviewForm .field {
  margin-bottom: 12px !important;
}

.prefs-actions {
  margin-top: 18px;
}

/* complete view */
.complete-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 1px solid var(--success-border);
  background: var(--success-bg);
  color: var(--success-fg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* bottom-right controls */
.corner-controls {
  position: fixed;
  right: 24px;
  top: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn {
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  color: var(--faint);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}

.ctrl-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.ctrl-btn:active {
  background: var(--hover);
  transform: scale(0.96);
}

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

@media (max-height: 900px) {
  .stage {
    padding: 24px 20px;
  }

  .logo-tile-wrap {
    margin-bottom: 0;
  }

  .logo-tile,
  .logo-tile img {
    width: 90px;
    height: 90px;
  }

  .title {
    font-size: 24px;
    line-height: 1.15;
  }

  .subtitle {
    margin-top: 4px;
    margin-bottom: 16px;
    line-height: 1.45;
  }

  .field {
    margin-bottom: 10px;
  }

  .label {
    margin-bottom: 4px;
  }

  .input,
  .select-trigger {
    height: 36px;
    border-radius: 10px;
  }

  .btn-primary,
  .btn-ghost {
    height: 38px;
    border-radius: 10px;
  }

  .btn-social {
    height: 44px;
    border-radius: 10px;
  }

  .divider {
    margin: 22px 0;
  }

  .terms {
    margin-top: 14px;
    line-height: 1.45;
  }

  .right-row {
    margin-bottom: 14px;
  }

  .code-digit {
    height: 44px;
  }

  .resend-row {
    margin-bottom: 14px;
  }

  .center-row {
    margin-top: 12px;
  }

  .upload-area {
    padding: 20px 20px;
  }

  .upload-area svg {
    margin-bottom: 8px;
  }

  .status-success {
    margin-bottom: 10px;
    padding: 7px 12px;
  }

  #reviewForm .field {
    margin-bottom: 8px !important;
  }

  .form-row {
    margin-bottom: 8px;
  }

  .stack {
    margin-top: 12px;
    gap: 6px;
  }

  .prefs-actions {
    margin-top: 14px;
  }
}

@media (max-height: 680px) {
  body {
    height: auto;
    min-height: 100vh;
  }

  .stage {
    align-items: flex-start;
    padding-top: 48px;
    padding-bottom: 20px;
  }
}

@media (max-width: 600px) {
  .terms {
    width: auto;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    white-space: normal;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
  .social-row {
    flex-direction: column;
  }
}
