.estimate-modal-backdrop[hidden] {
  display: none;
}

.estimate-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26, 13, 9, .72);
}

.estimate-modal {
  width: min(720px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  color: var(--ink, #222);
  border-top: 6px solid var(--red, #8a1f03);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.estimate-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px 18px;
  border-bottom: 1px solid var(--line, #e3ddca);
}

.estimate-modal__eyebrow {
  margin-bottom: 8px;
  color: var(--red, #8a1f03);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.estimate-modal__title {
  margin: 0;
  color: var(--ink, #222);
  font-family: 'Roboto Condensed', 'Roboto', sans-serif;
  font-size: 32px;
  line-height: 1;
  text-transform: uppercase;
}

.estimate-modal__close {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 0;
  background: var(--bg, #f7f5ef);
  color: var(--red, #8a1f03);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.estimate-modal__body {
  padding: 24px 30px 30px;
}

.estimate-modal__intro {
  margin-bottom: 20px;
  color: var(--muted, #666);
}

.estimate-form {
  display: grid;
  gap: 16px;
}

.estimate-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.estimate-form label {
  display: grid;
  gap: 7px;
  color: var(--red-dark, #5e1502);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.estimate-form input,
.estimate-form select,
.estimate-form textarea {
  width: 100%;
  border: 1px solid #d8d0bd;
  border-radius: 0;
  background: #fff;
  color: var(--ink, #222);
  font: inherit;
  padding: 13px 12px;
}

.estimate-form textarea {
  min-height: 112px;
  resize: vertical;
}

.estimate-form__details[hidden] {
  display: none;
}

.estimate-form__details {
  display: grid;
  gap: 16px;
}

.estimate-form__conditional[hidden] {
  display: none;
}

.estimate-form__conditional {
  display: grid;
  gap: 16px;
}

.estimate-form__hint {
  color: var(--muted, #666);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}

.estimate-form__label-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
}

.estimate-form__tooltip {
  position: relative;
  z-index: 2;
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--red, #8a1f03);
  color: #fff;
  cursor: help;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.estimate-form__tooltip:focus-visible {
  outline: 2px solid var(--tan, #c9ae7f);
  outline-offset: 2px;
}

.estimate-form__tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 20;
  width: min(270px, calc(100vw - 48px));
  padding: 10px 12px;
  border-radius: 3px;
  background: var(--red-dark, #5e1502);
  box-shadow: 0 14px 32px rgba(42, 26, 16, .22);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  text-transform: none;
  transform: translate(-50%, 6px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.estimate-form__tooltip-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 6px solid transparent;
  border-top-color: var(--red-dark, #5e1502);
  transform: translateX(-50%);
}

.estimate-form__tooltip:hover .estimate-form__tooltip-bubble,
.estimate-form__tooltip:focus .estimate-form__tooltip-bubble,
.estimate-form__tooltip:focus-visible .estimate-form__tooltip-bubble {
  opacity: 1;
  transform: translate(-50%, 0);
}

.estimate-form__fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.estimate-form__fieldset legend {
  margin-bottom: 7px;
  color: var(--red-dark, #5e1502);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.estimate-form__fieldset legend span {
  color: var(--muted, #666);
  font-size: 11px;
  letter-spacing: .04em;
}

.estimate-form__photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.estimate-form__photos input[type="file"] {
  min-height: 48px;
  padding: 10px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.estimate-form__multi {
  position: relative;
}

.estimate-form__multi summary {
  min-height: 48px;
  list-style: none;
  border: 1px solid #d8d0bd;
  background: #fff;
  color: var(--ink, #222);
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0;
  padding: 13px 42px 13px 12px;
  text-transform: none;
}

.estimate-form__multi summary::-webkit-details-marker {
  display: none;
}

.estimate-form__multi summary::after {
  content: "";
  position: absolute;
  top: 19px;
  right: 15px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--red, #8a1f03);
  border-bottom: 2px solid var(--red, #8a1f03);
  transform: rotate(45deg);
}

.estimate-form__multi[open] summary::after {
  top: 23px;
  transform: rotate(225deg);
}

.estimate-form__multi-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 3;
  display: grid;
  gap: 0;
  border: 1px solid #d8d0bd;
  background: #fff;
  box-shadow: 0 14px 32px rgba(42, 26, 16, .18);
  padding: 6px;
}

.estimate-form__check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  color: var(--ink, #222) !important;
  cursor: pointer;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  line-height: 1.3;
  padding: 10px;
  text-transform: none !important;
}

.estimate-form__check:hover {
  background: var(--bg, #f7f5ef);
}

.estimate-form__check input {
  width: 18px;
  height: 18px;
  accent-color: var(--red, #8a1f03);
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
}

.estimate-form__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.estimate-form__submit {
  border: 0;
  background: var(--red, #8a1f03);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .05em;
  padding: 14px 22px;
  text-transform: uppercase;
}

.estimate-form__submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.estimate-form__phone {
  color: var(--red, #8a1f03);
  font-weight: 900;
}

.estimate-form__status {
  display: none;
  margin-top: 14px;
  border-left: 4px solid var(--red, #8a1f03);
  background: var(--bg, #f7f5ef);
  color: var(--ink, #222);
  font-weight: 700;
  padding: 14px 16px;
}

.estimate-form__status.is-visible {
  display: block;
}

.estimate-form__status--success {
  border-left-color: #2f7d42;
  background: #eef8f1;
}

.estimate-form__status--error {
  border-left-color: var(--red, #8a1f03);
  background: #fff3ef;
}

body.estimate-modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .estimate-modal-backdrop {
    align-items: flex-start;
    padding: 12px;
  }

  .estimate-modal {
    max-height: calc(100vh - 24px);
  }

  .estimate-modal__head,
  .estimate-modal__body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .estimate-modal__title {
    font-size: 28px;
  }

  .estimate-form__grid {
    grid-template-columns: 1fr;
  }

  .estimate-form__photo-grid {
    grid-template-columns: 1fr;
  }
}
