.lead-form {
  display: grid;
  gap: 0.9rem;
}

.contacts-modal__dialog.contacts-detail-card,
.house-modal__dialog.detail-card,
.mortgage-modal__dialog {
  background:
    linear-gradient(180deg, rgba(22, 29, 26, 0.88), rgba(16, 22, 20, 0.82) 46%, rgba(10, 15, 14, 0.78)),
    rgba(12, 17, 16, 0.82);
  border-color: rgba(246, 232, 220, 0.2);
  box-shadow:
    0 1.25rem 3rem rgba(7, 12, 10, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 rgba(7, 12, 10, 0.22);
  backdrop-filter: blur(1.18rem) saturate(132%);
  -webkit-backdrop-filter: blur(1.18rem) saturate(132%);
}

.lead-progress {
  width: fit-content;
  border: 0.0625rem solid rgba(246, 232, 220, 0.18);
  border-radius: 999rem;
  padding: 0.36rem 0.68rem;
  color: rgba(246, 232, 220, 0.78);
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background:
    linear-gradient(180deg, rgba(246, 232, 220, 0.085), rgba(246, 232, 220, 0.036)),
    rgba(9, 14, 13, 0.26);
}

.lead-notice {
  border: 0.0625rem solid rgba(205, 150, 113, 0.34);
  border-radius: 1.1rem;
  padding: 0.76rem 0.86rem;
  color: rgba(246, 232, 220, 0.86);
  font-size: 0.96rem;
  line-height: 1.48;
  background:
    linear-gradient(180deg, rgba(205, 150, 113, 0.13), rgba(205, 150, 113, 0.065)),
    rgba(10, 15, 14, 0.28);
}

.lead-fieldset {
  display: grid;
  gap: 0.52rem;
  border: 0;
  padding: 0;
  margin: 0;
}

.lead-fieldset legend,
.lead-input > span,
.lead-child-ages > span {
  margin-bottom: 0;
  color: rgba(247, 234, 223, 0.9);
  font-weight: 580;
  font-size: 0.9rem;
  line-height: 1.24;
  letter-spacing: -0.006em;
}

.lead-fieldset > .lead-select,
.lead-fieldset > .lead-custom-select {
  margin-top: 0.52rem;
}

.lead-fieldset.is-invalid > legend,
.lead-input.is-invalid > span,
.lead-child-ages.is-invalid > span,
.lead-consent.is-invalid > span {
  color: #ffd1c8;
  text-decoration-line: underline;
  text-decoration-color: #ff7c67;
  text-decoration-thickness: 0.12rem;
  text-underline-offset: 0.18rem;
}

.lead-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.lead-option {
  min-height: 2.9rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 0.0625rem solid rgba(246, 232, 220, 0.18);
  border-radius: 1rem;
  padding: 0.76rem 0.82rem;
  color: rgba(246, 232, 220, 0.88);
  background: rgba(246, 232, 220, 0.075);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.lead-option:hover,
.lead-option:focus-within,
.lead-option.is-selected {
  border-color: rgba(205, 150, 113, 0.72);
  background: rgba(205, 150, 113, 0.18);
}

.lead-option:hover {
  transform: translateY(-0.06rem);
}

.lead-option input {
  width: 1rem;
  height: 1rem;
  accent-color: #cd9671;
  flex: 0 0 auto;
}

.lead-option span {
  font-weight: 620;
  line-height: 1.2;
}

.lead-input {
  display: grid;
  gap: 0.52rem;
}

.lead-select {
  position: relative;
  display: grid;
  border-radius: 0.86rem;
}

.lead-custom-select {
  position: relative;
  z-index: 1;
  display: grid;
  border-radius: 0.86rem;
}

.lead-custom-select.is-open {
  z-index: 8;
}

.lead-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.82rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 0.12rem solid rgba(246, 232, 220, 0.72);
  border-bottom: 0.12rem solid rgba(246, 232, 220, 0.72);
  transform: translateY(-66%) rotate(45deg);
  pointer-events: none;
}

.lead-custom-select__button {
  position: relative;
  width: 100%;
  min-height: 2.56rem;
  border: 0.0625rem solid rgba(246, 232, 220, 0.18);
  border-radius: 0.86rem;
  padding: 0.68rem 2.28rem 0.68rem 0.78rem;
  color: #f7eadf;
  font: inherit;
  font-weight: 560;
  line-height: 1.24;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(246, 232, 220, 0.088), rgba(246, 232, 220, 0.032)),
    rgba(9, 14, 13, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16);
  cursor: pointer;
}

.lead-custom-select__button::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.82rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 0.12rem solid rgba(246, 232, 220, 0.72);
  border-bottom: 0.12rem solid rgba(246, 232, 220, 0.72);
  transform: translateY(-66%) rotate(45deg);
  pointer-events: none;
}

.lead-custom-select.is-open .lead-custom-select__button {
  border-color: rgba(205, 150, 113, 0.82);
  box-shadow: 0 0 0 0.18rem rgba(205, 150, 113, 0.14);
}

.lead-custom-select.is-open .lead-custom-select__button::after {
  transform: translateY(-34%) rotate(225deg);
}

.lead-custom-select__panel {
  position: absolute;
  top: calc(100% + 0.34rem);
  left: 0;
  right: 0;
  display: grid;
  max-height: min(16rem, 46vh);
  overflow: auto;
  border: 0.0625rem solid rgba(246, 232, 220, 0.16);
  border-radius: 0.94rem;
  padding: 0.32rem;
  background:
    linear-gradient(180deg, rgba(24, 31, 28, 0.98), rgba(12, 18, 16, 0.98)),
    rgba(12, 17, 16, 0.98);
  box-shadow:
    0 1rem 2.2rem rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lead-custom-select__panel[hidden] {
  display: none;
}

.lead-custom-select__option {
  width: 100%;
  border: 0;
  border-radius: 0.72rem;
  padding: 0.62rem 0.66rem;
  color: rgba(246, 232, 220, 0.84);
  font: inherit;
  font-weight: 520;
  line-height: 1.22;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.lead-custom-select__option:hover,
.lead-custom-select__option:focus-visible,
.lead-custom-select__option[aria-selected="true"] {
  color: #f7eadf;
  background: rgba(205, 150, 113, 0.16);
  outline: none;
}

.lead-input input,
.lead-input select,
.lead-select select,
.lead-age-grid input {
  width: 100%;
  min-height: 2.56rem;
  border: 0.0625rem solid rgba(246, 232, 220, 0.18);
  border-radius: 0.86rem;
  padding: 0.68rem 0.78rem;
  color: #f7eadf;
  font: inherit;
  font-weight: 560;
  line-height: 1.24;
  background:
    linear-gradient(180deg, rgba(246, 232, 220, 0.088), rgba(246, 232, 220, 0.032)),
    rgba(9, 14, 13, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16);
  outline: none;
}

.lead-input select,
.lead-select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.28rem;
  color-scheme: dark;
  cursor: pointer;
}

.lead-input select option,
.lead-select select option {
  color: #f7eadf;
  background: #121a17;
  font-weight: 560;
}

.lead-input input:focus,
.lead-input select:focus,
.lead-select select:focus,
.lead-age-grid input:focus {
  border-color: rgba(205, 150, 113, 0.82);
  box-shadow: 0 0 0 0.18rem rgba(205, 150, 113, 0.18);
}

.lead-input input::placeholder {
  color: rgba(246, 232, 220, 0.46);
}

.lead-child-ages {
  display: grid;
  gap: 0.44rem;
}

.lead-age-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.44rem;
}

.lead-age-grid label {
  display: grid;
  gap: 0.28rem;
  color: rgba(246, 232, 220, 0.7);
  font-size: 0.82rem;
  font-weight: 560;
}

.lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.52rem;
  color: rgba(246, 232, 220, 0.8);
  font-size: 0.9rem;
  line-height: 1.35;
}

.lead-consent input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.1rem;
  accent-color: #cd9671;
  flex: 0 0 auto;
}

.lead-consent a {
  color: #f7eadf;
  text-decoration-color: rgba(205, 150, 113, 0.82);
  text-underline-offset: 0.16rem;
}

.lead-error,
.lead-status {
  margin: 0;
  color: #ffd7c9;
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
}

.lead-status {
  border: 0.0625rem solid rgba(255, 215, 201, 0.3);
  border-radius: 0.9rem;
  padding: 0.7rem 0.82rem;
  background: rgba(255, 215, 201, 0.08);
}

.lead-submit-state {
  display: grid;
  justify-items: center;
  gap: 0.72rem;
  padding: clamp(1rem, 4vw, 1.35rem);
  border: 0.0625rem solid rgba(205, 150, 113, 0.34);
  border-radius: 1.15rem;
  background:
    linear-gradient(135deg, rgba(205, 150, 113, 0.14), rgba(238, 223, 211, 0.06)),
    rgba(4, 15, 12, 0.68);
  color: #f7eadf;
  text-align: center;
  animation: leadSubmitEnter 0.34s ease both;
}

.lead-submit-mark {
  width: clamp(4.5rem, 18vw, 5.65rem);
  height: clamp(4.5rem, 18vw, 5.65rem);
  display: grid;
  place-items: center;
  border-radius: 999rem;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.2), transparent 32%),
    linear-gradient(145deg, rgba(246, 232, 220, 0.13), rgba(205, 150, 113, 0.08)),
    rgba(8, 14, 13, 0.64);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.lead-submit-spinner {
  width: 66%;
  height: 66%;
  border-radius: 999rem;
  background:
    conic-gradient(from 0deg, rgba(205, 150, 113, 0), rgba(205, 150, 113, 0.18), #f7eadf 76%, rgba(205, 150, 113, 0));
  animation: leadSubmitSpin 0.84s cubic-bezier(0.5, 0.04, 0.46, 0.96) infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 0.28rem), #000 calc(100% - 0.26rem));
  mask: radial-gradient(farthest-side, transparent calc(100% - 0.28rem), #000 calc(100% - 0.26rem));
}

.lead-submit-check {
  width: 70%;
  height: 70%;
  overflow: visible;
}

.lead-submit-check__circle,
.lead-submit-check__path {
  fill: none;
  stroke: #f7eadf;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead-submit-check__circle {
  stroke-width: 3.2;
  opacity: 0.5;
  stroke-dasharray: 170;
  stroke-dashoffset: 170;
  animation: leadSubmitCircle 0.58s cubic-bezier(0.2, 0.78, 0.24, 1) 0.04s forwards;
}

.lead-submit-check__path {
  stroke-width: 5.2;
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  animation: leadSubmitCheck 0.42s cubic-bezier(0.18, 0.88, 0.28, 1.18) 0.32s forwards;
}

.lead-submit-state.is-complete .lead-submit-mark {
  animation: leadSubmitPop 0.54s cubic-bezier(0.18, 0.88, 0.28, 1.18) both;
}

.lead-submit-state--failed {
  border-color: rgba(255, 174, 150, 0.32);
  background:
    linear-gradient(135deg, rgba(174, 82, 64, 0.16), rgba(238, 223, 211, 0.052)),
    rgba(4, 15, 12, 0.68);
}

.lead-submit-mark--failed {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(255, 174, 150, 0.13), rgba(174, 82, 64, 0.08)),
    rgba(8, 14, 13, 0.64);
  animation: leadSubmitPop 0.54s cubic-bezier(0.18, 0.88, 0.28, 1.18) both;
}

.lead-submit-fail {
  width: 70%;
  height: 70%;
  overflow: visible;
}

.lead-submit-fail__circle,
.lead-submit-fail__line,
.lead-submit-fail__dot {
  fill: none;
  stroke: #ffd7c9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead-submit-fail__circle {
  stroke-width: 3.2;
  opacity: 0.48;
  stroke-dasharray: 170;
  stroke-dashoffset: 170;
  animation: leadSubmitCircle 0.58s cubic-bezier(0.2, 0.78, 0.24, 1) 0.04s forwards;
}

.lead-submit-fail__line,
.lead-submit-fail__dot {
  stroke-width: 5;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: leadSubmitCheck 0.34s cubic-bezier(0.18, 0.88, 0.28, 1.18) 0.3s forwards;
}

.lead-submit-state__actions {
  width: 100%;
  max-width: 25rem;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr);
  gap: 0.58rem;
  margin-top: 0.14rem;
}

.lead-submit-state__actions .button {
  width: 100%;
  min-height: 2.54rem;
  text-decoration: none;
}

.lead-submit-state__eyebrow,
.lead-success__eyebrow {
  margin: 0;
  color: rgba(205, 150, 113, 0.96);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-submit-state h3,
.lead-submit-state p {
  margin: 0;
  max-width: 30rem;
}

.lead-submit-state h3 {
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.lead-submit-state p:not(.lead-submit-state__eyebrow):not(.lead-success__eyebrow) {
  color: rgba(247, 234, 223, 0.82);
  font-size: 0.98rem;
  line-height: 1.52;
}

.lead-submit-phone {
  color: #f7eadf;
  font-weight: 720;
  text-decoration-color: rgba(205, 150, 113, 0.82);
  text-decoration-thickness: 0.08rem;
  text-underline-offset: 0.18rem;
}

@keyframes leadSubmitEnter {
  from {
    opacity: 0;
    transform: translateY(0.4rem) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes leadSubmitSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes leadSubmitPop {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  58% {
    opacity: 1;
    transform: scale(1.06);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes leadSubmitCircle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes leadSubmitCheck {
  to {
    stroke-dashoffset: 0;
  }
}

.lead-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.58rem;
  align-items: center;
}

.lead-actions .button {
  width: 100%;
  min-height: 2.62rem;
}

.lead-actions .button--solid {
  background: #bd917a;
  box-shadow: none;
  border-color: rgba(246, 232, 220, 0.1);
  color: rgba(247, 234, 223, 0.92);
  font-weight: 570;
}

.lead-actions .button--solid:hover,
.lead-actions .button--solid:focus-visible {
  background: #bd917a;
  box-shadow: none;
  transform: translateY(-0.04rem);
}

.lead-actions .button--solid:disabled {
  background: #bd917a;
  box-shadow: none;
  opacity: 0.78;
}

.lead-actions .button--ghost {
  font-weight: 520;
}

.lead-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 42rem) {
  .lead-form {
    gap: 0.68rem;
    font-size: 0.78rem;
  }

  .lead-progress {
    padding: 0.28rem 0.52rem;
    font-size: 0.6rem;
  }

  .lead-notice {
    border-radius: 0.82rem;
    padding: 0.58rem 0.64rem;
    font-size: 0.74rem;
    line-height: 1.3;
  }

  .lead-fieldset {
    gap: 0.52rem;
  }

  .lead-fieldset legend,
  .lead-input > span,
  .lead-child-ages > span {
    font-size: 0.76rem;
    line-height: 1.18;
  }

  .lead-input input,
  .lead-input select,
  .lead-select select,
  .lead-age-grid input,
  .lead-custom-select__button {
    min-height: 2.34rem;
    border-radius: 0.74rem;
    padding: 0.46rem 0.62rem;
    font-size: 16px;
    font-weight: 540;
  }

  .lead-select select {
    padding-right: 1.94rem;
  }

  .lead-custom-select__button {
    padding-right: 1.94rem;
  }

  .lead-select::after,
  .lead-custom-select__button::after {
    right: 0.62rem;
    width: 0.42rem;
    height: 0.42rem;
  }

  .lead-custom-select__panel {
    max-height: min(14rem, 42vh);
    border-radius: 0.82rem;
    padding: 0.28rem;
  }

  .lead-custom-select__option {
    border-radius: 0.64rem;
    padding: 0.54rem 0.56rem;
    font-size: 0.78rem;
    line-height: 1.18;
  }

  .lead-consent {
    gap: 0.42rem;
    font-size: 0.7rem;
    line-height: 1.26;
  }

  .lead-consent input {
    width: 0.92rem;
    height: 0.92rem;
  }

  .lead-error,
  .lead-status {
    font-size: 0.7rem;
  }

  .lead-submit-state {
    gap: 0.58rem;
    padding: 0.94rem 0.8rem;
  }

  .lead-submit-mark {
    width: 4.15rem;
    height: 4.15rem;
  }

  .lead-submit-state__eyebrow,
  .lead-success__eyebrow {
    font-size: 0.64rem;
  }

  .lead-submit-state h3 {
    font-size: 1.38rem;
  }

  .lead-submit-state p:not(.lead-submit-state__eyebrow):not(.lead-success__eyebrow) {
    font-size: 0.78rem;
    line-height: 1.36;
  }

  .lead-submit-state__actions {
    grid-template-columns: 1fr;
  }

  .lead-submit-state__actions .button {
    min-height: 2.22rem;
    font-size: 0.78rem;
  }

  .lead-actions .button {
    min-height: 2.22rem;
    font-size: 0.78rem;
  }

  .lead-options,
  .lead-actions {
    grid-template-columns: 1fr;
  }

  .lead-age-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.34rem;
  }

  .contacts-modal__dialog,
  .house-modal__dialog,
  .mortgage-modal__dialog {
    max-height: calc(100vh - 1.8rem);
  }

  .lead-option:hover {
    transform: none;
  }
}

@media (max-width: 23rem) {
  .lead-form {
    gap: 0.52rem;
  }

  .contacts-modal__dialog,
  .house-modal__dialog,
  .mortgage-modal__dialog {
    padding-top: 1.05rem;
  }

  .contacts-modal__close,
  .house-modal__close,
  .mortgage-modal__close {
    top: 0.72rem;
    right: 0.72rem;
    width: 2.18rem;
    height: 2.18rem;
  }

  .contacts-page__kicker,
  .house-page__kicker,
  .mortgage-page__kicker {
    max-width: calc(100% - 2.95rem);
    padding-right: 0.2rem;
    font-size: 0.82rem;
    line-height: 1.12;
  }

  .contacts-modal__title,
  .house-modal__title,
  .mortgage-modal__title {
    max-width: calc(100% - 2.95rem);
    margin-top: 0.28rem;
    font-size: clamp(1.62rem, 9vw, 1.9rem);
    line-height: 0.98;
  }

  .contacts-modal__lead,
  .house-modal__lead,
  .mortgage-modal__lead {
    margin-top: 0.58rem;
    font-size: 0.92rem;
    line-height: 1.38;
  }

  .lead-option,
  .lead-input input,
  .lead-input select,
  .lead-select select,
  .lead-age-grid input,
  .lead-custom-select__button {
    border-radius: 0.82rem;
    padding-inline: 0.72rem;
  }

  .lead-select select,
  .lead-custom-select__button {
    padding-right: 2.15rem;
    font-size: 0.875rem;
    font-weight: 520;
  }

  .lead-custom-select__option {
    font-size: 0.76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-submit-state,
  .lead-submit-state.is-complete .lead-submit-mark,
  .lead-submit-spinner,
  .lead-submit-check__circle,
  .lead-submit-check__path,
  .lead-submit-fail__circle,
  .lead-submit-fail__line,
  .lead-submit-fail__dot {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
