/* 보호조치해제 — 화면 스타일
 *
 * 설계 메모
 * - 이 도구는 순서가 있는 작업대다. 그래서 1→2→3 단계 표시를 실제 구조로 쓴다.
 * - 색은 강철빛 남색 하나를 강조색으로 쓰고, 나머지는 무채색에 가깝게 눕힌다.
 * - 카드마다 같은 그림자를 까는 대신, 선 하나와 여백으로 위계를 만든다.
 * - 가장 눈에 띄어야 하는 순간은 3단계(완료) 하나뿐이다.
 */

:root {
  --paper: #eaeef2;
  --surface: #ffffff;
  --ink: #121c26;
  --ink-2: #435264;
  --ink-3: #5d6c7b;
  --line: #d5dde4;
  --line-2: #bcc7d0;
  --accent: #1f5f8b;
  --accent-deep: #17496b;
  --accent-tint: #e9f1f7;
  --warn: #982f27;
  --warn-tint: #fdecea;
  --ok: #19644a;
  --ok-tint: #e8f3ed;
  --radius: 8px;
}

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

[hidden] {
  display: none !important;
}

.hidden {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 첫 페인트 전 흔들림 방지. 숨기되 자리는 남긴다. */
body.booting .panel,
body.booting .stepper {
  visibility: hidden;
}

.topline {
  height: 3px;
  background: var(--accent);
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 34px 20px 60px;
}

/* ── 머리말 ─────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--accent);
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.link-btn {
  min-height: 0;
  padding: 4px 1px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-3);
  cursor: pointer;
}

.link-btn:hover {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}

.mast-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── 단계 표시 ───────────────────────────────────────── */
.stepper {
  display: flex;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.stepper li {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.stepper li::before {
  content: "";
  position: absolute;
  top: 13px;
  right: 50%;
  width: 100%;
  height: 1px;
  background: var(--line-2);
}

.stepper li:first-child::before {
  display: none;
}

.dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.txt {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
}

.stepper li.is-done .dot {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}

.stepper li.is-done::before {
  background: var(--accent);
}

.stepper li.is-current .dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-tint);
}

.stepper li.is-current .txt {
  color: var(--accent-deep);
}

.stepper li.is-current::before {
  background: var(--accent);
}

/* ── 패널 ───────────────────────────────────────────── */
.panel {
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.form {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: #9aa8b4;
}

input:hover {
  border-color: #a9b7c2;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 95, 139, 0.16);
}

.hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
}

.hint strong {
  color: var(--ink-2);
}

.hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eaeff3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--ink-2);
}

/* ── 버튼 ───────────────────────────────────────────── */
.btn {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

.btn-primary:disabled {
  border-color: #8fabbd;
  background: #8fabbd;
  cursor: progress;
}

.btn-quiet {
  border-color: var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
}

.btn-quiet:hover {
  border-color: #a9b7c2;
  background: #f3f6f8;
}

.btn:focus-visible,
.link-btn:focus-visible,
.url:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn {
  flex: 1;
}

.btn-row .btn-primary {
  flex: 1.5;
}

/* ── 알림 ───────────────────────────────────────────── */
.msg {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-error {
  border: 1px solid #f0c9c4;
  border-left: 3px solid var(--warn);
  background: var(--warn-tint);
  color: var(--warn);
}

.msg-note {
  border: 1px solid var(--line);
  background: #f4f7f9;
  color: var(--ink-2);
}

/* ── 인증번호 입력 ──────────────────────────────────── */
.code-input {
  height: 64px;
  padding: 0 8px;
  text-align: center;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  font-variant-numeric: tabular-nums;
}

/* ── 완료 ───────────────────────────────────────────── */
.panel-done {
  border-color: #bcd9cb;
}

.done-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: 2px;
  border: 1px solid #bcd9cb;
  border-radius: 50%;
  background: var(--ok-tint);
  color: var(--ok);
}

.seal svg {
  width: 21px;
  height: 21px;
}

.url-block {
  margin: 22px 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.url-label {
  display: block;
  padding: 7px 13px;
  border-bottom: 1px solid var(--line);
  background: #f4f7f9;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.url {
  display: block;
  padding: 12px 13px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--accent-deep);
  word-break: break-all;
  text-decoration: none;
}

.url:hover {
  background: #f8fbfd;
  text-decoration: underline;
}

/* ── 잠깐 뜨는 알림 ─────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  max-width: min(92vw, 420px);
  padding: 11px 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(18, 28, 38, 0.93);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 24px rgba(18, 28, 38, 0.24);
  animation: toast-in 0.18s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ── 좁은 화면 ──────────────────────────────────────── */
@media (max-width: 520px) {
  .app {
    padding: 26px 14px 48px;
  }

  .panel {
    padding: 22px 18px;
  }

  .panel-title {
    font-size: 18.5px;
  }

  .code-input {
    height: 58px;
    font-size: 26px;
  }

  .btn-row {
    flex-direction: column-reverse;
  }

  .btn-row .btn,
  .btn-row .btn-primary {
    flex: none;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  input,
  .btn {
    transition: none;
  }

  .toast {
    animation: none;
  }
}
