/* ==========================================================================
   burn-permit.css
   Styles the Drupal Webform wizard to match the HTML prototype UI exactly.
   Uses Town of Caledon design tokens from styles.css / components.css:
     --brand-blue: #0256a4  --brand-blue-dark: #014785
     --brand-light: #eaf3fb  --brand-text: #1d2b36
     --brand-muted: #5b6770  --border: #d9e2ec
     --radius: 10px  --font-primary: "myriad-pro", Arial
     .btn .btn-p .btn-s already defined in styles.css — reused here.
   Loaded only on /burn-permits/apply via toc/burn-permit library.
   Location: themes/custom/toc/css/burn-permit.css
   ========================================================================== */

/* ── 1. HIDE DRUPAL'S DEFAULT WIZARD PROGRESS BAR ────────────────────────── */
.webform-submission-form .webform-progress-bar,
.webform-submission-form ol.webform-progress__items,
.webform-submission-form .webform-progress__track,
.webform-submission-form .webform-progress__status,
.webform-submission-form .webform-progress__summary,
.webform-submission-form .webform-progress__percentage {
  display: none !important;
}



/* ── 2. WIZARD PAGE — section heading (matches prototype h1 style) ────────── */
/* Drupal renders each wizard page inside a fieldset with a legend */
.webform-submission-form .webform-wizard-page > legend,
.webform-submission-form .js-webform-wizard-page > legend,
.webform-submission-form fieldset.webform-wizard-page > legend {
  display: block !important;
  width: 100%;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--brand-text, #1d2b36);
  font-family: var(--font-primary, "myriad-pro", Arial, Helvetica, sans-serif);
  margin: 0 0 24px;
  padding: 0;
  border: none;
  float: none;
}

/* ── 3. GENERAL FORM ITEM SPACING ────────────────────────────────────────── */
.webform-submission-form .form-item,
.webform-submission-form .js-form-item {
  margin-bottom: 24px;
}

.webform-submission-form .form-item:last-child {
  margin-bottom: 0;
}

/* ── 4. LABELS ───────────────────────────────────────────────────────────── */
.webform-submission-form label,
.webform-submission-form .form-item__label,
.webform-submission-form .fieldset__label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brand-text, #1d2b36);
  margin-bottom: 8px;
  font-family: var(--font-primary, "myriad-pro", Arial, Helvetica, sans-serif);
}

/* Required asterisk */
.webform-submission-form .form-required,
.webform-submission-form label .form-required {
  color: #c0392b;
  margin-left: 2px;
}

/* ── 5. TEXT / EMAIL / TEL / NUMBER INPUTS ───────────────────────────────── */
.webform-submission-form input[type="text"],
.webform-submission-form input[type="email"],
.webform-submission-form input[type="tel"],
.webform-submission-form input[type="number"],
.webform-submission-form input[type="search"],
.webform-submission-form textarea {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

/* ── 6. SELECT DROPDOWN ──────────────────────────────────────────────────── */
.webform-submission-form select {
  width: 100%;
  background: #fff url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235b6770' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  box-sizing: border-box;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* ── 7. RADIO BUTTONS — inline side by side (matches prototype) ──────────── */
.webform-submission-form .form-radios,
.webform-submission-form [id*="edit-mailing-same"] {
  display: flex !important;
  flex-direction: row !important;
  gap: 60px !important;
  flex-wrap: wrap !important;
  align-items: center !important;
}

.webform-submission-form .form-radios .form-item,
.webform-submission-form .form-radios .js-form-item,
.webform-submission-form .form-type-radio,
.webform-submission-form .js-form-type-radio {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.webform-submission-form .form-type-radio label,
.webform-submission-form .js-form-type-radio label {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--brand-text, #1d2b36);
  margin: 0;
  cursor: pointer;
}

.webform-submission-form input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand-blue, #0256a4);
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── 8. CHECKBOX ─────────────────────────────────────────────────────────── */
.webform-submission-form input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand-blue, #0256a4);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.webform-submission-form .form-type-checkbox,
.webform-submission-form .js-form-type-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.webform-submission-form .form-type-checkbox label,
.webform-submission-form .js-form-type-checkbox label {
  font-weight: 400;
  font-size: 0.95rem;
  margin: 0;
  cursor: pointer;
}

/* ── 9. FIELDSET / GROUP WRAPPERS ────────────────────────────────────────── */
.webform-submission-form fieldset {
  border: none;
  padding: 0;
  margin: 0 0 24px;
  min-width: 0;
}

.webform-submission-form fieldset legend {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brand-text, #1d2b36);
  margin-bottom: 12px;
  padding: 0;
  float: none;
  width: 100%;
}

/* ── 10. CONTACT INFO — 2-column grid (Step 3, matches prototype) ─────────── */
.webform-submission-form #edit-contact-information,
.webform-submission-form [data-webform-key="contact_information"],
.webform-submission-form .webform-wizard-page--contact-information .fieldset-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

.webform-submission-form #edit-contact-information .form-item,
.webform-submission-form [data-webform-key="contact_information"] .form-item {
  margin-bottom: 0;
}

/* ==========================================================================
   FIX v3 — Contact Information grid alignment (Email Confirm composite).

   CONFIRMED VIA LIVE DOM INSPECTION (previous two attempts guessed wrong):
   - #edit-contact-information does NOT exist as a stable ID — Drupal
     renders it as #edit-contact-information--{RANDOM_HASH}, a different
     hash on every page load. [data-webform-key="contact_information"] is
     the correct, stable selector (confirmed working).
   - The Email/Confirm-email composite has NO data-webform-key attribute
     at all on its wrapper. Webform renders this composite as a plain
     <fieldset> containing a <div class="fieldset-wrapper"> with two
     individually-themed "email" sub-elements inside (mail_1, mail_2).
     The fieldset's own id is ALSO a random hash
     (#edit-email-confirm--{RANDOM_HASH}), so no ID selector is reliable
     here either.
   - What IS stable: the input name attributes — name="email_confirm[mail_1]"
     and name="email_confirm[mail_2]" — and the plain .fieldset-wrapper
     class Drupal core always uses. This fix targets those directly via
     :has(), so it does not depend on any hash-suffixed id anywhere.

   Result:
     Row 1: First Name       | Last Name
     Row 2: Email             | Home Phone Number
     Row 3: Confirm email     | Alternate Phone Number
   ========================================================================== */
.webform-submission-form [data-webform-key="contact_information"] {
  grid-template-rows: auto auto auto;
}

.webform-submission-form [data-webform-key="contact_information"] > *:has(input[name="first_name"]) {
  grid-column: 1;
  grid-row: 1;
}

.webform-submission-form [data-webform-key="contact_information"] > *:has(input[name="last_name"]) {
  grid-column: 2;
  grid-row: 1;
}

.webform-submission-form [data-webform-key="contact_information"] > *:has(input[name="home_phone"]) {
  grid-column: 2;
  grid-row: 2;
}

.webform-submission-form [data-webform-key="contact_information"] > *:has(input[name="alternate_phone"]) {
  grid-column: 2;
  grid-row: 3;
}

/* The composite fieldset: normal grid item spanning rows 2–3 of column 1.
   Stays a plain block (no display:contents anywhere), so it's immune to
   the Chrome fieldset/display:contents bug entirely. */
.webform-submission-form [data-webform-key="contact_information"] > *:has(input[name="email_confirm[mail_1]"]) {
  grid-column: 1;
  grid-row: 2 / span 2;
  border: 0;
  padding: 0;
  margin: 0;
}

.webform-submission-form [data-webform-key="contact_information"] > *:has(input[name="email_confirm[mail_1]"]) > legend {
  display: none;
}

/* Its internal .fieldset-wrapper becomes its own small 2-row grid, so
   Email stacks directly above Confirm email inside that spanned area. */
.webform-submission-form [data-webform-key="contact_information"] > *:has(input[name="email_confirm[mail_1]"]) > .fieldset-wrapper {
  display: grid;
  grid-template-rows: auto auto;
  row-gap: 20px;
}

.webform-submission-form [data-webform-key="contact_information"] > *:has(input[name="email_confirm[mail_1]"]) .form-item {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .webform-submission-form #edit-contact-information,
  .webform-submission-form [data-webform-key="contact_information"],
  .webform-submission-form .webform-wizard-page--contact-information .fieldset-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  .webform-submission-form [data-webform-key="contact_information"] > * {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100% !important;
  }
  
  .webform-submission-form [data-webform-key="contact_information"] > *:has(input[name="email_confirm[mail_1]"]) > .fieldset-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }
}

/* ── 11. WIZARD NAVIGATION BUTTONS ──────────────────────────────────────── */
/* Force container to display flex, row, start/end alignment with high specificity */
.content-shell .webform-submission-form .form-actions,
.content-shell .webform-submission-form .webform-actions {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center;
  margin-top: 32px;
  gap: 10px !important;
  flex-wrap: wrap;
}

/* Force buttons to be inline-flex and fit-content width, overriding styles.css input widths */
.content-shell .webform-submission-form .form-actions input.webform-button--next,
.content-shell .webform-submission-form .form-actions input[type="submit"].webform-button--next,
.content-shell .webform-submission-form .form-actions button[type="submit"],
.content-shell .webform-submission-form .form-actions input[type="submit"]:not(.webform-button--previous),
.content-shell .webform-submission-form .webform-actions input.webform-button--next,
.content-shell .webform-submission-form .webform-actions input[type="submit"].webform-button--next,
.content-shell .webform-submission-form .webform-actions button[type="submit"],
.content-shell .webform-submission-form .webform-actions input[type="submit"]:not(.webform-button--previous) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap;
  width: fit-content !important;
  margin-left: auto !important;
}

/* Previous / Back — secondary style layout */
.content-shell .webform-submission-form .form-actions input.webform-button--previous,
.content-shell .webform-submission-form .form-actions input[type="submit"].webform-button--previous,
.content-shell .webform-submission-form .webform-actions input.webform-button--previous,
.content-shell .webform-submission-form .webform-actions input[type="submit"].webform-button--previous {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap;
  width: fit-content !important;
  margin-right: auto !important;
}

/* ── 11b. AJAX PROGRESS LOADER ───────────────────────────────────────────── */
.webform-submission-form .form-actions .ajax-progress,
.webform-submission-form .webform-actions .ajax-progress {
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
}

.webform-submission-form .form-actions .ajax-progress-throbber .throbber,
.webform-submission-form .webform-actions .ajax-progress-throbber .throbber {
  padding: 0 !important;
  margin: 0 !important;
  width: 16px;
  height: 16px;
  background-size: contain;
}

/* ── 12. PAYMENT SUMMARY TABLE ───────────────────────────────────────────── */
.webform-submission-form table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  color: var(--brand-text, #1d2b36);
  border: 1px solid var(--border, #d9e2ec);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
  background: #fff;
}

.webform-submission-form table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  background: #f7f9fc;
  border-bottom: 2px solid var(--border, #d9e2ec);
  color: var(--brand-text, #1d2b36);
}

.webform-submission-form table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #d9e2ec);
}

.webform-submission-form table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   FIX — Payment summary table incorrectly painted navy blue on its first
   body row (and, before the markup fix, a second "Subtotal" row too).

   ROOT CAUSE: styles.css has a generic rule intended for CKEditor-authored
   content tables:
     .content-main table tr:first-child td, .content-main table thead th
       { color:#fff; background:#014785; ... }
   Since this webform renders inside <article class="content-main">, that
   rule applies here too. The original payment_summary markup also had its
   Subtotal/Total rows sitting OUTSIDE <tbody>, which made browsers
   auto-generate a SECOND implicit <tbody> — giving that generic
   :first-child selector two separate "first rows" to match (Burn Permit
   AND Subtotal), explaining the two navy bars seen in testing. The markup
   is now fixed to use one proper <tbody>, but the payment table's real
   first body row (the line-item row) still isn't meant to look like a
   header, so it needs an explicit opt-out from that generic content
   styling.
   ========================================================================== */
.content-main table.payment-table tr:first-child td,
.content-main table.payment-table tbody tr:first-child td {
  background: #fff !important;
  color: var(--brand-text, #1d2b36) !important;
  font-weight: 400 !important;
}

/* ==========================================================================
   FIX — "Calculated Fee" showing as a visible empty text box.

   ROOT CAUSE: this element was converted from type "Hidden" (a real
   invisible <input type="hidden">) to type "Computed Twig" so it could
   recalculate live on every page render (needed to show the correct
   amount on the Payment page before final submit — see
   caledon_burn_permit.module for the full explanation). Computed Twig
   elements are NOT hidden by default the way the old Hidden type was —
   Webform renders them as a normal visible form item unless told
   otherwise. This rule hides it presentationally only; the element
   still computes and stores its value normally (confirm "Store: Yes"
   is set on the element itself in Webform admin), so
   [webform_submission:values:calculated_fee] tokens elsewhere on the
   form keep working exactly as before.
   ========================================================================== */
.webform-submission-form [data-webform-key="calculated_fee"] {
  display: none !important;
}

/* ── 13. TERMS & CONDITIONS TEXT ─────────────────────────────────────────── */
.webform-submission-form .webform-element--type-webform-markup h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-blue-dark, #014785);
  margin: 24px 0 16px;
  font-family: var(--font-primary, "myriad-pro", Arial, Helvetica, sans-serif);
}

.webform-submission-form .webform-element--type-webform-markup ol {
  padding-left: 20px;
  display: grid;
  gap: 12px;
  line-height: 1.6;
  color: var(--brand-text, #1d2b36);
  font-size: 0.95rem;
}

/* ── 14. ERROR STATES ────────────────────────────────────────────────────── */
.webform-submission-form input.error,
.webform-submission-form select.error,
.webform-submission-form textarea.error,
.webform-submission-form .error input,
.webform-submission-form .error select,
.webform-submission-form .error textarea,
.webform-submission-form .form-item--error input,
.webform-submission-form .form-item--error select,
.webform-submission-form .form-item--error textarea {
  border: 2px solid #c0392b !important;
  background-color: #fdf2f2 !important;
}

.webform-submission-form .form-item--error-message,
.webform-submission-form .form-item .error-message,
.webform-submission-form .form-item__error-message {
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 4px;
  display: block;
}

/* ── 15. HELPER DESCRIPTION TEXT ─────────────────────────────────────────── */
.webform-submission-form .form-item__description,
.webform-submission-form .webform-element-description,
.webform-submission-form .description {
  font-size: 0.85rem;
  color: var(--brand-muted, #5b6770);
  margin-top: 4px;
}

/* ── 16. MIGRATED INTRO (Required fields note) ───────────────────────────── */
.content-main .migrated-intro {
  margin-top: 15px;
  margin-bottom: 25px;
  font-size: 0.95rem;
}

/* ── 17. SIDEBAR LIST — reuse existing .sidebar-card pattern ─────────────── */
/* .related-sidebar-list already defined in node--typical-page styles.        */
/* Adding here as fallback in case burn permit page loads without node css.   */
.related-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.related-sidebar-list li {
  border-bottom: 1px solid #f0f0f0;
}
.related-sidebar-list li:last-child {
  border-bottom: none;
}
.related-sidebar-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 4px;
  color: #1a1a1a;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s;
}
.related-sidebar-list li a::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-top: 2px solid var(--brand-blue, #0256a4);
  border-right: 2px solid var(--brand-blue, #0256a4);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.related-sidebar-list li a:hover,
.related-sidebar-list li a:focus {
  color: var(--brand-blue, #0256a4);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 18. RIGHT-SIDEBAR layout ────────────────────────────────────────────── */
/* .right-sidebar already uses .content-layout grid from styles.css */
/* Ensure main content is always on the left (or top on mobile) and sidebar on the right (or bottom) */
.content-layout > .content-main {
  order: 1 !important;
  min-width: 0;
}

.content-layout > .right-sidebar {
  order: 2 !important;
  position: sticky;
  top: 100px;
  min-width: 0;
}

@media (max-width: 980px) {
  .content-layout {
    display: flex !important;
    flex-direction: column !important;
  }
  .content-layout > .content-main {
    order: 1 !important;
    width: 100% !important;
  }
  .content-layout > .right-sidebar {
    position: static !important;
    order: 2 !important;
    margin-top: 28px !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   GIS ADDRESS AUTOCOMPLETE
   Styles the dropdown produced by burn-permit-gis.js
   (.gis-autocomplete-wrap / .gis-suggestions / .gis-status)
   ========================================================================== */

/* ── Wrapper — positioning context for the dropdown ──────────────────────── */
.gis-autocomplete-wrap {
  position: relative;
  width: 100%;
}

/* ── Suggestion dropdown ──────────────────────────────────────────────────── */
.webform-submission-form .gis-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #c0ccd8;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(29, 43, 54, 0.12);
  max-height: 320px;
  overflow-y: auto;
  display: none; /* toggled to block by JS when results exist */
}

.webform-submission-form .gis-suggestions li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-family: var(--font-primary, "myriad-pro", Arial, Helvetica, sans-serif);
  color: var(--brand-text, #1d2b36);
  cursor: pointer;
  transition: background 0.12s ease;
}

.webform-submission-form .gis-suggestions li:hover,
.webform-submission-form .gis-suggestions li:focus {
  background: var(--brand-light, #eaf3fb);
  outline: none;
}

/* Eligibility badge text (e.g. "Recreational ✓ · Open Air ✓") */
.webform-submission-form .gis-suggestions li .gis-badge {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-blue, #0256a4);
  white-space: nowrap;
}

/* ── Status / helper text below the field ─────────────────────────────────── */
.webform-submission-form .gis-status {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--brand-muted, #5b6770);
  min-height: 1.1em;
}

.webform-submission-form .gis-status--error {
  color: #c0392b;
}

/* ── Scrollbar polish (optional, matches modern browser dropdowns) ─────────── */
.webform-submission-form .gis-suggestions::-webkit-scrollbar {
  width: 8px;
}
.webform-submission-form .gis-suggestions::-webkit-scrollbar-thumb {
  background: #c0ccd8;
  border-radius: 4px;
}

/* ==========================================================================
   FIX — Required field labels showing entirely in red.
   Webform outputs the required marker as a class directly on the <label>
   element itself (class="form-required"), not as a separate child <span>.
   The earlier "Required asterisk" rule (section 4) matched `.form-required`
   directly and colored the WHOLE label text red on fields where Webform
   puts that class on the <label> tag rather than a nested span.
   This override resets the label to normal text color and adds a red
   asterisk via ::after instead — the standard accessible pattern (matches
   Drupal core / Claro theme behaviour). Kept last in the file so it wins
   the cascade over section 4 without needing !important overrides there.
   ========================================================================== */

/* Reset the label itself back to normal text color */
.webform-submission-form label.form-required,
.webform-submission-form .form-item__label.form-required,
.webform-submission-form .fieldset__label.form-required {
  color: var(--brand-text, #1d2b36) !important;
}

/* Add the red asterisk as a pseudo-element instead of coloring the whole label */
.webform-submission-form label.form-required::after,
.webform-submission-form .form-item__label.form-required::after,
.webform-submission-form .fieldset__label.form-required::after {
  content: " *";
  color: #c0392b;
  font-weight: 700;
}

/* If Webform DOES render an explicit inner span/mark for the asterisk
   (some field types do), make sure we don't double up — hide it and
   rely on the ::after above. */
.webform-submission-form label.form-required > .form-required,
.webform-submission-form .form-item__label.form-required > .form-required {
  display: none;
}

/* Radio-button groups ("Is your mailing address...") render their
   required marker on a <span class="fieldset-legend form-required">
   INSIDE the <legend>, not on the <legend> element itself. Target the
   actual span. */
.webform-submission-form .fieldset-legend.form-required {
  color: var(--brand-text, #1d2b36) !important;
}

.webform-submission-form .fieldset-legend.form-required::after {
  content: " *";
  color: #c0392b;
  font-weight: 700;
}

/* ==========================================================================
   FIX — stray `.error` class safety net.
   CONFIRMED CAUSE: no manual CSS class was added in Webform UI (checked
   Manage Elements → Burn Site Address → Advanced — both "Element CSS
   classes" and "Element custom attributes" are empty). The `error` class
   and `aria-invalid="true"` are Drupal core's normal server-side render
   of a required field after a prior failed validation attempt (e.g. the
   wizard's "Continue" button was clicked once before the field was
   filled). This is expected Drupal behaviour, not a bug — the rules
   below simply keep that state from reading as alarming red text/border
   on a field the user hasn't interacted with yet, while a real error
   message (section 14) still displays normally when needed.
   ========================================================================== */
.webform-submission-form input.form-text.error:not(.is-actually-invalid) {
  color: var(--brand-text, #1d2b36) !important;
  border-color: #c0ccd8 !important;
}

.webform-submission-form input.gis-selected.error {
  color: var(--brand-text, #1d2b36) !important;
  border-color: var(--brand-blue, #0256a4) !important;
}

/* ==========================================================================
   GIS address field — valid selection state.
   Applied by burn-permit-gis.js once a real address has been picked from
   the dropdown. Ensures the field reads as normal/confirmed input, not an
   error state, even if the browser's native validation briefly flags the
   field during the value-fill sequence.
   ========================================================================== */
.webform-submission-form input.gis-selected {
  border-color: var(--brand-blue, #0256a4) !important;
  color: var(--brand-text, #1d2b36) !important;
  background-color: #fff !important;
}

/* ==========================================================================
   MONERIS PAYMENT WIDGET
   Card-entry panel injected by burn-permit-gis.js (Hosted Tokenization
   iframe + Pay Now button). Field styling for the iframe's own inputs
   is set via URL params in buildIframeSrc() — this CSS covers the
   OUTER wrapper card that JS builds around it.
   ========================================================================== */
.moneris-payment-card {
  margin: 28px 0;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--border, #d9e2ec);
  border-radius: var(--radius, 10px);
  box-shadow: 0 6px 18px rgba(2, 86, 164, 0.08);
}

.moneris-payment-heading {
  margin: 0 0 6px;
  color: var(--brand-blue-dark, #014785);
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-primary, "myriad-pro", Arial, Helvetica, sans-serif);
}

.moneris-secure-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 20px;
  padding: 10px 14px;
  background: var(--brand-light, #eaf3fb);
  border-radius: 6px;
  color: var(--brand-muted, #5b6770);
  font-size: 0.85rem;
  line-height: 1.4;
}

.moneris-secure-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--brand-blue, #0256a4);
}

.moneris-tokenization-frame-wrap {
  margin-bottom: 16px;
}

.moneris-tokenization-frame-wrap iframe {
  width: 100%;
  height: 76px;
  border: 0;
  display: block;
}

.moneris-widget-status {
  min-height: 1.3em;
  margin-bottom: 14px;
  color: var(--brand-muted, #5b6770);
  font-size: 0.88rem;
}

.moneris-widget-status--error {
  color: #c0392b;
  font-weight: 600;
}

.moneris-pay-now-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 13px 28px;
  background: var(--brand-blue, #0256a4);
  color: #fff;
  border: 1px solid var(--brand-blue, #0256a4);
  border-radius: calc(var(--radius, 10px) - 2px);
  font-family: var(--font-primary, "myriad-pro", Arial, Helvetica, sans-serif);
  font-weight: bold !important;
  font-size: 0.98rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.moneris-pay-now-btn:hover,
.moneris-pay-now-btn:focus {
  background: var(--brand-highlight-green, #438306);
  border-color: var(--brand-highlight-green, #438306);
  outline: none;
}

.moneris-pay-now-btn:focus-visible {
  outline: 2px solid var(--brand-blue-dark, #014785);
  outline-offset: 2px;
}

.moneris-pay-now-btn.is-processing,
.moneris-pay-now-btn:disabled {
  background: #9fb4c7;
  border-color: #9fb4c7;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .moneris-payment-card {
    padding: 20px;
  }
  .moneris-tokenization-frame-wrap iframe {
    height: 160px;
  }
  .moneris-pay-now-btn {
    width: 100%;
  }
}

/* Native Webform submit button — kept in the DOM (not removed) so JS
   can trigger it programmatically after a successful Moneris charge,
   letting Drupal's own wizard $form_state save the real submission.
   Visually and functionally hidden from the user otherwise. */
.moneris-hidden-native-submit {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none !important;
}

/* ==========================================================================
   BURN PERMIT — INTERIOR HERO BANNER
   No custom banner override — the standard styles.css .interior-hero
   light background is used on both the public form and POS kiosk form,
   matching the live/staging site appearance.
   ========================================================================== */


body.path--burn-permit-pos #main-content > .content-shell {
  padding-top: 1.5rem !important;
}

.burn-permit-pos-hero {
  padding: 1.75rem 2rem !important;
}

.burn-permit-pos-hero h1 {
  margin: 0 !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

body.path--burn-permit-pos .content-layout {
  display: block !important;
}

body.path--burn-permit-pos .content-main {
  background: #ffffff !important;
  padding: 2.25rem !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08) !important;
  border: 1px solid #e5e7eb !important;
  max-width: none !important;
  width: 100% !important;
}

/* Hide Drupal contextual links (pencil icon) on the form */
.contextual-region .contextual {
  display: none !important;
}

/* ==========================================================================
   POS KIOSK — AJAX FULLSCREEN LOADER
   Drupal's built-in fullscreen progress overlay for AJAX form submits.
   No coloured background — only a centred spinner is shown so the page
   content remains visible while a wizard step is processing.
   ========================================================================== */
.ajax-progress-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: transparent !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ajax-progress-fullscreen::after {
  content: '';
  display: block;
  width: 52px;
  height: 52px;
  border: 5px solid rgba(2, 52, 94, 0.2);
  border-top-color: #0256a4;
  border-radius: 50%;
  animation: burn-permit-spin 0.75s linear infinite;
}

@keyframes burn-permit-spin {
  to { transform: rotate(360deg); }
}

/* ── Clean styling for Burn Permit Edit form ────────────────────────── */
.webform-submission-navigation,
.path--burn-permit-pos .tabs,
.path--burn-permit-pos .action-links,
.path--burn-permit-pos .webform-submission-navigation,
.path--burn-permit-pos details.webform-submission-information {
  display: none !important;
}

.path--burn-permit-pos .webform-submission-burn-permit-edit-form {
  margin-top: 10px;
}
/* ── Refund button ───────────────────────────────────────── */
.bp-btn-refund {
  background: #c53030;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.2s ease;
}
.bp-btn-refund:hover:not(.bp-btn-refund--done) {
  background: #9b2c2c;
  color: #fff;
}
.bp-btn-refund--done {
  background: #a0aec0;
  color: #fff;
  cursor: default;
  pointer-events: none;
}

/* ==========================================================================
   MONERIS IFRAME & CARD ENTRY — RESPONSIVE STYLING
   Keeps the 3 card fields properly aligned and visible across all breakpoints.
   Removes and prevents the "View Full Screen" button from overlapping.
   ========================================================================== */
#monerisFrame {
  display: block !important;
  width: 100% !important;
  height: 104px !important;
  border: none !important;
  background: transparent !important;
  margin-top: -44px !important;
}

.bp-iframe-clip {
  height: 60px !important;
  overflow: hidden !important;
}

/* Ensure map fullscreen button never appears on burn permit / payment page */
.bp-wrap .map-fullscreen-top-bar,
.bp-wrap .map-fullscreen-btn,
.bp-iframe-clip .map-fullscreen-top-bar,
.bp-iframe-clip .map-fullscreen-btn,
[data-webform-key="payment"] .map-fullscreen-top-bar,
[data-webform-key="payment"] .map-fullscreen-btn,
.webform-submission-burn-permit-form .map-fullscreen-top-bar,
.webform-submission-burn-permit-form .map-fullscreen-btn,
.path--burn-permits .map-fullscreen-top-bar,
.path--burn-permits .map-fullscreen-btn {
  display: none !important;
}

.bp-iframe-clip .map-embed-wrapper {
  display: contents !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* ==========================================================================
   BURN PERMIT TYPE DYNAMIC DESCRIPTION
   Displays helper text directly below the selected permit option.
   ========================================================================== */
.burn-permit-type-description {
  margin-top: 12px;
  padding: 14px 18px;
  background-color: #f0f7ff;
  border-left: 4px solid var(--brand-blue, #0256a4);
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #1e3a8a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.burn-permit-type-description strong {
  color: var(--brand-blue, #0256a4);
  font-weight: 700;
}