/* The three-step check form, upload and paste (UX revision items 9 and 9b).
   Loaded on the check form only, after app.css. Tokens and components from DESIGN.md:
   ink carries interaction, no colour for errors (ink plus icon), 48px targets (56px for
   the primary action), 3px radius for inputs and 6px for buttons. */

/* Buttons inside the form: <button class="btn-secondary"> needs the same look as the
   link version, and its border must be visible against paper (pencil, not rule). */
.form-flow .btn-secondary {
  background: transparent;
  font: 700 1.125rem/1.2 var(--body);
  border-color: var(--pencil);
  cursor: pointer;
  gap: 8px;
}
.form-flow .btn-secondary:hover { border-color: var(--ink); }
.btn-small { min-height: 48px; padding: 8px 14px; font-size: 1rem; }

/* `hidden` wins over the buttons' display (the step-3 "keep longer" waits for JS). */
.form-flow [hidden] { display: none !important; }

/* Enter in a text field presses the first submit button: an invisible "next". */
.default-submit {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}

/* ---- Step indicator -------------------------------------------------------------------- */
.form-steps { margin-top: var(--space-lg); }
.form-steps-count {
  margin: 0 0 var(--space-sm);
  font: 700 .8125rem/1.3 var(--body);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pencil);
}
.form-steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
}
.fstep { display: inline-flex; align-items: center; gap: 10px; color: var(--pencil); }
.fstep-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: none;
  border: 1px solid var(--pencil);
  border-radius: var(--radius-sm);
  font: 600 1rem/1 var(--mono);
}
.fstep.is-current { color: var(--ink); font-weight: 700; }
.fstep.is-current .fstep-n { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.fstep.is-done { color: var(--ink); }
.fstep.is-done .fstep-n { border-color: var(--ink); }

/* ---- Step 1: three ways in ------------------------------------------------------------- */
.ways { list-style: none; margin: var(--space-md) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.ways a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 8px 14px;
  border: 1px solid var(--pencil); border-radius: var(--radius-md);
  color: var(--ink); font-weight: 700; text-decoration: none;
}
.ways a:hover { border-color: var(--ink); }
.anchor { display: block; width: 0; height: 0; overflow: hidden; scroll-margin-top: var(--space-md); }
.upload-step, .paste-step, .check-form { scroll-margin-top: var(--space-md); }
.step-intro .muted { margin: 0; max-width: 60ch; }

/* The file control: a translated, styled button over the native input. Only with
   JavaScript (the page then shows the chosen files); without it the native control. */
.file-pick { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-sm); }
.btn-file { display: none; }
.js .file-pick input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
}
.js .btn-file {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 14px 24px;
  background: var(--primary); color: var(--on-primary);
  font: 700 1.1875rem/1.2 var(--body);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.js .btn-file:hover { background: var(--primary-hover); }
.js .btn-file-secondary {
  background: transparent; color: var(--ink);
  border: 1px solid var(--pencil);
}
.js .btn-file-secondary:hover { background: transparent; border-color: var(--ink); }
.js .file-pick input[type="file"]:focus-visible + .btn-file {
  outline: 3px solid var(--marker);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--ink);
}
.js .upload-form .form-actions .btn[data-waiting] { opacity: .6; }
.file-field .file-label { font-weight: 700; }
.file-name:empty, .upload-status:empty { display: none; }

/* Page thumbnails: a photo per page, each with "retake" and "remove". */
.thumbs {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: var(--space-md);
  max-width: 720px;
}
.thumbs[hidden] { display: none; }
.thumb { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.thumb-img {
  aspect-ratio: 3 / 4;
  width: 100%;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font: 600 1rem var(--mono); color: var(--pencil);
}
.thumb-name { font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.thumb-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.thumb-actions .btn-secondary { min-height: 44px; padding: 6px 10px; font-size: 1rem; }

/* First privacy layer at the field. */
.privacy-note { max-width: 66ch; font-size: 1.125rem; }
.privacy-note p { margin: 0; }
.privacy-details { margin-top: var(--space-sm); }
.privacy-details summary {
  cursor: pointer; font-weight: 700; min-height: 48px;
  display: inline-flex; align-items: center;
  text-decoration: underline; text-underline-offset: .15em;
}
.privacy-details ul { margin: var(--space-sm) 0; padding-left: 1.3em; }
.privacy-details p { color: var(--pencil); }

/* Paste */
.paste-form { display: flex; flex-direction: column; gap: var(--space-md); max-width: 720px; }
.paste-form .form-actions { margin-top: 0; }
textarea {
  width: 100%;
  min-height: 11em;
  padding: 10px 12px;
  font: 400 1.0625rem/1.45 var(--body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--pencil);
  border-radius: var(--radius-sm);
  resize: vertical;
}

/* Paste preview: the redacted text with its placeholders marked (ink, dashed: "this was
   personal data", never the highlighter or red). */
.preview-summary { display: flex; flex-direction: column; gap: var(--space-sm); max-width: 720px; }
.preview-summary p, .preview-kinds { margin: 0; }
.preview-kinds { padding-left: 1.3em; }
.preview-label { font-size: 1.125rem; margin: var(--space-md) 0 0; }
.preview-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 28em;
  overflow: auto;
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font: 400 1rem/1.5 var(--body);
}
.preview-text .ph {
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  outline: 1.5px dashed var(--ink);
  outline-offset: 1px;
  border-radius: 2px;
  padding: 0 2px;
  margin: 0 2px;
}

/* ---- Step 2: the home questions ----------------------------------------------------------- */
.questions { display: flex; flex-direction: column; gap: var(--space-xl); max-width: 720px; }
.q { border-top: 1px solid var(--rule) !important; padding-top: var(--space-lg) !important; }
.q:first-child { border-top: 0 !important; padding-top: 0 !important; }
fieldset.field .q-title {
  font: 700 1.375rem/1.25 var(--display);
  margin-bottom: var(--space-sm);
  float: left; width: 100%;
}
.q-title + * { clear: both; }
.q-help { margin: 0 0 var(--space-md); color: var(--pencil); max-width: 60ch; }
.options-stacked { flex-direction: column; align-items: stretch; }
.options-stacked .option { display: flex; }
.option-text { display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.option-note { font-size: 1rem; color: var(--pencil); font-weight: 400; }
.q-sub { margin-top: var(--space-md); max-width: 360px; }
.q-source { margin: var(--space-sm) 0 0; }
.q-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-top: var(--space-lg); }
.q-count {
  font: 700 .8125rem/1.3 var(--body); letter-spacing: .04em; text-transform: uppercase;
  color: var(--pencil); margin: 0 0 var(--space-sm);
}
/* One question per screen on phones (only with JavaScript; see form.js). */
.questions.is-paged .q:not(.is-active) { display: none; }
.questions.is-paged .q { border-top: 0 !important; padding-top: 0 !important; }
.q-pending .more-section, .q-pending .form-submit { display: none; }

.more-details summary {
  cursor: pointer; font-weight: 700; min-height: 48px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.more-title { font: 700 1.375rem/1.25 var(--display); text-decoration: underline; text-underline-offset: .15em; }
.more-details[open] summary { margin-bottom: var(--space-md); }
.more-details > p { margin: 0 0 var(--space-lg); max-width: 66ch; }
.hp-block { border: 0; border-top: 1px solid var(--rule); margin: var(--space-xl) 0 0; padding: var(--space-lg) 0 0; min-width: 0; }
.hp-block legend { font: 700 1.25rem/1.25 var(--display); padding: 0; float: left; width: 100%; }
.hp-block legend + * { clear: both; }
.hp-block > p { margin: var(--space-sm) 0 var(--space-lg); }

.form-flow .form-actions .btn-secondary { margin-top: var(--space-xs); }

/* ---- Step 3: meter data and the review ------------------------------------------------- */
.skip-row { margin: 0; }
.skip-link-step { min-height: 56px; padding: 14px 24px; font-size: 1.1875rem; }
.review { scroll-margin-top: var(--space-md); }
.review:focus { outline: none; }
.review-body { display: flex; flex-direction: column; gap: var(--space-xl); max-width: 720px; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); border-bottom: 1px solid var(--ink); padding-bottom: var(--space-sm); }
.review-head h3 { font-size: 1.25rem; margin: 0; }
.review-list { margin: 0; }
.review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-md);
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule);
}
.review-row dt { color: var(--pencil); }
.review-row dd { margin: 0; overflow-wrap: anywhere; }
.unknown-notes ul { margin: 0; }

/* Reading time limit: when, and one more hour. */
.ttl-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-top: var(--space-md); }
.ttl-note p { margin: 0; }
.ttl-note.is-warning {
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
}
.ttl-note.is-warning p { color: var(--ink); font-weight: 700; }

/* Quote options are buttons inside the form (switching keeps the home answers). */
.form-flow button.option-link { width: 100%; font: inherit; text-align: left; cursor: pointer; }

/* The error summary takes focus after a failed submit. */
.error-summary:focus { outline: 3px solid var(--marker); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); }

/* "Ik weet mijn verbruik" and "Weet je het niet?" on every step (v1.2, lane C). */
.link-button {
  background: none; border: 0; padding: 0; min-height: 48px;
  font: 700 1.125rem/1.3 var(--body); color: var(--ink);
  text-decoration: underline; text-underline-offset: .15em;
  cursor: pointer;
}
.link-button:focus-visible { outline: 3px solid var(--marker); outline-offset: 2px; }
.know-usage { margin: 0; }
.microcopy { margin: 0; max-width: 66ch; }
.form-grid > .microcopy { grid-column: 1 / -1; }


@media (max-width: 820px) {
  .form-flow .split > div:empty { display: none; }
  .review-row { grid-template-columns: 1fr; gap: 2px; }
  .form-steps ol { gap: var(--space-sm) var(--space-md); }
}
@media (max-width: 480px) {
  .fstep-name { font-size: 1rem; }
  .js .btn-file, .skip-link-step { width: 100%; justify-content: center; text-align: center; }
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
