/*
  JM Suite – quote form [jm_quote_form] and the small body shortcodes ([jm_quote_whatsapp], [jm_quote_hours]).
  Tokens only (flatsome-child-universal/assets/css/tokens.css). Overrides Flatsome's global form styles inside .jm-quote.
*/
.jm-quote [hidden], .jm-quote[hidden] { display: none !important; }
.jm-quote {
  box-sizing: border-box;
  width: 100%;
  max-width: 760px;
  padding: var(--space-6);
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
.jm-quote *, .jm-quote *::before, .jm-quote *::after { box-sizing: border-box; }
.jm-quote__form { display: flex; flex-direction: column; gap: var(--space-5); margin: 0; }
.jm-quote fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.jm-quote legend { display: block; width: auto; max-width: 100%; margin: 0; border: 0; letter-spacing: 0; text-transform: none; }
.jm-quote .jm-quote__legend {
  padding: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  color: var(--ink);
}
.jm-quote .jm-quote__sublegend {
  padding: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.jm-quote__panel { display: flex; flex-direction: column; gap: var(--space-4); }
.jm-quote__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.jm-quote__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jm-quote__group { display: grid; gap: var(--space-3); align-content: start; }
.jm-quote__field { display: grid; gap: var(--space-1); align-content: start; }
.jm-quote__field--wide { grid-column: 1 / -1; }
.jm-quote__label { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink); }

/* Controls (beat Flatsome's input/select defaults). */
.jm-quote .jm-quote__control {
  width: 100%;
  min-height: var(--tap);
  height: auto;
  margin: 0;
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
}
.jm-quote textarea.jm-quote__control { padding: var(--space-3); min-height: 96px; resize: vertical; }
.jm-quote select.jm-quote__control { padding-right: var(--space-6); }
.jm-quote .jm-quote__control--mono { font-family: var(--font-mono); }
.jm-quote .jm-quote__control:focus { border-color: var(--navy); box-shadow: none; }
.jm-quote .is-invalid .jm-quote__control, .jm-quote .jm-quote__control[aria-invalid="true"] { border: 2px solid var(--error); }
.jm-quote__hint { font-size: 13px; line-height: 1.4; color: var(--ink-muted); }
.jm-quote__error { font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--error); }
.jm-quote__alert {
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--error);
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 15px;
}

/* Step indicator. */
.jm-quote__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.jm-quote__step { display: grid; gap: 6px; margin: 0; font-size: 14px; line-height: 18px; color: var(--ink-muted); }
.jm-quote__step-bar { height: 4px; border-radius: 2px; background: var(--surface-sunken); }
.jm-quote__step-n { font-family: var(--font-mono); }
.jm-quote__step.is-done, .jm-quote__step.is-current { color: var(--ink); }
.jm-quote__step.is-current { font-weight: 700; }
.jm-quote__step.is-done .jm-quote__step-bar, .jm-quote__step.is-current .jm-quote__step-bar { background: var(--orange); }

/* Cargo type cards (native radios). */
.jm-quote__cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.jm-quote__card {
  position: relative;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 6px;
  min-height: 76px;
  margin: 0;
  padding: var(--space-3);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.jm-quote__card input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.jm-quote__card-icon { display: block; width: 24px; height: 24px; background-color: var(--navy); -webkit-mask: var(--jmq-icon) center / contain no-repeat; mask: var(--jmq-icon) center / contain no-repeat; }
.jm-quote__card-label { font-weight: 600; font-size: 15px; line-height: 1.3; }
.jm-quote__card:hover { border-color: var(--line-strong); }
.jm-quote__card:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
.jm-quote__card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.jm-quote__types.is-invalid .jm-quote__card { border-color: var(--error); }

/* Row: ADR + file. */
.jm-quote__row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-start; justify-content: space-between; }
.jm-quote__check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; font-weight: 600; font-size: 15px; line-height: 1.4; cursor: pointer; }
.jm-quote__check--top { align-items: flex-start; font-weight: 400; }
.jm-quote .jm-quote__check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--navy); }
.jm-quote__check--top input { margin-top: 1px; }
.jm-quote__file { display: grid; gap: var(--space-1); max-width: 340px; }
.jm-quote__file-label { margin: 0; font-size: 15px; font-weight: 600; color: var(--navy); }
.jm-quote .jm-quote__file-input {
  min-height: 44px;
  margin: 0;
  padding: var(--space-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: none;
  font-size: 14px;
  color: var(--ink);
}
.jm-quote__file.is-invalid .jm-quote__file-input { border: 2px solid var(--error); }

/* Channel chips (native radios). */
.jm-quote__channels { margin-top: var(--space-1); }
.jm-quote__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.jm-quote__chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
}
.jm-quote__chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.jm-quote__chip:has(input:checked) { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.jm-quote__chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.jm-quote__consent { display: grid; gap: var(--space-1); }
.jm-quote__consent a { color: var(--navy); text-decoration: underline; }

/* Actions bar. */
.jm-quote__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}
.jm-quote__note { flex: 1 1 200px; font-size: 14px; line-height: 1.4; color: var(--ink-muted); }
.jm-quote .jm-quote__submit { margin: 0; padding: 0 var(--space-6); font-size: 17px; }
.jm-quote .jm-quote__submit[disabled] { opacity: .7; cursor: progress; }
.jm-quote .jm-quote__back {
  margin: 0;
  padding: 0 var(--space-5);
  background: transparent;
  border: 2px solid var(--line-strong);
  color: var(--navy);
}
.jm-quote .jm-quote__back:hover { border-color: var(--navy); color: var(--navy); background: transparent; }

/* Honeypot: off-screen, never focusable. */
.jm-quote__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Success state. */
.jm-quote__done { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-2) 0; }
.jm-quote__done-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--radius-pill); background: var(--success); color: var(--on-success); }
.jm-quote__done-title { margin: 0; font-size: 28px; line-height: 34px; font-weight: 800; }
.jm-quote__done-title:focus { outline: none; }
.jm-quote__done-text, .jm-quote__done-mail { margin: 0; font-size: 17px; line-height: 26px; }
.jm-quote__done-mail { color: var(--ink-muted); font-size: 15px; }
.jm-quote__done-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* UX Builder preview. */
.jm-quote__preview { padding: var(--space-6); border: 1px dashed var(--line-strong); text-align: center; font-weight: 600; }

/* [jm_quote_whatsapp]. */
.jm-quote-wa { display: inline-flex; align-items: center; gap: var(--space-2); }
.jm-quote-wa--button, .jm-quote .jm-quote-wa--button { min-height: var(--tap); background: var(--success); border-color: var(--success); color: var(--on-success); }
.jm-quote-wa--button:hover, .jm-quote-wa--button:visited, .jm-quote-wa--button:focus { color: var(--on-success); }
.jm-quote-wa--link { min-height: var(--tap); color: var(--navy); font-weight: 700; }

/* [jm_quote_hours]. */
.jm-quote-hours--list { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-4); margin: 0; font-size: 15px; }
.jm-quote-hours--list dt { margin: 0; font-family: var(--font-body); font-size: 15px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); }
.jm-quote-hours--list dd { margin: 0; }

/* ------------------------------------------------------------------------- *
 * Contact Form 7 engine (.jm-quote--cf7): CF7's markup mapped onto the same look. CF7's own stylesheet is not
 * loaded; the few rules it needs are here. With quote.js running (.is-js) CF7's tips and response box give way to
 * the step errors and the alert above; without JS they are the error display.
 * ------------------------------------------------------------------------- */
.jm-quote--cf7 .wpcf7 { margin: 0; }
.jm-quote--cf7 .hidden-fields-container { display: none !important; }
.jm-quote--cf7 .screen-reader-response { position: absolute; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; word-wrap: normal !important; }
.jm-quote--cf7 .wpcf7-form-control-wrap { position: relative; display: block; }
.jm-quote--cf7 .wpcf7-spinner { display: none; }
.jm-quote--cf7 .wpcf7 span.wpcf7-list-item { display: block; margin: 0; }
.jm-quote--cf7 .wpcf7-list-item-label::before, .jm-quote--cf7 .wpcf7-list-item-label::after { content: none; }
.jm-quote--cf7 .wpcf7 label { width: auto; }
.jm-quote--cf7 .wpcf7 .wpcf7-not-valid-tip { position: static; display: block; width: auto; margin: var(--space-1) 0 0; padding: 0; border-radius: 0; background: none; opacity: 1; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--error); }
.jm-quote--cf7 .wpcf7 .wpcf7-not-valid-tip::after { content: none; }
.jm-quote--cf7 input.wpcf7-not-valid, .jm-quote--cf7 select.wpcf7-not-valid, .jm-quote--cf7 textarea.wpcf7-not-valid { border: 2px solid var(--error); }
.jm-quote--cf7 .wpcf7-radio.wpcf7-not-valid, .jm-quote--cf7 .wpcf7-acceptance.wpcf7-not-valid { border: 0; }
.jm-quote--cf7 .jm-quote__cards .wpcf7-radio.wpcf7-not-valid .wpcf7-list-item > label { border-color: var(--error); }
.jm-quote--cf7 .wpcf7 form .wpcf7-response-output {
  order: 99;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-left: 4px solid var(--error);
  border-radius: 0;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 15px;
}
.jm-quote--cf7 .wpcf7 form.init .wpcf7-response-output, .jm-quote--cf7 .wpcf7-response-output:empty { display: none; }
.jm-quote--cf7 .wpcf7 form.sent .wpcf7-response-output { border-color: var(--success); }
.jm-quote--cf7.is-js .wpcf7-not-valid-tip, .jm-quote--cf7.is-js .wpcf7-response-output { display: none !important; }

/* Cargo type cards: CF7 radios. Icons from --jmq-icon-1…4 (set on .jm-quote by the render). */
.jm-quote--cf7 .jm-quote__cards { display: block; }
.jm-quote--cf7 .jm-quote__cards .wpcf7-radio { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.jm-quote--cf7 .jm-quote__cards .wpcf7-list-item > label {
  position: relative;
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 6px;
  height: 100%;
  min-height: 76px;
  margin: 0;
  padding: var(--space-3);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.jm-quote--cf7 .jm-quote__cards .wpcf7-list-item > label::before { content: ""; display: block; width: 24px; height: 24px; background-color: var(--navy); -webkit-mask: var(--jmq-icon) center / contain no-repeat; mask: var(--jmq-icon) center / contain no-repeat; }
.jm-quote--cf7 .jm-quote__cards .wpcf7-list-item:nth-child(1) > label { --jmq-icon: var(--jmq-icon-1); }
.jm-quote--cf7 .jm-quote__cards .wpcf7-list-item:nth-child(2) > label { --jmq-icon: var(--jmq-icon-2); }
.jm-quote--cf7 .jm-quote__cards .wpcf7-list-item:nth-child(3) > label { --jmq-icon: var(--jmq-icon-3); }
.jm-quote--cf7 .jm-quote__cards .wpcf7-list-item:nth-child(4) > label { --jmq-icon: var(--jmq-icon-4); }
.jm-quote--cf7 .jm-quote__cards .wpcf7-list-item-label { margin: 0; font-weight: 600; font-size: 15px; line-height: 1.3; }
.jm-quote--cf7 .jm-quote__cards input, .jm-quote--cf7 .jm-quote__chips input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.jm-quote--cf7 .jm-quote__cards .wpcf7-list-item > label:hover { border-color: var(--line-strong); }
.jm-quote--cf7 .jm-quote__cards .wpcf7-list-item > label:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
.jm-quote--cf7 .jm-quote__cards .wpcf7-list-item > label:has(input:focus-visible),
.jm-quote--cf7 .jm-quote__chips .wpcf7-list-item > label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.jm-quote--cf7 .jm-quote__types.is-invalid .wpcf7-list-item > label { border-color: var(--error); }

/* Channel chips: CF7 radios. */
.jm-quote--cf7 .jm-quote__chips { display: block; }
.jm-quote--cf7 .jm-quote__chips .wpcf7-radio { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.jm-quote--cf7 .jm-quote__chips .wpcf7-list-item > label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0 var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
}
.jm-quote--cf7 .jm-quote__chips .wpcf7-list-item-label { margin: 0; }
.jm-quote--cf7 .jm-quote__chips .wpcf7-list-item > label:has(input:checked) { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }

/* ADR checkbox and consent: CF7 checkbox / acceptance. */
.jm-quote--cf7 .jm-quote__check { display: block; min-height: 0; cursor: auto; }
.jm-quote--cf7 .wpcf7-checkbox label, .jm-quote--cf7 .wpcf7-acceptance label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; font-weight: 600; font-size: 15px; line-height: 1.4; color: var(--ink); cursor: pointer; }
.jm-quote--cf7 .wpcf7-acceptance label { align-items: flex-start; font-weight: 400; }
.jm-quote--cf7 .wpcf7-checkbox input, .jm-quote--cf7 .wpcf7-acceptance input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--navy); }
.jm-quote--cf7 .wpcf7-acceptance input { margin-top: 1px; }
.jm-quote--cf7 .wpcf7-list-item-label { margin: 0; }

@media (max-width: 849px) {
  .jm-quote__cards, .jm-quote--cf7 .jm-quote__cards .wpcf7-radio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 549px) {
  .jm-quote { padding: var(--space-5) var(--space-4); }
  .jm-quote__grid, .jm-quote__grid--3 { grid-template-columns: minmax(0, 1fr); }
  .jm-quote__actions { flex-direction: column-reverse; align-items: stretch; }
  .jm-quote .jm-quote__submit, .jm-quote .jm-quote__back { width: 100%; }
  .jm-quote__note { flex: none; text-align: center; }
}
