/* ==========================================================================
   MBG quote form. Uses the website's colors and fonts (the variables in
   assets/css/styles.css), with fallbacks so it also works on its own.
   ========================================================================== */

.quote-wrap {
  --qf-red: var(--red, #c2392f);
  --qf-red-dark: var(--red-dark, #9a231b);
  --qf-red-soft: var(--red-soft, #f6e3e1);
  --qf-ink: var(--ink, #141414);
  --qf-paper: var(--paper, #f7f5f2);
  --qf-sand: var(--sand, #ece7e0);
  --qf-line: var(--line, #e4dfd8);
  --qf-text: var(--text, #1f1d1b);
  --qf-muted: var(--muted, #5f5a54);
  --qf-display: var(--font-display, "Oswald", "Arial Narrow", Impact, sans-serif);
  --qf-body: var(--font-body, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --qf-ease: var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));

  position: relative;
  max-width: 880px;
  margin: 0 auto;
  font-family: var(--qf-body);
  color: var(--qf-text);
}

.quote-form,
.qf-success {
  background: #fff;
  border: 1px solid var(--qf-line);
  border-top: 4px solid var(--qf-red);
  border-radius: var(--radius-lg, 18px);
  box-shadow: var(--shadow-md, 0 8px 20px -6px rgba(20, 16, 12, 0.14), 0 2px 4px rgba(20, 16, 12, 0.06));
  padding: clamp(22px, 4vw, 44px);
}

.qf-head { margin-bottom: 8px; }
.qf-head .eyebrow { margin-bottom: 12px; }
.qf-title {
  margin: 0;
  font-family: var(--qf-display);
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.05;
  text-transform: uppercase;
}
.qf-lead { margin: 10px 0 0; color: var(--qf-muted); font-size: 16px; }

.qf-section {
  margin: 0;
  padding: 26px 0 0;
  border: 0;
  min-width: 0;
}
.qf-section + .qf-section { margin-top: 26px; border-top: 1px solid var(--qf-line); }
/* Floating the legend makes it sit inside the section like a normal heading
   instead of on the fieldset's border. */
.qf-legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0;
  font-family: var(--qf-display);
  font-size: 20px;
  font-weight: 550;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.qf-legend + * { clear: both; }
.qf-legend i, .qf-label i { color: var(--qf-red); font-style: normal; }
.qf-legend small { font-family: var(--qf-body); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--qf-muted); }
.qf-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--qf-ink);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.qf-hint { margin: -6px 0 14px; color: var(--qf-muted); font-size: 14.5px; }

.qf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.qf-grid--pair { gap: 12px; }
.qf-span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .qf-grid { grid-template-columns: 1fr; }
  .qf-grid--pair { grid-template-columns: 0.8fr 1.2fr; }
}

.qf-field { display: grid; gap: 7px; min-width: 0; }
.qf-label { font-size: 13px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--qf-muted); }
.qf-input {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  border: 1.5px solid #d4cdc3;
  border-radius: 10px;
  background: #fff;
  color: var(--qf-text);
  font: 500 16px/1.35 var(--qf-body);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.qf-input::placeholder { color: #a39b91; }
.qf-input:focus { outline: none; border-color: var(--qf-red); box-shadow: 0 0 0 4px rgba(194, 57, 47, 0.14); }
textarea.qf-input { min-height: 120px; resize: vertical; line-height: 1.55; }
.qf-field.is-invalid .qf-input { border-color: var(--qf-red); background: #fffafa; }
.qf-msg { display: block; font-size: 13.5px; font-weight: 600; color: var(--qf-red); }
[data-qf-group] > .qf-msg { margin: -6px 0 12px; }

/* Services */
.qf-services { display: grid; gap: 16px; }
.qf-group-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #8a837b; }
.qf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qf-chip { position: relative; cursor: pointer; }
.qf-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qf-chip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border: 1.5px solid var(--qf-line);
  border-radius: 999px;
  background: var(--qf-paper);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--qf-muted);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
}
.qf-chip:hover span { border-color: #c9c0b5; color: var(--qf-text); }
.qf-chip input:checked + span { background: var(--qf-red); border-color: var(--qf-red); color: #fff; }
.qf-chip input:checked + span::before {
  content: "";
  width: 14px;
  height: 14px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E");
}
.qf-chip input:focus-visible + span { outline: 3px solid var(--qf-red); outline-offset: 2px; }

/* Contact method */
.qf-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .qf-methods { grid-template-columns: 1fr; } }
.qf-method { position: relative; cursor: pointer; }
.qf-method input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qf-method-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 12px 16px;
  border: 1.5px solid var(--qf-line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.qf-method-box svg { width: 24px; height: 24px; flex: none; color: var(--qf-red); }
.qf-method-box b { font-size: 15.5px; font-weight: 650; }
.qf-method:hover .qf-method-box { border-color: #c9c0b5; }
.qf-method input:checked + .qf-method-box { border-color: var(--qf-red); background: var(--qf-red-soft); box-shadow: inset 0 0 0 1px var(--qf-red); }
.qf-method input:focus-visible + .qf-method-box { outline: 3px solid var(--qf-red); outline-offset: 2px; }
[data-qf-group].is-invalid .qf-chip span,
[data-qf-group].is-invalid .qf-method-box { border-color: rgba(194, 57, 47, 0.55); }

/* Photos */
.qf-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 2px dashed #cfc7bd;
  border-radius: 14px;
  background: var(--qf-paper);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.qf-drop:hover, .qf-drop.is-over { border-color: var(--qf-red); background: var(--qf-red-soft); }
.qf-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qf-drop input:focus-visible ~ svg { outline: 3px solid var(--qf-red); outline-offset: 4px; border-radius: 8px; }
.qf-drop svg { width: 40px; height: 40px; flex: none; color: var(--qf-red); }
.qf-drop-text { display: grid; gap: 2px; }
.qf-drop-text b { font-size: 16px; }
.qf-drop-text span { color: var(--qf-muted); font-size: 14px; }

.qf-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.qf-thumbs:empty { display: none; }
.qf-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--qf-sand);
}
.qf-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qf-thumb-name { position: absolute; inset: auto 0 0; padding: 4px 6px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qf-thumb button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.75);
  color: #fff;
  cursor: pointer;
}
.qf-thumb button svg { width: 14px; height: 14px; }
.qf-thumb.is-uploading::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.55); }
.qf-thumb.is-done::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2e8b57 no-repeat center / 13px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5 10-11'/%3E%3C/svg%3E");
}

/* Footer */
.qf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.qf-foot { display: grid; justify-items: start; gap: 14px; margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--qf-line); }
.qf-submit { min-width: 240px; }
.qf-submit.is-busy { pointer-events: none; opacity: 0.85; }
.qf-error {
  margin: 0;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--qf-red-soft);
  color: var(--qf-red-dark);
  font-weight: 600;
  font-size: 15px;
}
.qf-progress { width: min(360px, 100%); height: 6px; border-radius: 6px; background: var(--qf-sand); overflow: hidden; }
.qf-progress-bar { display: block; width: 100%; height: 100%; background: var(--qf-red); transform-origin: 0 50%; transform: scaleX(0); }
.qf-fine { margin: 0; font-size: 13.5px; color: var(--qf-muted); }
@media (max-width: 560px) { .qf-submit { width: 100%; } }

/* Success */
.qf-success { display: grid; justify-items: center; gap: 14px; padding-block: 56px; text-align: center; outline: none; }
.qf-success[hidden] { display: none; }
.qf-success-icon { width: 76px; height: 76px; color: #2e8b57; }
.qf-success-icon svg { width: 100%; height: 100%; }
.qf-success-text { max-width: 460px; margin: 0; color: var(--qf-muted); font-size: 16.5px; }
.qf-again { margin-top: 8px; }
.qf-test-note { margin: 0; padding: 8px 12px; border-radius: 8px; background: #fbf1dc; color: #8a5d0c; font-size: 13.5px; font-weight: 600; }

/* Lead source + spam check */
.qf-heard { margin-bottom: 16px; max-width: 420px; }
select.qf-input {
  padding-right: 40px;
  background: #fff no-repeat right 12px center / 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a837b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.qf-captcha { min-height: 65px; }
