/* Interactive E-Bike Check. Builds on card.css (tokens, page, header, light and dark). */

:root {
  --ok: #1a7f4d;
  --ok-bg: #e3f4ea;
  --bad: #b3261e;
  --bad-bg: #fbe5e3;
  --warn: #8a5a00;
  --warn-bg: #fff0c9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ok: #5fe0a0;
    --ok-bg: #0f3324;
    --bad: #ff8a80;
    --bad-bg: #3d1513;
    --warn: #ffd166;
    --warn-bg: #3a2b08;
  }
}

[hidden] { display: none !important; }
.top--check { margin-bottom: 12px; }
.top--check .top__logo { width: min(180px, 56%); margin-bottom: 10px; }

.panel {
  margin: 0 0 16px; padding: 14px 16px; border: 3px solid var(--c-navy); border-radius: 14px;
  background: var(--surf);
}
.panel p + p, .panel p + .btn { margin-top: 10px; }
.lead { font-size: 1.25rem; font-weight: 800; line-height: 1.3; }

/* buttons: square-cornered, full-size tap targets */
.btn {
  display: block; width: 100%; min-height: 56px; padding: 10px 14px;
  border: 3px solid var(--c-navy); border-radius: 10px; background: var(--surf); color: var(--ink);
  font: inherit; font-weight: 800; cursor: pointer;
}
.btn--go { border-color: var(--fill); background: var(--fill); color: var(--on-fill); }
.btn--small { display: inline-block; width: auto; min-height: 48px; padding: 6px 16px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn--submit:disabled { opacity: 1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.row2--photo { display: flex; flex-wrap: wrap; }  /* one row, or one each at large text */
.row2--photo > * { flex: 1 1 5em; }
.row2--photo > :first-child { flex: 2 1 10em; }  /* Manual is the narrow one (Dan 2026-10-08) */

.step { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }

/* photo and read status: the whole photo, never cropped; a tap shows it full size */
.shot { margin: 12px 0 0; }
.shot__btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.shot img { width: 100%; height: auto; max-height: 60vh; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; }
.shot--big img { max-height: none; }
.shot .status { margin-top: 8px; }
.status { font-weight: 800; }
.status--error { margin-top: 10px; color: var(--bad); }

/* label boxes: only the unsure or unreadable ones, or all three for "Manual" and "Edit" */
.boxes { display: grid; gap: 10px; margin-top: 12px; }
.box {
  display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--tint);
}
.box--open { border: 3px solid var(--amber-bar); }
.box > label { flex: 1 1 8em; min-width: 0; }
.box > .box__name, .box > .opts, .box__raw { flex: 1 1 100%; }
.box .opts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 4.5em), 1fr)); }
.box__name { display: block; margin-bottom: 4px; font-weight: 800; }
.box__raw { font-weight: 700; overflow-wrap: anywhere; }
.unit { display: flex; gap: 8px; }
.unit .opt span { padding-inline: 12px; }
.box input, .speed input {
  width: 100%; min-height: 52px; padding: 8px 12px; border: 3px solid var(--c-navy); border-radius: 10px;
  background: var(--surf); color: var(--ink); font: inherit; font-size: 1.25rem;
}
.box__ok[aria-pressed="true"] { border-color: var(--ok); color: var(--ok); }
.box__ok[aria-pressed="true"]::before { content: "\2713\00a0"; }

/* the five questions */
.q { margin: 0 0 16px; }
.q__name { display: block; margin-bottom: 8px; font-size: 1.2rem; font-weight: 800; }
.hint { display: block; font-size: 1rem; font-weight: 600; color: var(--ink-2); }
/* answers reflow to fewer columns as the text grows (no viewport breakpoints) */
.opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.5em), 1fr)); }
.opt { position: relative; display: block; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.opt span {
  display: flex; flex-direction: column; justify-content: center; height: 100%; min-height: 56px;
  padding: 8px 6px; border: 3px solid var(--edge); border-radius: 10px; background: var(--surf);
  font-weight: 800; line-height: 1.2; text-align: center; cursor: pointer; overflow-wrap: anywhere;
}
.opt input:checked + span { border-color: var(--fill); background: var(--fill); color: var(--on-fill); }
.opt input:checked + span .hint { color: var(--on-fill); }
.opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.opt input:disabled + span { opacity: 0.6; cursor: default; }
.speed { display: flex; align-items: center; gap: 10px; max-width: 220px; font-weight: 800; }

/* result: headline, then Edit and New check, then the why (scoped: the card has its own .res) */
#result .res { margin: 0 0 12px; padding: 16px; border-left: 10px solid var(--rc); border-radius: 12px; background: var(--rb); }
#result .res--green { --rc: var(--ok); --rb: var(--ok-bg); }
#result .res--red { --rc: var(--bad); --rb: var(--bad-bg); }
#result .res--yellow { --rc: var(--warn); --rb: var(--warn-bg); }
#result .res h2 { color: var(--rc); font-size: 1.75rem; font-weight: 800; line-height: 1.1; outline: none; }
#result .res p { margin-top: 6px; font-size: 1.2rem; font-weight: 700; }
#result .res .res__why { font-size: 1.05rem; font-weight: 500; }
#result .res .row2 { margin: 12px 0 0; }
.res__notes { list-style: none; margin: 0 0 12px; }
.res__notes li { padding: 4px 0 4px 12px; border-left: 4px solid var(--amber-bar); }
.res__said { margin: 0 0 12px; font-weight: 700; }
.res__label { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.res__label img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; }
.res__label p { flex: 1; min-width: 12em; font-weight: 700; }
.res__more { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--tint); }
.res__more summary { min-height: 52px; padding: 12px 16px; font-weight: 800; cursor: pointer; }
.res__more > ul, .res__more > div { padding: 0 16px 12px 34px; }
.res__more h3 { margin: 8px 0 4px -18px; font-size: 1rem; }
.res__more li { margin: 0 0 6px; }
.res__more .why { display: block; color: var(--ink-2); font-size: 1rem; }
.res__more a { overflow-wrap: anywhere; }
.rider { margin-top: 12px; font-weight: 700; }
.rider p + p { margin-top: 4px; }
.rider__mark { color: var(--warn); }
.res__rev { margin-top: 12px; color: var(--ink-2); font-size: 1rem; }

.privacy { margin: 32px 0 16px; color: var(--ink-2); font-size: 1rem; }
.privacy h2 { margin-bottom: 6px; color: var(--ink); font-size: 1.1rem; }
.privacy p + p { margin-top: 8px; }

/* #1, the Interactive E-Bike Check, is the section meant to stand out (Dan 2026-10-08):
   a bright green filled bar. White bold 1.2rem text on #12a150 passes WCAG AA for large text. */
.sec--check { --ac: #ffffff; --bd: #ffffff; --bt: #12a150; --go: #12a150; border-color: var(--go); box-shadow: 0 4px 16px rgb(18 161 80 / 0.45); }
.sec--check > summary { border-radius: 10px; background: var(--go); color: var(--ac); text-transform: uppercase; }
.sec--check[open] > summary { border-radius: 10px 10px 0 0; }
.sec--check .sec__body > .lead:first-child { margin-bottom: 16px; font-weight: 600; }
.sec--check > summary .t { text-align: center; }

/* night: a dimmer bar with no glow, no pure white, softer outlines (Q19) */
@media (prefers-color-scheme: dark) {
  .sec--check { --ac: #e6ebf5; --bd: #e6ebf5; --bt: #0d5c33; --go: #0d5c33; box-shadow: none; }
  .btn:not(.btn--go), .panel, .box input, .speed input { border-color: var(--edge); }
  .opt span { border-color: var(--line); }
}
