/*
 * SRM public intake forms (/requests/{formKey}) — copied from the Field Issue form's fi-form.css with the classes
 * renamed srm- (task 21_0029).
 *
 * A small, self-contained take on the USWDS / GOV.UK form components the modernization guide
 * recommends adopting (§9.4), rethemed to the site's blue. Everything is scoped under .srm so the
 * public theme's generic input/button rules don't fight it. Conventions encoded here:
 *   - single column, static labels above fields, hint text below the label (§4.1)
 *   - only optional fields are marked, with "(optional)" (§4.1)
 *   - 44px minimum tap targets; WCAG 2.2 floor is 24px (§6, 2.5.8)
 *   - strong visible focus (3px, high contrast) that is never removed
 *   - error state: red left border on the group, red bold message with a non-colour prefix (§5.2)
 *   - error summary box that receives focus (§5.3)
 */

.srm { --srm-blue: #0066cc; --srm-blue-dark: #003267; --srm-ink: #1b1b1b; --srm-muted: #5c5c5c; --srm-line: #565c65;
      --srm-red: #b50909; --srm-green: #00a91c; --srm-focus: #ffbf47; --srm-bg-soft: #f0f0f0; max-width: 44rem; color: var(--srm-ink); font-size: 1.0625rem; line-height: 1.5; }
.srm *, .srm *::before, .srm *::after { box-sizing: border-box; }

/* Focus: consistent, thick, never suppressed */
.srm a:focus-visible, .srm button:focus-visible, .srm input:focus-visible, .srm textarea:focus-visible, .srm select:focus-visible, .srm [tabindex]:focus-visible {
  outline: 3px solid var(--srm-focus); outline-offset: 0; box-shadow: inset 0 0 0 2px var(--srm-ink); }

/* Step chrome */
.srm-back { display: inline-block; margin: 0 0 1rem; color: var(--srm-ink); text-decoration: underline; font-size: 1rem; }
.srm-back::before { content: "\2039\00a0"; }
.srm-step { display: block; color: var(--srm-muted); font-size: .95rem; margin-bottom: .5rem; }
.srm h1.srm-title { font-size: 2rem; line-height: 1.15; font-weight: 700; margin: 0 0 1rem; color: var(--srm-ink); }
.srm h1.srm-title.srm-title-legend { margin-bottom: .5rem; }
.srm h2 { font-size: 1.4rem; margin: 2rem 0 .75rem; }
.srm p, .srm li { font-size: 1.0625rem; }
.srm .srm-lead { font-size: 1.2rem; }
.srm ul.srm-list, .srm ol.srm-list { padding-left: 1.5rem; margin: 0 0 1rem; }
.srm ul.srm-list { list-style: disc; }
.srm ol.srm-list { list-style: decimal; }
.srm .srm-list li { margin-bottom: .4rem; display: list-item; }

/* Groups, labels, hints */
.srm-group { margin: 0 0 1.75rem; padding-left: 0; border-left: 0; }
.srm-group.srm-group-error { border-left: 5px solid var(--srm-red); padding-left: 1rem; }
.srm fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.srm legend { padding: 0; margin-bottom: .5rem; font-weight: 700; font-size: 1.25rem; }
.srm label, .srm .srm-label { display: block; font-weight: 700; font-size: 1.125rem; margin-bottom: .35rem; color: var(--srm-ink); }
.srm .srm-hint { display: block; color: var(--srm-muted); font-size: 1rem; margin: 0 0 .6rem; }
.srm .srm-optional { font-weight: 400; color: var(--srm-muted); }
.srm .srm-error-message { display: block; color: var(--srm-red); font-weight: 700; font-size: 1rem; margin: 0 0 .6rem; }
.srm .srm-error-message::before { content: "Error: "; }
.srm .srm-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Text inputs */
.srm input[type="text"], .srm input[type="tel"], .srm input[type="email"], .srm input[type="url"], .srm input[type="datetime-local"], .srm select, .srm textarea {
  display: block; width: 100%; max-width: 32rem; min-height: 2.75rem; padding: .45rem .6rem; font: inherit; font-size: 1.125rem;
  color: var(--srm-ink); background: #fff; border: 2px solid var(--srm-line); border-radius: 0; margin: 0; -webkit-appearance: none; appearance: none; }
.srm textarea { min-height: 9rem; max-width: 100%; resize: vertical; }
.srm .srm-input-short { max-width: 12rem; }
.srm .srm-input-error { border-color: var(--srm-red); border-width: 3px; }
.srm .srm-char-count { color: var(--srm-muted); font-size: 1rem; margin-top: .4rem; }
.srm .srm-char-count.srm-char-over { color: var(--srm-red); font-weight: 700; }

/* Memorable date */
.srm .srm-date { display: flex; gap: 1rem; flex-wrap: wrap; }
.srm .srm-date-item label { font-weight: 400; font-size: 1rem; margin-bottom: .25rem; }
.srm .srm-date-item input { width: 4.5rem; text-align: left; }
.srm .srm-date-item.srm-date-year input { width: 6rem; }

/* Radios / checkboxes: large targets, visible state, whole row tappable */
.srm .srm-radios { margin: 0; padding: 0; list-style: none; }
.srm .srm-radio { position: relative; display: block; min-height: 2.75rem; padding: .35rem 0 .35rem 3rem; margin-bottom: .35rem; }
.srm .srm-radio input { position: absolute; left: 0; top: 0; width: 2.75rem; height: 2.75rem; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.srm .srm-radio label { position: relative; display: inline-block; font-weight: 400; font-size: 1.125rem; padding: .35rem .5rem .35rem 0; margin: 0; cursor: pointer; touch-action: manipulation; }
.srm .srm-radio label::before { content: ""; position: absolute; left: -3rem; top: .15rem; width: 2.25rem; height: 2.25rem; border: 2px solid var(--srm-line); border-radius: 50%; background: #fff; }
.srm .srm-radio label::after { content: ""; position: absolute; left: -2.4rem; top: .75rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--srm-ink); opacity: 0; }
.srm .srm-radio input:checked + label::after { opacity: 1; }
.srm .srm-radio input:focus-visible + label::before { outline: 3px solid var(--srm-focus); outline-offset: 0; box-shadow: 0 0 0 2px var(--srm-ink); }
.srm .srm-radio-hint { display: block; color: var(--srm-muted); font-size: 1rem; font-weight: 400; }
.srm .srm-radio-divider { margin: .75rem 0 .75rem .9rem; color: var(--srm-muted); font-weight: 700; }

/* Checkbox: same large target as a radio, square box, check mark */
.srm .srm-checkbox { position: relative; display: block; min-height: 2.75rem; padding: .35rem 0 .35rem 3rem; margin: .25rem 0; }
.srm .srm-checkbox input { position: absolute; left: 0; top: 0; width: 2.75rem; height: 2.75rem; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.srm .srm-checkbox label { position: relative; display: inline-block; font-weight: 400; font-size: 1.125rem; padding: .35rem .5rem .35rem 0; margin: 0; cursor: pointer; touch-action: manipulation; }
.srm .srm-checkbox label::before { content: ""; position: absolute; left: -3rem; top: .15rem; width: 2.25rem; height: 2.25rem; border: 2px solid var(--srm-line); background: #fff; }
.srm .srm-checkbox label::after { content: ""; position: absolute; left: -2.35rem; top: .55rem; width: .9rem; height: .5rem; border: solid var(--srm-ink); border-width: 0 0 4px 4px; transform: rotate(-45deg); opacity: 0; }
.srm .srm-checkbox input:checked + label::after { opacity: 1; }
.srm .srm-checkbox input:focus-visible + label::before { outline: 3px solid var(--srm-focus); outline-offset: 0; box-shadow: 0 0 0 2px var(--srm-ink); }

/* Conditional reveal under a radio */
.srm .srm-reveal { margin: .25rem 0 1rem 1rem; padding: .75rem 0 .25rem 1.25rem; border-left: 4px solid #bbb; }
.srm .srm-reveal[hidden] { display: none; }
.srm .srm-guidance { background: #eef5fb; border-left: 4px solid var(--srm-blue); padding: .75rem 1rem; margin: .5rem 0 0; font-size: 1rem; }
.srm .srm-guidance p:last-child { margin-bottom: 0; }

/* Buttons */
.srm .srm-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .55rem 1.25rem; margin: .5rem .75rem .5rem 0;
  font: inherit; font-size: 1.125rem; font-weight: 700; line-height: 1.2; color: #fff; background: var(--srm-blue); border: 2px solid transparent; border-radius: .25rem; cursor: pointer; text-decoration: none; }
.srm .srm-btn:hover { background: var(--srm-blue-dark); color: #fff; text-decoration: none; }
.srm .srm-btn-secondary { color: var(--srm-blue); background: #fff; border-color: var(--srm-blue); }
.srm .srm-btn-secondary:hover { background: #eef5fb; color: var(--srm-blue-dark); }
.srm .srm-btn-start::after { content: "\00a0\2192"; }
.srm .srm-btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.srm .srm-actions { margin-top: 1.5rem; }
.srm .srm-link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--srm-blue); text-decoration: underline; cursor: pointer; }

/* Error summary (guide §5.3) */
.srm .srm-error-summary { border: 4px solid var(--srm-red); padding: 1rem 1.25rem; margin: 0 0 2rem; }
.srm .srm-error-summary h2 { margin: 0 0 .75rem; font-size: 1.4rem; }
.srm .srm-error-summary ul { margin: 0; padding-left: 1.25rem; }
.srm .srm-error-summary a { color: var(--srm-red); font-weight: 700; text-decoration: underline; }

/* Notices */
.srm .srm-notice { border-left: 5px solid var(--srm-blue); background: var(--srm-bg-soft); padding: .9rem 1.1rem; margin: 1.25rem 0; }
.srm .srm-notice-danger { border-left-color: var(--srm-red); background: #fbeaea; }
.srm .srm-notice p:last-child { margin-bottom: 0; }
.srm .srm-phone { font-size: 1.6rem; font-weight: 700; white-space: nowrap; }

/* Check your answers summary list (GOV.UK pattern) */
.srm .srm-summary { border-top: 1px solid #bbb; margin: 0 0 2rem; padding: 0; list-style: none; }
.srm .srm-summary li { display: grid; grid-template-columns: minmax(8rem, 30%) 1fr auto; gap: .75rem 1rem; padding: .75rem 0; border-bottom: 1px solid #bbb; align-items: start; }
.srm .srm-summary .srm-key { font-weight: 700; }
.srm .srm-summary .srm-value { overflow-wrap: anywhere; white-space: pre-line; }
.srm .srm-summary .srm-change a { white-space: nowrap; }
.srm .srm-summary .srm-change a::after { content: ""; }
.srm .srm-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.srm .srm-thumbs img { width: 88px; height: 88px; object-fit: cover; border: 1px solid #bbb; border-radius: 3px; }
@media (max-width: 40rem) {
  .srm .srm-summary li { grid-template-columns: 1fr auto; }
  .srm .srm-summary .srm-value { grid-column: 1 / -1; }
}

/* Panel (confirmation) */
.srm .srm-panel { background: var(--srm-green); color: #fff; text-align: center; padding: 2rem 1.5rem; margin: 0 0 1.5rem; }
.srm .srm-panel h1 { color: #fff; font-size: 2rem; margin: 0 0 .75rem; }
.srm .srm-panel .srm-ref { font-size: 1.75rem; font-weight: 700; letter-spacing: .02em; }
.srm .srm-panel p { margin: 0; font-size: 1.125rem; }

/* Photos */
.srm .srm-photo-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.srm .srm-photo-list li { width: 132px; }
.srm .srm-photo-list img { width: 132px; height: 132px; object-fit: cover; border: 1px solid #bbb; border-radius: 3px; display: block; }
.srm .srm-photo-list .srm-photo-name { display: block; font-size: .85rem; color: var(--srm-muted); margin-top: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srm .srm-photo-list form { margin: 0; }
.srm .srm-file { display: block; font: inherit; font-size: 1rem; }

/* Honeypot: off-screen, not display:none, so naive bots still "see" it */
.srm .srm-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Print: the confirmation is a receipt */
@media print {
  .srm .srm-no-print, .srm-back { display: none !important; }
  .srm .srm-panel { color: #000; background: none; border: 3px solid #000; }
  .srm .srm-panel h1 { color: #000; }
}

/* Added for the SRM renderer (21_0029) */
.srm .srm-legend { font-weight: 700; font-size: 1.125rem; margin-bottom: .35rem; }
.srm .srm-field { margin: 0 0 1.25rem; }
.srm .srm-field:last-child { margin-bottom: 0; }
.srm .srm-optional:empty { display: none; }
.srm select { max-width: 32rem; background-image: none; }
.srm .srm-tag { display: inline-block; margin-left: .5rem; padding: .05rem .5rem; font-size: .9rem; font-weight: 700; border: 2px solid currentColor; }
.srm .srm-tag-urgent { color: var(--srm-red); }
.srm .srm-radio-divider { margin-left: 0; }
.srm .srm-search-link { margin: .5rem 0 0; }
.srm .srm-search-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: stretch; }
.srm .srm-search-row input { flex: 1 1 14rem; width: auto; min-width: 0; }
.srm .srm-search-row .srm-btn { margin: 0; }
.srm .srm-breadcrumb { margin: 0 0 1.5rem; }
.srm .srm-breadcrumb h2.srm-breadcrumb-title { font-size: 1.1rem; margin: 0 0 .5rem; }
.srm .srm-breadcrumb .srm-summary { margin-bottom: 0; }
.srm .srm-notice-warning { border-left-color: #936f38; background: #faf3d1; }
.srm .srm-call-panel .srm-phone { display: inline-block; margin: .25rem 0; }
.srm .srm-content { margin: 0 0 1.25rem; }
.srm .srm-content p:last-child { margin-bottom: 0; }
.srm .srm-pre { white-space: pre-line; }
.srm .srm-form-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.srm .srm-form-list li { padding: .75rem 0; border-bottom: 1px solid #bbb; }
.srm .srm-form-list a { font-size: 1.2rem; font-weight: 700; }
.srm .srm-form-list .srm-hint { margin: .25rem 0 0; }
.srm .srm-tracking { overflow-wrap: anywhere; }
.srm .srm-checkboxes { margin: 0; padding: 0; }
@media (max-width: 40rem) {
  .srm h1.srm-title { font-size: 1.6rem; }
  .srm .srm-btn { width: 100%; margin-right: 0; }
  .srm .srm-search-row .srm-btn { width: auto; }
}

/* Added for the location map, device location and photos (21_0029b) */
.srm [hidden] { display: none !important; }
.srm.srm-wide { max-width: 60rem; }
.srm .srm-map-group { margin-top: 1.5rem; }
.srm .srm-map-group:focus { outline: none; }
.srm .srm-map-tools { margin: 0 0 1rem; }
.srm .srm-map-tools label { display: block; font-weight: 700; margin-bottom: .35rem; }
.srm .srm-map { max-width: 100%; overflow: hidden; }
.srm .srm-map #custom-geojson-map { min-height: 18rem; }
.srm .srm-map-nodraw .leaflet-draw { display: none; }
.srm .leaflet-bar a, .srm .leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
.srm .srm-map-placeholder { display: flex; align-items: center; justify-content: center; min-height: 12rem; padding: 1rem; border: 2px dashed var(--srm-line);
  background: var(--srm-bg-soft); color: var(--srm-muted); text-align: center; }
.srm .srm-device-btn { margin-top: .75rem; }
.srm .srm-geo-status { display: block; margin: .5rem 0 0; font-size: 1rem; }
.srm .srm-geo-status:empty { display: none; }
.srm .srm-geo-status.error { color: var(--srm-red); font-weight: 700; }
.srm .srm-geo-status.muted { color: var(--srm-muted); }
.srm .srm-file { display: block; max-width: 100%; min-height: 2.75rem; padding: .35rem 0; }
.srm .srm-photos-title { font-size: 1.1rem; margin: 1rem 0 .5rem; }
.srm .srm-photo-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .75rem; }
.srm .srm-photo-list li { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.srm .srm-photo-list img { width: 100%; height: 7rem; object-fit: cover; border: 1px solid var(--srm-line); background: var(--srm-bg-soft); }
.srm .srm-photo-name { font-size: .95rem; overflow-wrap: anywhere; }
.srm .srm-photo-remove-btn { align-self: flex-start; min-height: 2.75rem; min-width: 2.75rem; text-align: left; }
.srm .srm-photo-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.srm .srm-photo-actions .srm-btn { margin: 0; }
.srm .srm-photo-webcam video { display: block; width: 100%; max-width: 32rem; background: #000; }
.srm .srm-remove-form { display: none; }
@media (max-width: 40rem) {
  .srm .srm-map #custom-geojson-map { height: 20rem !important; }
  .srm .srm-photo-actions .srm-btn { width: 100%; }
}
