.bim-quote-trigger { cursor: pointer; font-family: inherit; }
.bim-quote-trigger:focus-visible { outline: 3px solid var(--bim-blue); outline-offset: 4px; }

.bim-quote-dialog {
  position: fixed;
  inset: auto 1.5rem 1.5rem auto;
  width: min(30rem, calc(100% - 3rem));
  max-width: none;
  max-height: calc(100vh - 6.5rem);
  max-height: calc(100dvh - 6.5rem);
  margin: 0;
  padding: 1.875rem;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  background: #fff;
  color: #191c20;
  box-shadow: 0 .8rem 3rem #0004;
  font: 1rem/1.5 Arial, sans-serif;
}

.bim-quote-dialog::backdrop { background: #11151d8c; backdrop-filter: blur(4px); }

.bim-quote-close {
  position: absolute;
  top: .85rem;
  right: .85rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: .35rem;
  background: transparent;
  color: #30363d;
  cursor: pointer;
}

.bim-quote-close:hover { background: #f3f4f6; }
.bim-quote-close svg { width: 1.25rem; height: 1.25rem; }
.bim-quote-header { padding-right: 1.75rem; }
.bim-quote-header h2 { font-size: clamp(1.35rem, 4.5vw, 1.6rem); line-height: 1.2; letter-spacing: -.025em; }
.bim-quote-header p { margin-top: .4rem; color: #4b5563; font-size: .875rem; }
.bim-quote-form { display: grid; gap: 1.1rem; margin-top: 1.4rem; }

.bim-quote-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.bim-quote-section legend { margin-bottom: .55rem; padding: 0; color: #191c20; font-size: .95rem; font-weight: 700; }
.bim-quote-services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.bim-quote-option { position: relative; min-width: 0; }

.bim-quote-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.bim-quote-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  height: 100%;
  min-height: 4rem;
  padding: .45rem .25rem;
  border: 1px solid #e1e4e7;
  border-radius: .5rem;
  background: #f6f7f8;
  color: #272b31;
  font-size: .74rem;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.bim-quote-option label:hover { background: #ebedf0; }
.bim-quote-option input:checked + label { border-color: #202429; background: #202429; color: #fff; }
.bim-quote-option svg { flex: 0 0 auto; width: 1.45rem; height: 1.45rem; }
.bim-quote-option input:focus-visible + label, .bim-quote-dialog :is(button, a):focus-visible {
  outline: 2px solid #245eb7;
  outline-offset: 2px;
}

.bim-quote-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.bim-quote-field { display: grid; align-content: start; gap: .24rem; min-width: 0; }
.bim-quote-field label { color: #353b43; font-size: .8rem; font-weight: 600; }

.bim-quote-company { grid-column: 1 / -1; }

.bim-quote-field :is(input, select, textarea) {
  min-width: 0;
  width: 100%;
  padding: .55rem .65rem;
  border: 1px solid #ccd1d7;
  border-radius: .4rem;
  background: #fff;
  color: #191c20;
  font: inherit;
}

.bim-quote-field :is(input, textarea)::placeholder { color: #626c77; opacity: 1; }
.bim-quote-field :is(input, select, textarea):focus-visible { outline: 2px solid #245eb7; outline-offset: 1px; }
.bim-quote-field textarea { min-height: 4.5rem; resize: vertical; }
.bim-quote-counter { justify-self: end; color: #4b5563; font-size: .72rem; }
.bim-quote-actions { display: grid; gap: .6rem; }
.bim-quote-actions p { font-size: .78rem; }
.bim-quote-consent { color: #4b5563; }
.bim-quote-form .bim-quote-preview { padding: .55rem .65rem; border-radius: .4rem; background: #f2f4f7; color: #333d47; }
.bim-quote-status { color: #333d47; }
.bim-quote-status:empty { position: absolute; }

.bim-quote-submit {
  min-height: 2.75rem;
  padding: .75rem 1.125rem;
  border: 0;
  border-radius: 3.125rem;
  background: #101718;
  color: #fff;
  font: 400 .85rem/1.25 Arial, sans-serif;
  text-transform: uppercase;
  cursor: pointer;
}

.bim-quote-submit:hover { background: #383d43; }

@media (max-width: 700px) {
  .bim-quote-dialog {
    inset: .75rem .75rem auto auto;
    width: min(30rem, calc(100% - 1.5rem));
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    padding: 1.5rem 1.125rem max(1.5rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 31rem) {
  .bim-quote-fields { grid-template-columns: 1fr; }
}
