/*
 * app.css -- the whole look of the import page. One accent variable, system
 * fonts, a light theme that sits quietly inside the CRM chrome the page is
 * framed in. No web fonts (nothing is fetched from the network -- the page's
 * Content-Security-Policy forbids it and the customer's account already pays
 * for its own fonts).
 *
 * The page is framed at whatever width the chrome gives it, on a laptop or a
 * phone, so everything is a single column that stays readable at 360px. The
 * only horizontal scroll allowed is inside .tablewrap.
 */

:root {
  --accent: #1f6feb;          /* the one brand colour; change this line only */
  --accent-dark: #174ea6;
  --ink: #1b1f24;
  --ink-soft: #57606a;
  --line: #d8dee4;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --good: #1a7f37;
  --warn: #9a6700;
  --bad: #b3261e;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

h1 { font-size: 1.5rem; margin: 0 0 8px; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 18px 0 6px; }
p { margin: 0 0 12px; }

.head { margin-bottom: 20px; }
.lede { color: var(--ink-soft); }
.help { color: var(--ink-soft); font-size: 0.9rem; margin: 6px 0 0; }
.note { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- panels ---------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 0 0 18px;
  background: var(--bg);
}
.panel-quiet { background: var(--bg-soft); }

.alert {
  border: 1px solid var(--bad);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: #fff5f5;
  color: var(--bad);
  padding: 12px 14px;
  margin: 0 0 16px;
}

/* ---------- the four steps ---------- */

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.step-tab { display: flex; align-items: center; gap: 6px; }
.step-tab .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 0.8rem;
}
.step-tab[aria-current="step"] { color: var(--ink); font-weight: 600; }
.step-tab[aria-current="step"] .num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-tab.done .num { background: var(--good); border-color: var(--good); color: #fff; }

/* ---------- form controls ---------- */

.field { margin: 14px 0; }
label { display: block; font-weight: 600; margin-bottom: 4px; }

input[type="file"],
select {
  font: inherit;
  color: inherit;
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
input[type="file"] { padding: 8px; }

.btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 16px;
  min-height: 44px;                   /* a comfortable tap target on a phone */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}
.btn:hover { background: var(--bg-soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* The "Open" action on a Recent imports row: a real button (it does something),
   dressed as a link so it does not shout over the row it sits in. */
.linkbtn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 4px;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
}

/* One visible focus ring for everything keyboard users land on. */
a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- column matching ---------- */

.maplist { margin-top: 12px; }
.maprow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.maprow .req { color: var(--bad); font-weight: 600; }
.maprow .sample {
  color: var(--ink-soft);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
@media (min-width: 620px) {
  .maprow { grid-template-columns: 1fr 1fr; align-items: start; column-gap: 16px; }
  .maprow label { grid-column: 1; }
  .maprow select { grid-column: 2; grid-row: 1 / span 2; }
  .maprow .sample { grid-column: 1; }
}

.extra { margin-top: 18px; }
.extra summary { font-weight: 600; cursor: pointer; padding: 6px 0; }

/* ---------- lists of numbers and problems ---------- */

.counts { list-style: none; margin: 12px 0; padding: 0; }
.counts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.counts .n { font-weight: 600; font-variant-numeric: tabular-nums; }

.problems, .know, .checklist { margin: 8px 0; padding-left: 20px; }
.problems li, .know li, .checklist li { margin-bottom: 6px; }
.checklist { list-style: none; padding-left: 0; }
.checklist li { padding: 10px 0; border-top: 1px solid var(--line); }
.checklist .mark { font-weight: 700; margin-right: 6px; }
.checklist .ok .mark { color: var(--good); }
.checklist .todo .mark { color: var(--warn); }
.checklist .how { display: block; color: var(--ink-soft); font-size: 0.9rem; margin-top: 2px; }

.options { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 18px; }
.options legend { font-weight: 600; padding: 0 6px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.check input { margin-top: 5px; }
.check label { font-weight: 400; margin: 0; }

/* ---------- progress ---------- */

.bar {
  height: 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 8px 0 10px;
}
.bar-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.4s ease; }

/* ---------- tables ---------- */

.tablewrap { overflow-x: auto; margin: 10px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: var(--bg-soft); white-space: nowrap; }

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

/* The only rule the customer page never uses: the dev stand-in frame borrows
 * this stylesheet so the local walk-through looks like the real thing. */
iframe { display: block; width: 100%; height: 78vh; border: 1px solid var(--line); }
