/* Naptic client setup page. System fonts only (tight CSP). */
:root {
  --navy: #071D49;
  --blue: #307FE2; /* accents and borders only (4.0:1 on white) */
  --blue-dark: #1F63BC; /* text and button fills: 5.9:1 on white */
  --blue-deeper: #184F96;
  --gray: #EDEDED;
  --ink: #1A2233;
  --muted: #4A5468;
  --line: #D9DDE5;
  --white: #FFFFFF;
  --ok: #17784A;
  --ok-bg: #E6F4EC;
  --fail: #B4232F;
  --fail-bg: #FBEAEC;
  --wait: #8A5A00;
  --wait-bg: #FFF4DC;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--gray);
  overflow-wrap: anywhere;
}
h1, h2, p, ol, figure { margin: 0; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header */
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; min-height: 64px; }
.logo { display: block; height: 28px; width: auto; }

/* Intro */
.intro { padding: 32px 0 24px; }
h1 {
  font-size: clamp(28px, 4.2vw, 40px);
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -0.01em;
  max-width: 22ch;
}
.lede { margin-top: 12px; font-size: 18px; color: var(--muted); max-width: 60ch; }
.progress { margin-top: 20px; max-width: 420px; }
.progress-text { font-weight: 600; color: var(--navy); }
.progress-bar { margin-top: 8px; height: 10px; border-radius: 99px; background: var(--white); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width .3s ease; }
.progress-fill.p-done { background: var(--ok); }

/* Panels */
.notice, .all-set {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border-left: 6px solid var(--blue);
}
.notice-title, .all-set h2 { font-size: 24px; line-height: 1.25; color: var(--navy); margin-bottom: 8px; }
.notice p + .btn { margin-top: 16px; }
.all-set { border-left-color: var(--ok); background: var(--ok-bg); outline: none; }
.all-set p + p { margin-top: 6px; }
.loading { padding: 8px 0 24px; color: var(--muted); }

/* Cards */
.cards { list-style: none; padding: 0; display: grid; gap: 24px; padding-bottom: 40px; }
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--line);
}
@media (min-width: 768px) { .card { padding: 32px; } }
.card.s-ok { border-top-color: var(--ok); }
.card.s-fail { border-top-color: var(--fail); }
.card.s-retry { border-top-color: var(--wait); }

.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.step-num { font-size: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-dark); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 99px;
  font-size: 16px; font-weight: 700;
  background: var(--gray); color: var(--muted);
}
.badge-icon { font-size: 14px; line-height: 1; }
.s-ok .badge { background: var(--ok-bg); color: var(--ok); }
.s-fail .badge { background: var(--fail-bg); color: var(--fail); }
.s-retry .badge { background: var(--wait-bg); color: var(--wait); }

.card-title { margin-top: 10px; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.25; color: var(--navy); }
.why { margin-top: 6px; color: var(--muted); }

.card-body { margin-top: 20px; display: grid; gap: 24px; }
@media (min-width: 960px) {
  .card-body { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: 32px; }
}

/* Screenshot */
.shot { position: relative; border-radius: 10px; overflow: hidden; background: var(--gray); border: 1px solid var(--line); }
.shot-img { display: block; width: 100%; height: auto; }
.shot-missing {
  display: none;
  aspect-ratio: 16 / 10;
  align-items: center; justify-content: center;
  color: var(--muted); font-size: 16px; text-align: center; padding: 16px;
}
.shot.missing .shot-img { display: none; }
.shot.missing .shot-missing { display: flex; }

/* Numbered clicks */
.clicks { list-style: none; padding: 0; counter-reset: click; display: grid; gap: 14px; }
.clicks li { counter-increment: click; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.clicks li::before {
  content: counter(click);
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: var(--white); font-weight: 700; font-size: 17px;
}
.clicks li span { padding-top: 5px; }

/* Copy box */
.copy { margin-top: 24px; }
.copy-label { display: block; font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.copy-row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.copy-text {
  width: 100%; min-height: 48px;
  padding: 11px 12px;
  font-family: var(--mono); font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--gray); border: 1px solid var(--line); border-radius: 8px;
  overflow-wrap: break-word; user-select: all; -webkit-user-select: all;
}
.copy-text:focus { outline: 3px solid var(--blue); outline-offset: 1px; }
.copy-btn { min-width: 120px; }
.copy-done { margin-top: 6px; font-size: 16px; font-weight: 700; color: var(--ok); visibility: hidden; }
.copy-done.show { visibility: visible; }

/* Hint */
.hint { margin-top: 8px; padding: 12px 14px; border-radius: 8px; font-weight: 600; }
.hint:empty { display: none; }
.s-fail .hint { background: var(--fail-bg); color: var(--fail); }
.s-retry .hint { background: var(--wait-bg); color: var(--wait); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 22px;
  font: inherit; font-weight: 700; font-size: 17px;
  border-radius: 10px; border: 2px solid transparent;
  cursor: pointer;
}
.btn:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.btn:disabled { cursor: progress; opacity: .7; }
.btn-primary { background: var(--blue-dark); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--blue-deeper); }
.btn-secondary { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover:not(:disabled) { background: var(--gray); }
.done-btn { margin-top: 16px; width: 100%; }
@media (min-width: 480px) { .done-btn { width: auto; min-width: 200px; } }
.s-ok .done-btn { display: none; }

/* Footer */
.foot { padding: 24px 0 40px; color: var(--muted); font-size: 16px; }

@media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; } }
