/* Engine auth surfaces (login / signup / public home) — Whatnot Studio house style.
   Tokens and devices mirror cockpit/app/landing (DESIGN.md). Scoped to .wb. */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans+KR:wght@400;500;600&family=IBM+Plex+Sans+Thai:wght@400;500;600&family=Kanit:wght@400;500;600&display=swap");

.wb {
  --ink: #1a1a1a;
  --paper: #ffffff;
  --wash: #f4f5f5;
  --line: #d1d3d4;
  --muted: #6b6c6e;
  --faint: #a7a9ac;
  --accent: #be7429;
  --fail: #a33b3b;
  /* Solid CTA stays dark-on-cream / cream-on-dark with forced fill — never
     inherits a washed browser button colour that can hide the label. */
  --btn-bg: #1a1a1a;
  --btn-fg: #ffffff;

  --display: "Kanit", "IBM Plex Sans KR", "Noto Sans Thai", ui-sans-serif, system-ui, sans-serif;
  --body: "IBM Plex Sans Thai", "IBM Plex Sans KR", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Sans KR", ui-monospace, SFMono-Regular, monospace;

  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

/* Theme precedence (same as landing): OS default → explicit data-theme wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wb {
    --ink: #f2f2f0;
    --paper: #101011;
    --wash: #191a1b;
    --line: #2e2f30;
    --muted: #9b9c9e;
    --faint: #6d6e70;
    --accent: #d18836;
    --fail: #cf6679;
    --btn-bg: #f2f2f0;
    --btn-fg: #101011;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] .wb {
  --ink: #f2f2f0;
  --paper: #101011;
  --wash: #191a1b;
  --line: #2e2f30;
  --muted: #9b9c9e;
  --faint: #6d6e70;
  --accent: #d18836;
  --fail: #cf6679;
  --btn-bg: #f2f2f0;
  --btn-fg: #101011;
  color-scheme: dark;
}

:root[data-theme="light"] .wb {
  --ink: #1a1a1a;
  --paper: #ffffff;
  --wash: #f4f5f5;
  --line: #d1d3d4;
  --muted: #6b6c6e;
  --faint: #a7a9ac;
  --accent: #be7429;
  --fail: #a33b3b;
  --btn-bg: #1a1a1a;
  --btn-fg: #ffffff;
  color-scheme: light;
}

/* Thai / Korean leading — landing.css parity. */
.wb :where([lang="th"]) { line-height: 1.9; }
.wb h1[lang="th"], .wb h2[lang="th"], .wb .wb-h[lang="th"] { line-height: 1.4; letter-spacing: 0; }
.wb[lang="th"] .wb-h { line-height: 1.4; letter-spacing: 0; }
.wb[lang="ko"] { line-height: 1.75; }
.wb[lang="ko"] .wb-label,
.wb[lang="ko"] .wb-step-n { letter-spacing: 0.02em; }
.wb[lang="ko"] :where(h1, h2, h3, .wb-h, .wb-step-h, .wb-plain-item h3) {
  letter-spacing: 0;
  line-height: 1.4;
}

.wb *,
.wb *::before,
.wb *::after {
  box-sizing: border-box;
}

.wb a {
  color: inherit;
}

.wb :where(a, button, input):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wb-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 22px;
}

.wb-shell.is-wide,
.wb-shell.is-auth {
  max-width: 1080px;
}

@media (min-width: 900px) {
  .wb-shell {
    padding: 0 28px;
  }
}

/* ── top brand ─────────────────────────────────────────────────────────── */
.wb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--line);
}

.wb-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
}

.wb-mark {
  display: inline-flex;
  color: var(--accent);
  flex-shrink: 0;
}

.wb-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wb-wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.1;
}

.wb-parent {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.wb-top-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s, box-shadow 0.15s;
}

.wb-top-link:hover {
  color: var(--accent);
  box-shadow: inset 0 -1px 0 var(--accent);
}

.wb-top-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wb-lang {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.wb-lang button {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.15s;
  font: inherit;
  letter-spacing: inherit;
}

.wb-lang button:hover { color: var(--accent); }
.wb-lang button.is-on {
  color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--ink);
}
.wb-lang span { color: var(--line); }

.wb-theme {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: 0.15s;
  border-radius: 0;
}
.wb-theme:hover { border-color: var(--accent); color: var(--accent); }

/* ── main ──────────────────────────────────────────────────────────────── */
.wb-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 40px;
}

.wb-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0;
}

.wb-h {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 7vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 14px 0 0;
  max-width: 14ch;
  text-wrap: balance;
}

.wb-lede {
  margin: 14px 0 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 42ch;
}

.wb-note {
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--faint);
  max-width: 34ch;
}

/* Sign-in / request-access: landing copy beside the form. */
.wb-auth {
  flex: 1;
  display: grid;
  gap: 48px;
  align-items: start;
  padding: 48px 0 40px;
}

@media (min-width: 880px) {
  .wb-auth {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 64px;
    padding: 56px 0 48px;
    align-items: center;
  }
}

.wb-auth-copy .wb-h {
  max-width: 12ch;
  font-size: clamp(36px, 5.5vw, 56px);
}

.wb-auth-copy .wb-lede {
  max-width: 46ch;
  font-size: clamp(15.5px, 1.5vw, 17.5px);
  margin-top: 22px;
}

.wb-auth-panel {
  border-top: 1px solid var(--ink);
  padding-top: 22px;
}

@media (min-width: 880px) {
  .wb-auth-panel {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 8px 0 8px 48px;
  }
}

.wb-auth-panel .wb-form {
  margin-top: 18px;
}

.wb-auth-panel .wb-h {
  font-size: clamp(28px, 4vw, 36px);
  max-width: 12ch;
}

.wb-auth-panel .wb-lede {
  max-width: 30ch;
  font-size: 14.5px;
}

.wb-section-label {
  margin: 0 0 18px;
}

.wb-close {
  padding: 24px 0 56px;
  border-top: 1px solid var(--ink);
}

.wb-close .wb-h {
  max-width: 16ch;
}

/* How-it-works strip (ported from marketing landing). */
.wb-steps {
  display: grid;
  gap: 0;
  margin: 0 0 56px;
  border-top: 1px solid var(--ink);
}

@media (min-width: 720px) {
  .wb-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .wb-steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

.wb-step {
  padding: 22px 24px 26px 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 720px) {
  .wb-step {
    border-top: 0;
    border-right: 1px solid var(--line);
    padding: 28px 24px 8px 0;
  }

  .wb-step:nth-child(2n) {
    border-right: 0;
    padding-right: 0;
  }

  .wb-step:nth-child(n + 3) {
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding-top: 28px;
  }
}

@media (min-width: 1040px) {
  .wb-step {
    border-right: 1px solid var(--line);
    border-top: 0 !important;
    margin-top: 0 !important;
    padding-top: 28px !important;
  }

  .wb-step:nth-child(2n) {
    border-right: 1px solid var(--line);
    padding-right: 24px;
  }

  .wb-step:last-child {
    border-right: 0;
    padding-right: 0;
  }
}

.wb-step-n {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0;
}

.wb-step-h {
  font-family: var(--display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 12px 0 0;
  max-width: 14ch;
}

.wb-step-p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 28ch;
  padding-right: 8px;
}

/* Said plainly — compact honesty band. */
.wb-plain {
  margin: 0 0 48px;
}

.wb-plain-grid {
  display: grid;
  gap: 28px;
  margin-top: 22px;
}

@media (min-width: 720px) {
  .wb-plain-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 48px;
  }
}

.wb-plain-item {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.wb-plain-item h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.012em;
  margin: 0;
}

.wb-plain-item p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 36ch;
}

/* Measuring rule — same device as the marketing landing. */
.wb-rule {
  display: block;
  width: 100%;
  height: 12px;
  color: var(--accent);
  margin: 28px 0 8px;
}

/* ── form ──────────────────────────────────────────────────────────────── */
.wb-form {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wb-field {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.wb-field:first-of-type {
  border-top-color: var(--ink);
}

.wb-field label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}

.wb-field input {
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s;
}

.wb-field input:hover {
  border-bottom-color: var(--muted);
}

.wb-field input:focus {
  border-bottom-color: var(--accent);
}

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

.wb-actions {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 30px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--btn-bg);
  border-radius: 0;
  color: var(--btn-fg);
  -webkit-text-fill-color: var(--btn-fg);
  background: var(--btn-bg);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s, -webkit-text-fill-color 0.16s;
}

.wb-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  -webkit-text-fill-color: #fff;
}

.wb-btn.is-quiet {
  background: transparent;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  border-color: var(--line);
}

.wb-btn.is-quiet:hover {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.wb-error {
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fail);
}

.wb-ok {
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

.wb-ok strong {
  color: var(--ink);
  font-weight: 600;
}

.wb-links {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.wb-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.wb-links a:hover {
  color: var(--accent);
}

.wb-links span {
  margin: 0 0.35em;
  color: var(--line);
}

/* ── public home (same token system) ───────────────────────────────────── */
.wb-hero {
  padding: 56px 0 48px;
}

.wb-hero .wb-h {
  max-width: 16ch;
  font-size: clamp(36px, 7vw, 64px);
}

.wb-hero .wb-lede {
  max-width: 48ch;
  font-size: clamp(16px, 1.8vw, 18px);
  margin-top: 22px;
}

.wb-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.wb-cta-row .wb-btn {
  width: auto;
  min-width: 160px;
}

.wb-grid {
  display: grid;
  gap: 0;
  margin: 0 0 64px;
  border-top: 1px solid var(--ink);
}

@media (min-width: 720px) {
  .wb-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.wb-card {
  padding: 26px 28px 30px 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 720px) {
  .wb-card {
    border-top: 0;
    border-right: 1px solid var(--line);
    padding: 28px 28px 8px 0;
  }

  .wb-card:last-child {
    border-right: 0;
    padding-right: 0;
  }

  .wb-card:first-child {
    padding-left: 0;
  }
}

.wb-card h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 0;
  max-width: 16ch;
}

.wb-card p {
  margin: 12px 0 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 28ch;
  padding-right: 12px;
}

/* ── footer ────────────────────────────────────────────────────────────── */
.wb-foot {
  border-top: 1px solid var(--line);
  padding: 22px 0 36px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

@media (prefers-reduced-motion: reduce) {
  .wb * {
    transition: none !important;
  }
}
