/* PubWispApp — hand-written CSS.
   Deliberately NOT utility-class shorthand: a hand-written subset that
   looks like Tailwind is a trap, because an undefined class errors nowhere
   and silently paints inherited styles. Every class here is defined in this
   file and nowhere else. */

:root {
  --accent: #0b6bcb;
  --accent-dark: #084e96;
  --ink: #1f2933;
  --muted: #5c6472;
  --line: #d7dee6;
  --bg: #f7f9fc;
  --card: #ffffff;
  --ok: #1b873e;
  --gap: #c0392b;
  --planned: #b7791f;
  --focus: #ffbf47;
  --radius: 8px;
  --maxw: 46rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.wrap-wide { max-width: 60rem; }

/* Keyboard users must always be able to see where they are. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--card); padding: .6rem 1rem; z-index: 10;
}
.skip-link:focus { left: .5rem; top: .5rem; }

header.site {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: .85rem 1.25rem;
}
header.site .brand {
  max-width: var(--maxw); margin: 0 auto;
  font-weight: 700; font-size: 1.1rem; color: var(--accent);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
}
header.site .brand span { font-weight: 400; font-size: .85rem; color: var(--muted); }

h1 { font-size: 1.8rem; line-height: 1.25; margin: 1.25rem 0 .5rem; }
h2 { font-size: 1.3rem; margin: 1.75rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 .4rem; }
p { margin: .6rem 0; }
.lede { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); font-size: .92rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}

.btn {
  display: inline-block; font: inherit; font-weight: 600;
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent); border-radius: var(--radius);
  padding: .65rem 1.3rem; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: var(--card); color: var(--accent); }
.btn-secondary:hover { background: #eef4fb; }
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }

label { display: block; font-weight: 600; margin: .9rem 0 .25rem; }
label .req { color: var(--gap); font-weight: 700; }
label .opt { font-weight: 400; color: var(--muted); font-size: .85rem; }

input[type=text], input[type=email], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: .55rem .65rem;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
input[aria-invalid="true"] { border-color: var(--gap); border-width: 2px; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0; padding: .75rem 1rem 1.1rem; }
legend { font-weight: 700; padding: 0 .4rem; }

/* Tri-state control rows */
.control { border-top: 1px solid var(--line); padding: .8rem 0; }
.control:first-of-type { border-top: 0; }
.control .q { font-weight: 500; margin-bottom: .45rem; }
.choices { display: flex; gap: .5rem; flex-wrap: wrap; }
.choices label {
  margin: 0; font-weight: 500; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  padding: .3rem .9rem; background: #fff;
}
.choices input { margin-right: .35rem; }
.choices label:has(input:checked) { border-color: var(--accent); background: #eaf2fc; font-weight: 700; }
.choices label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.badge { display: inline-block; font-size: .78rem; font-weight: 700;
  border-radius: 999px; padding: .1rem .55rem; margin-right: .4rem; }
.badge.ok { background: #e4f4e9; color: var(--ok); }
.badge.gap { background: #fbe6e3; color: var(--gap); }
.badge.planned { background: #fdf0dc; color: var(--planned); }

.steps { display: flex; gap: .4rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 1rem 0 0; font-size: .85rem; }
.steps li { color: var(--muted); border-bottom: 3px solid var(--line); padding: .2rem .5rem; }
.steps li[aria-current="step"] { color: var(--accent); border-color: var(--accent); font-weight: 700; }

.notice { border-left: 4px solid var(--accent); background: #eef4fb; padding: .8rem 1rem; border-radius: 0 6px 6px 0; margin: 1rem 0; }
.notice.error { border-color: var(--gap); background: #fbe9e7; }
.notice.ok { border-color: var(--ok); background: #e8f6ec; }
.notice ul { margin: .4rem 0 0; padding-left: 1.2rem; }

.summary dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .9rem; margin: .5rem 0; }
.summary dt { font-weight: 600; color: var(--muted); }
.summary dd { margin: 0; }
.summary ul { margin: .4rem 0; padding-left: 1.2rem; }
.summary .firm-name { font-size: 1.25rem; font-weight: 700; }
.summary .control-counts { list-style: none; padding: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.summary .disclaimer { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .7rem; margin-top: 1rem; }

table.inv { width: 100%; border-collapse: collapse; margin-top: .5rem; }
table.inv th, table.inv td { border: 1px solid var(--line); padding: .35rem; text-align: left; font-size: .9rem; }
table.inv input { border: 0; padding: .2rem; }
.table-scroll { overflow-x: auto; }

.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -.15em; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

footer.site { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.25rem; text-align: center; font-size: .85rem; color: var(--muted); }
footer.site a { color: var(--muted); }

.price { font-size: 2rem; font-weight: 700; color: var(--ink); }

/* Subscription terms. Never smaller or fainter than the price it qualifies:
   an auto-renewal disclosure in fine print is the thing the statutes exist
   to prevent. */
.price-terms { font-size: .95rem; color: var(--ink); margin-top: .15rem; }
