/*
 * app.css -- the whole look of the import page. Stride's own colours (mint on
 * deep navy, the CRM's pale page tint), system fonts, a light theme that sits
 * flush 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.
 */

/*
 * The brand colours were sampled from the live Stride app. Two rules keep them
 * readable, and every ratio below is WCAG contrast (4.5:1 is the pass mark):
 *   - Mint is a FILL only. What sits on it is navy (10.9:1); white on mint is
 *     1.7:1 and cannot be read.
 *   - Mint is never TEXT on a light background. Links and any other
 *     accent-coloured words use the deep teal instead.
 * --good / --warn / --bad stay plain green, amber and red so a status never
 * looks like a mint button.
 */
:root {
  --accent: #74d7c3;          /* Stride mint: primary buttons, step markers, progress */
  --accent-dark: #5fcbb5;     /* the same mint, hovered (navy on it: 9.5:1) */
  --accent-darker: #4dbba4;   /* ...and pressed (7.9:1) */
  --on-accent: #011425;       /* the navy that sits ON mint */
  --accent-text: #0b6b5a;     /* links + accent words: 6.4:1 on white, 6.0:1 on the page */
  --navy: #021621;            /* headings, the focus ring, the progress track */
  --ink: #0e2230;
  --ink-soft: #52636b;        /* 5.8:1 on the page, 6.3:1 on a card */
  --line: #d5e0e7;
  --line-strong: #7f949f;     /* outlines of things you can press or fill in: 3.2:1 */
  --bg: #ffffff;              /* cards */
  --bg-page: #f2f7fa;         /* the CRM's own content background, so the page sits flush */
  --bg-soft: #eaf1f5;
  --good: #1a7f37;
  --warn: #9a6700;
  --bad: #b3261e;
  --radius: 8px;
  --radius-btn: 16px;         /* the pill of the CRM's own menu */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg-page);
  font: 16px/1.55 Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", 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; }
h1, h2, h3 { color: var(--navy); }
a { color: var(--accent-text); }
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);
  box-shadow: 0 1px 2px rgba(2, 22, 33, 0.06);
}
.panel-quiet { background: var(--bg-page); box-shadow: none; }

.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-strong);
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
}
.step-tab[aria-current="step"] { color: var(--navy); font-weight: 600; }
.step-tab[aria-current="step"] .num,
.step-tab.done .num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Done and current are both mint; the navy ring is what says "you are here". */
.step-tab[aria-current="step"] .num { box-shadow: 0 0 0 2px var(--navy); }

/* ---------- 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-strong);
  border-radius: var(--radius);
  background: var(--bg);
}
input[type="file"] { padding: 8px; }
input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-btn);
  background: var(--bg);
  color: var(--ink);
}
input[type="file"]::file-selector-button:hover { background: var(--bg-soft); }
input[type="checkbox"] { accent-color: var(--accent-text); }

.btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 18px;
  min-height: 44px;                   /* a comfortable tap target on a phone */
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-btn);
  background: var(--bg);
  color: var(--ink);
}
.btn:hover { background: var(--bg-soft); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-primary:active { background: var(--accent-darker); border-color: var(--accent-darker); }
.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);
  text-decoration: underline;
}

/* One visible focus ring for everything keyboard users land on -- including the
   step headings, which the page moves focus to on every step. Navy, never mint:
   a mint ring on a white card would be invisible. */
a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible,
input:focus-visible,
h2:focus-visible,
h3:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}
/* A heading is somewhere you arrive, not something you press: a slimmer ring. */
h2:focus-visible,
h3:focus-visible { outline-width: 2px; outline-offset: 4px; border-radius: 4px; }

.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(--navy);            /* mint on navy is 10.8:1; mint on white would vanish */
  border: 1px solid var(--navy);
  overflow: hidden;
  margin: 8px 0 10px;
}
.bar-fill { height: 100%; width: 0%; border-radius: 999px; 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; color: var(--navy); 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); }
