/* Recall claim form. Loaded only on the `recall` slug. Controls follow the site form
   conventions: 1px var(--border), var(--radius) corners, var(--surface) ground. */

.recall-page {
  width: 100%;
  max-width: 46rem;
}

.recall-page__form[hidden],
.recall-page__result[hidden] {
  display: none;
}

/* ---------- fieldsets ---------- */

.recall-page__fieldset {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0 0 2rem;
  padding: 1.5rem 0 0;
}

.recall-page__fieldset:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.recall-page__legend {
  padding: 0;
  margin-bottom: 0.35rem;
  font-size: var(--section-heading-size);
  font-weight: var(--section-heading-weight);
  letter-spacing: var(--section-heading-track);
  color: var(--section-heading-color);
}

.recall-page__hint {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.recall-page__optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

/* ---------- fields ---------- */

.recall-page__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.recall-page__field--wide {
  grid-column: 1 / -1;
}

/* Fields stacked straight in a fieldset get no `gap` the way grid children do, so
   space consecutive siblings explicitly. Scoped to direct children so grid cells
   (which already have a row gap) are untouched. */
.recall-page__fieldset > .recall-page__field + .recall-page__field {
  margin-top: 1.25rem;
}

/* Spans the two-column grid to introduce the email/phone pair. */
.recall-page__grid-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.recall-page__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.recall-page__input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.6rem;
  font-family: var(--font);
  font-size: inherit;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.recall-page__input:focus {
  outline: 2px solid var(--accent-orange);
  outline-offset: 1px;
  border-color: var(--accent-orange);
}

.recall-page__input[aria-invalid="true"] {
  border-color: #b3261e;
  background: #fdf3f2;
}

.recall-page__textarea {
  resize: vertical;
  min-height: 3.5rem;
}

/* ---------- attachments ---------- */

.recall-page__dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 9.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.recall-page__dropzone:hover {
  border-color: var(--link-blue);
  color: var(--text);
}

/* Dragging over the zone, and keyboard focus on the visually hidden input. */
.recall-page__dropzone.is-dragging,
.recall-page__dropzone:focus-within {
  border-color: var(--accent-orange);
  border-style: solid;
  background: #fdf6ef;
  color: var(--text);
}

.recall-page__dropzone-icon {
  flex: 0 0 auto;
  color: var(--link-blue);
}

.recall-page__dropzone.is-dragging .recall-page__dropzone-icon {
  color: var(--accent-orange);
}

/* Direct flex children, so the whitespace between them creates no stray line boxes. */
.recall-page__dropzone-drag,
.recall-page__dropzone-nodrag {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
}

.recall-page__dropzone-drag u,
.recall-page__dropzone-nodrag u {
  text-underline-offset: 0.15em;
}

.recall-page__dropzone-hint {
  font-size: 0.8rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Off-screen but focusable, so the label stays the whole hit area. */
.recall-page__file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.recall-page__filetotal {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.recall-page__filetotal[hidden] {
  display: none;
}

.recall-page__file-error {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #b3261e;
}

.recall-page__file-error[hidden] {
  display: none;
}

/* ---------- selected file list ---------- */

.static-prose ul.recall-page__filelist,
.recall-page__filelist {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  padding-left: 0;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Must match the `.static-prose ul` compound above or it loses on specificity. */
.static-prose ul.recall-page__filelist:empty,
.recall-page__filelist:empty {
  display: none;
}

.recall-page__fileitem {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.88rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.recall-page__filename {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recall-page__filesize {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.recall-page__fileremove {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 1.15rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.recall-page__fileremove:hover {
  color: #b3261e;
  border-color: var(--border);
}

/* ---------- serial rows ---------- */

/* Beats `.static-prose ul` (padding / colour) so rows align with the other fields. */
.static-prose ul.recall-page__serials,
.static-prose ul.recall-page__contacts,
.recall-page__serials,
.recall-page__contacts {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  padding-left: 0;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.recall-page__serial-row,
.recall-page__contact-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recall-page__contact-row .recall-page__input {
  flex: 1 1 auto;
  min-width: 0;
}

.recall-page__input--serial {
  flex: 1 1 auto;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.recall-page__serial-remove,
.recall-page__contact-remove {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.recall-page__serial-remove:hover,
.recall-page__contact-remove:hover {
  color: #b3261e;
  border-color: var(--border);
}

.recall-page__serial-remove[hidden],
.recall-page__contact-remove[hidden] {
  display: none;
}

.recall-page__add-serial,
.recall-page__add-contact {
  padding: 0.4rem 0;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--link-blue);
  background: none;
  border: 0;
  cursor: pointer;
}

.recall-page__add-serial:disabled,
.recall-page__add-contact:disabled {
  color: var(--muted);
  cursor: default;
}

.recall-page__add-serial:hover,
.recall-page__add-contact:hover {
  color: var(--accent-orange);
}

.recall-page__add-serial[hidden],
.recall-page__add-contact[hidden] {
  display: none;
}

/* ---------- errors ---------- */

.recall-page__errors {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #7a1a14;
  background: #fdf3f2;
  border: 1px solid #b3261e;
  border-radius: var(--radius);
}

.recall-page__errors[hidden] {
  display: none;
}

.recall-page__field-error {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #b3261e;
}

/* ---------- actions ---------- */

.recall-page__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.recall-page__submit {
  font-family: var(--font);
  color: #fff;
  background: var(--accent-orange);
  border: 1px solid var(--accent-orange);
  cursor: pointer;
}

.recall-page__submit:hover:not(:disabled) {
  background: var(--accent-orange-hover);
  border-color: var(--accent-orange-hover);
}

.recall-page__submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.recall-page__status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- notice page ---------- */

.recall-page__lede {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
}

.recall-page__date {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Interim safety instruction — the one thing a reader must not skim past. */
.recall-page__warning {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--accent-orange);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: #fdf6ef;
}

.recall-page__warning p {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.recall-page__closing {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.static-prose .recall-page__closing h2.recall-page__closing-title {
  margin-top: 0;
}

/* ---------- link through to the claim form ---------- */

.recall-page__cta-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 1.75rem 0 0;
}

.recall-page__cta-note {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Must out-specify `.static-prose a`, which would otherwise paint the label link-blue. */
.static-prose a.recall-page__cta,
.recall-page__cta {
  font-family: var(--font);
  color: #fff;
  background: var(--accent-orange);
  border: 1px solid var(--accent-orange);
}

.static-prose a.recall-page__cta:hover,
.recall-page__cta:hover {
  background: var(--accent-orange-hover);
  border-color: var(--accent-orange-hover);
  color: #fff;
  text-decoration: none;
}

/* ---------- result ---------- */

.recall-page__result {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.recall-page__result:focus {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

.recall-page__result :first-child {
  margin-top: 0;
}

.recall-page__result :last-child {
  margin-bottom: 0;
}

/* ---------- receipt ---------- */

/* The receipt HTML is rendered by the serial tracker and injected into
   .recall-page__result. It carries no styles of its own on purpose — a
   stylesheet in that response would apply to this whole page — so these
   `recall-receipt__*` rules are what make it look like part of the site.
   The class names are a contract with the serial tracker's
   resources/views/recall-submissions/ views; renaming needs both sides. */

.recall-receipt__notice {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-orange);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 600;
}

.recall-receipt__notice--warning {
  border-left-color: #b3541e;
}

.recall-receipt__number {
  margin: 1.25rem 0 0.25rem;
  font-family: var(--font);
  color: var(--navy);
}

.recall-receipt__campaign {
  margin: 0 0 1rem;
  color: var(--muted);
}

.recall-receipt__lede {
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.recall-receipt__heading {
  margin: 1.75rem 0 0.75rem;
  font-size: var(--section-heading-size);
  font-weight: var(--section-heading-weight);
  letter-spacing: var(--section-heading-track);
  color: var(--section-heading-color);
}

/* Label/value pairs side by side, stacking on narrow screens. */
.recall-receipt__details {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 0.4rem 1.25rem;
  margin: 0;
  font-size: 0.94rem;
}

.recall-receipt__details dt {
  font-weight: 600;
  color: var(--muted);
}

.recall-receipt__details dd {
  margin: 0;
  color: var(--text);
}

@media (max-width: 34rem) {
  .recall-receipt__details {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .recall-receipt__details dd {
    margin-bottom: 0.75rem;
  }
}

/* Serial tables can be long and narrow screens are common here, so the table
   scrolls inside its own box rather than widening the page. */
.recall-receipt__tablewrap {
  overflow-x: auto;
}

.recall-receipt__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.recall-receipt__table th,
.recall-receipt__table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.recall-receipt__table th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.recall-receipt__table td[data-result="Affected"] {
  color: var(--navy);
  font-weight: 600;
}

.recall-receipt__note {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.recall-receipt__files {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.94rem;
}

/* ---------- utility ---------- */

/* Off-screen but reachable by assistive tech. */
.recall-page__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.recall-page__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 40rem) {
  .recall-page__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .recall-page__form {
    display: none;
  }

  .recall-page__result {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}

/* On-demand result for one serial number. Advisory: it reports what our
   records show and never reads as a rejection, so nothing here is styled as an
   error. Empty until a lookup answers, and the element collapses when blank. */
/* Always occupies a line, even with nothing to report, so an arriving result
   does not push the rest of the form down. */
.recall-page__serial-status {
  min-height: 1.45em;
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

/* The placeholder and the loading note are both scene-setting, not findings —
   they stay quiet so a real result is what draws the eye. */
.recall-page__serial-status[data-state="idle"],
.recall-page__serial-status[data-state="loading"] {
  color: var(--muted);
  font-weight: 400;
}

.recall-page__serial-status[data-result="Affected"] {
  color: var(--navy);
  font-weight: 600;
}
