:root {
  color-scheme: light;
  /* 색의 원본은 tokens.css 다(UR-133 걸음 9) — 로그인·가입·내 계정도 회계 화면과 같은 옷을
     입는다. 옛 이름은 그대로 두고 값만 받아온다. */
  --bg: var(--c-sunken);
  --surface: var(--c-ground);
  --surface-soft: #fafbfd;
  --border: var(--c-line);
  --border-strong: #d3daea;
  --ink: var(--c-ink);
  --text: var(--c-ink);
  --muted: var(--c-muted);
  --soft: var(--c-faint);
  --primary: var(--c-action);
  --primary-hover: #2449bc;
  --primary-soft: var(--c-navy-soft);
  --success: var(--c-income);
  --success-soft: #ecfdf3;
  --danger: var(--c-seal);
  --danger-soft: var(--c-seal-soft);
  --radius-sm: 8px;
  --radius-md: var(--r-card);
  --radius-lg: 16px;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { cursor: pointer; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  translate: 0 -160%;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  font-weight: 800;
}

.skip-link:focus { translate: 0; }

.signup-shell {
  display: grid;
  grid-template-columns: minmax(300px, 32vw) minmax(0, 1fr);
  min-height: 100vh;
}

.signup-aside {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 36px clamp(28px, 3vw, 52px);
}

.signup-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.signup-brand img {
  width: 52px;
  height: 38px;
  object-fit: contain;
}

.signup-brand span,
.signup-brand strong,
.signup-brand small { display: block; }

.signup-brand strong {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}

.signup-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.aside-copy { margin-top: clamp(64px, 10vh, 112px); }

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.12em;
}

.aside-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 2.5vw, 38px);
  font-weight: 800;
  line-height: 1.28;
}

.aside-copy > p:last-child {
  max-width: 370px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.signup-progress {
  display: grid;
  gap: 0;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.signup-progress li {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 72px;
  gap: 13px;
  color: var(--muted);
}

.signup-progress li:not(:last-child)::after {
  position: absolute;
  top: 34px;
  bottom: 2px;
  left: 15px;
  width: 1px;
  background: var(--border-strong);
  content: "";
}

.signup-progress li > span {
  display: grid;
  z-index: 1;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.signup-progress strong,
.signup-progress small { display: block; }

.signup-progress strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.signup-progress small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.signup-progress li.active > span,
.signup-progress li.complete > span {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.signup-progress li.active strong { color: var(--primary); }
.signup-progress li.complete:not(:last-child)::after { background: var(--primary); }

.aside-note {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.aside-note strong {
  color: var(--ink);
  font-size: 12px;
}

.aside-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.signup-main {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
}

.signup-topbar {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 16px clamp(28px, 4vw, 64px);
  color: var(--muted);
  font-size: 12px;
}

.signup-content {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 52px 32px 64px;
}

.signup-step { display: none; }
.signup-step.active { display: block; }

.form-heading { margin-bottom: 32px; }

.form-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.form-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.form-heading > p strong { color: var(--ink); }
.form-heading.centered { text-align: center; }

fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

legend,
.field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

legend span,
.field > span b {
  color: var(--danger);
  font-weight: 800;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.segmented-control label { min-width: 0; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }

.segmented-control span {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.segmented-control input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.segmented-control input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
  margin-top: 24px;
}

.field { display: block; min-width: 0; }
.field.full { grid-column: 1 / -1; }

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

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

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(52 70 168 / 10%);
  outline: 0;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.field > small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.field > .field-error {
  min-height: 0;
  color: var(--danger);
  font-weight: 650;
}

.consent-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 13px 14px;
}

.consent-box label {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
}

.consent-box input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.consent-box span { font-size: 12px; }
.consent-box span b { color: var(--primary); }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
}

.button.secondary:hover { border-color: var(--primary); color: var(--primary); }

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.button.primary:hover { border-color: var(--primary-hover); background: var(--primary-hover); }

.button.danger {
  border-color: #efb7bf;
  background: var(--danger-soft);
  color: var(--danger);
}

.button.danger:hover {
  border-color: var(--danger);
  background: #ffe5e8;
}

.submit-button {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.form-actions .button { min-height: 48px; }
.form-actions .button.primary { flex: 1; }

.text-button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 4px;
  font-size: 12px;
  font-weight: 800;
}

.text-button:hover { text-decoration: underline; }

.form-error {
  min-height: 19px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.verification-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 22px;
}

.verification-card input {
  height: 56px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-align: center;
}

.verification-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.verification-meta strong { color: var(--danger); }

.step-actions {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.step-actions .button { min-height: 48px; }

.prototype-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.pending-symbol {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  margin: 16px auto 20px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 26px;
  font-weight: 800;
}

.request-summary {
  overflow: hidden;
  margin: 30px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.request-summary div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 20px;
  padding: 14px 18px;
}

.request-summary div + div { border-top: 1px solid var(--border); }

.request-summary dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.request-summary dd { margin: 0; color: var(--ink); font-weight: 750; }

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
}

.pending-notice {
  margin-top: 16px;
  border-left: 3px solid var(--primary);
  background: var(--surface);
  padding: 13px 16px;
}

.pending-notice strong { color: var(--ink); font-size: 12px; }
.pending-notice p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

.signup-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  color: var(--muted);
  font-size: 11px;
}

.signup-footer a { color: var(--primary); font-weight: 800; }

.terms-dialog {
  width: min(calc(100% - 32px), 560px);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 72px rgb(17 24 39 / 24%);
  color: var(--text);
  padding: 24px;
}

.terms-dialog::backdrop { background: rgb(17 24 39 / 48%); }

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-head h2 { margin: 0; color: var(--ink); font-size: 18px; }

.dialog-head button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.dialog-body { margin: 20px 0; }
.dialog-body dl { margin: 0; }
.dialog-body dl div { padding: 12px 0; border-bottom: 1px solid var(--border); }
.dialog-body dt { color: var(--ink); font-weight: 800; }
.dialog-body dd { margin: 4px 0 0; color: var(--muted); }
.dialog-body p { margin: 16px 0 0; color: var(--muted); font-size: 11px; }
.terms-dialog > .button { width: 100%; }

/* 담당 구역 — 시/도·시/군/구·읍/면/동·N구역 네 칸과 조합 결과 한 줄(8월 28일 노션 1-2). */
.region-fieldset { margin-top: 24px; }
/* .field·.signup-progress li 가 display 를 정하므로 hidden 속성이 지도록 명시한다. */
.region-fieldset[hidden],
.field[hidden],
.signup-progress li[hidden] { display: none; }
.region-grid { margin-top: 0; }

.region-preview {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 10px 12px;
  font-size: 12px;
}

.region-preview span { flex: 0 0 auto; color: var(--muted); font-weight: 700; }
.region-preview strong { color: var(--ink); word-break: keep-all; }

@media (max-width: 900px) {
  .signup-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .signup-aside { padding: 28px 24px; }
  .aside-copy h1 { font-size: 26px; }
  .aside-copy > p:last-child { font-size: 12px; }
  .signup-progress small { display: none; }
  .signup-content { padding-inline: 24px; }
}

@media (max-width: 680px) {
  .signup-shell { display: block; }

  .signup-aside {
    position: static;
    display: block;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 20px 18px 16px;
  }

  .signup-brand img { width: 46px; height: 34px; }
  .signup-brand strong { font-size: 17px; }
  .aside-copy,
  .aside-note { display: none; }

  .signup-progress {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
  }

  .signup-progress li {
    display: flex;
    min-height: 0;
    align-items: center;
    gap: 7px;
  }

  .signup-progress li::after { display: none; }
  .signup-progress li > span { width: 26px; height: 26px; flex: 0 0 26px; }
  .signup-progress strong { margin: 0; font-size: 11px; white-space: nowrap; }

  .signup-topbar {
    min-height: 60px;
    padding: 10px 18px;
  }

  .signup-topbar span { display: none; }
  .signup-topbar .button { min-height: 40px; }

  .signup-content { padding: 30px 18px 44px; }
  .form-heading { margin-bottom: 24px; }
  .form-heading h2 { font-size: 24px; }
  .form-heading > p:last-child { font-size: 13px; }

  .segmented-control { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .region-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .field.full { grid-column: auto; }
  .field input,
  .field select { min-height: 48px; }

  .consent-box { align-items: flex-start; }
  .step-actions { grid-template-columns: 100px minmax(0, 1fr); }
  .request-summary div { grid-template-columns: 92px minmax(0, 1fr); }
  .signup-footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

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

/* login.html 전용 최소 스타일. signup-shell 은 가입 위저드의 2단 그리드 전용이라
   단일 카드 레이아웃인 로그인 화면에는 별도 클래스가 필요하다(태스크 12 브리프). */
.login-shell {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 380px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 32px 28px;
}

.login-card h1 { margin: 0 0 20px; color: var(--ink); font-size: var(--t-title); font-weight: 800; }
.login-card label { display: block; margin: 16px 0 6px; color: var(--text); font-size: var(--t-aux); font-weight: 800; }

.login-card input {
  width: 100%;
  min-height: var(--tap-min);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: var(--t-body);
}

.login-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(52 70 168 / 10%);
  outline: 0;
}

.login-card .button { width: 100%; min-height: var(--tap-min); margin-top: 20px; }
.login-card p { margin: 16px 0 0; color: var(--muted); font-size: var(--t-aux); }
.login-card p a { color: var(--primary); font-weight: 700; }

.login-message { margin: 0 0 12px; color: var(--success); font-size: 12px; font-weight: 700; }
.login-message.error { color: var(--danger); }

/* 내 계정 카드(account.html 무쿼리 진입, UR-093) */
.account-summary { display: grid; gap: 8px; margin: 0 0 8px; }
.account-summary > div { display: grid; grid-template-columns: 84px 1fr; align-items: baseline; }
.account-summary dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.account-summary dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; word-break: break-all; }
#flow-account form { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
#flow-account h2 { margin: 0 0 4px; color: var(--ink); font-size: 14px; font-weight: 800; }
.account-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.account-actions .button { text-decoration: none; }
