#zayavka.offer-estimate {
  color: var(--ink);
  background: #f8f7f2;
  border-color: var(--line);
  border-radius: 12px;
  padding: clamp(18px, 4vw, 48px);
  scroll-margin-top: calc(var(--mast, 78px) + 1rem);
}

#vyplata {
  scroll-margin-top: calc(var(--mast, 78px) + 1rem);
}

#zayavka > h2 {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
}

#zayavka > p {
  color: var(--muted);
}

#zayavka .offer-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.55rem 0.75rem;
  max-width: 38rem;
  margin-top: 1rem;
}

#zayavka .offer-form > :not(.lead-field),
#zayavka .lead-field-wide {
  grid-column: 1 / -1;
}

#zayavka .lead-field label {
  font-size: 0.9rem;
  font-weight: 620;
}

#zayavka .lead-field :is(input, select, textarea) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #96978e;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: #fffefa;
  color: var(--ink);
  font: inherit;
}

#zayavka .lead-field textarea {
  min-height: 3.75rem;
  resize: vertical;
}

#zayavka .lead-field ::placeholder {
  color: var(--muted);
  opacity: 1;
}

#zayavka :is(input, select, textarea, button, a):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

#zayavka .lead-field [aria-invalid="true"] {
  border-color: #9c3025;
}

#zayavka #lead-contact-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

#zayavka #lead-contact-hint strong {
  color: var(--ink);
}

#zayavka .lead-extra summary {
  padding-block: 0.75rem;
  cursor: pointer;
  color: var(--blue);
  font-size: 0.875rem;
}

#zayavka .lead-extra-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.65rem 0.75rem;
  padding-bottom: 0.5rem;
}

#zayavka .lead-consent {
  text-align: start;
}

#zayavka .lead-form-alert {
  border: 1px solid #9c3025;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #84281f;
}

#zayavka .lead-form-alert :is(p, ul) {
  margin: 0;
}

#zayavka.home-estimate {
  width: min(100%, 440px);
  margin-block-start: 1rem;
  padding: clamp(14px, 2vw, 24px);
  border: 1px solid #e0dfd6;
  background: #f8f7f2;
  color: #242923;
  box-shadow: 0 12px 28px #10151038;
  color-scheme: light;
}

.premiere .reel #zayavka.home-estimate h2,
#zayavka.home-estimate h2 {
  color: #242923;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.05;
  letter-spacing: -.035em;
  margin: 0;
}

#zayavka.home-estimate .offer-form {
  grid-template-columns: minmax(0, 1fr);
  margin-top: .75rem;
}

.home-estimate-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

.home-estimate-fields > :not(.lead-contact-field) { grid-column: 1 / -1; }
.home-estimate-fields .estimate-send { min-height: 44px; }
.home-estimate-fields select:disabled { opacity: .7; }

.home-estimate-progress {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: #4a514b;
  font-size: .79rem;
}

.home-estimate-progress progress {
  appearance: none;
  flex: 1;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: #dce1ea;
  overflow: hidden;
  accent-color: #244bc9;
}

.home-estimate-progress progress::-webkit-progress-bar { background: #dce1ea; }
.home-estimate-progress progress::-webkit-progress-value { background: #244bc9; }
.home-estimate-progress progress::-moz-progress-bar { background: #244bc9; }

.home-estimate-back {
  min-height: 44px;
  background: transparent;
  border: 0;
  color: #235478;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.home-estimate > .estimate-messengers { margin-top: .75rem; }
.home-estimate + .actions .btn.primary { display: none; }

.take-main .opening-action:has(.home-estimate) {
  align-self: center;
  margin-block-end: 0;
}

@media (min-width: 901px) {
  .take-main .opening-action:has(.home-estimate) {
    align-self: start;
    z-index: 1;
  }

  .take-main .opening-title .hero-offer {
    margin: 1rem 0 0;
    font: inherit;
    font-size: clamp(24px, 2.3vw, 38px);
    letter-spacing: -.035em;
    color: var(--ivory);
  }

  .take-main .opening-title .offer-detail {
    margin: .4rem 0 0;
    max-width: 42ch;
    color: var(--ivory);
    font-size: clamp(1rem, 1.12vw, 1.2rem);
    line-height: 1.36;
  }

  .take-main .opening-title :is(.actions, .buyback-proof) { margin-top: .75rem; }
  .take-main .opening-title .actions .btn.primary { display: none; }
  .take-main .opening-title .buyback-proof {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ivory);
    font-size: .91rem;
  }

  #zayavka.home-estimate {
    --estimate-width: min(100%, 440px);
    width: var(--estimate-width);
    margin-inline-start: calc(min(100%, 440px) - var(--estimate-width));
  }

  #zayavka.home-estimate[data-step="2"] { --estimate-width: min(760px, 80vw); }
  #zayavka.home-estimate .offer-form { max-width: none; }

  .home-estimate-fields[data-estimate-step="2"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-estimate-fields[data-estimate-step="2"] > #lead-contact-hint {
    grid-column: 3 / -1;
    grid-row: 2;
    align-self: end;
  }

  .home-estimate-fields[data-estimate-step="2"] > :has(#lead-details) {
    grid-column: 1 / span 2;
    grid-row: 2 / span 2;
    grid-template-rows: auto 1fr;
  }

  .home-estimate-fields[data-estimate-step="2"] #lead-details {
    align-self: stretch;
  }

  .home-estimate-fields[data-estimate-step="2"] > :has(#lead-phone) { grid-column: 3; grid-row: 3; }
  .home-estimate-fields[data-estimate-step="2"] > :has(#lead-telegram) { grid-column: 4; grid-row: 3; }

  .home-estimate-fields[data-estimate-step="2"] > .estimate-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  @media (prefers-reduced-motion: no-preference) {
    #zayavka.home-estimate[data-step="2"] {
      animation: home-estimate-reveal 230ms ease-out;
    }

    @keyframes home-estimate-reveal {
      from { clip-path: inset(0 0 0 max(0px, calc(100% - 440px)) round 12px); }
      to { clip-path: inset(0 round 12px); }
    }
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .take-main .cine-copy:has(.home-estimate) { gap: clamp(14px, 3vh, 26px); }
  .take-main .opening-action:has(.home-estimate) { align-self: stretch; }
}

@media (max-width: 520px) and (max-height: 740px) {
  .take-main .take:has(.home-estimate) { padding-block-start: calc(var(--mast) + 10px); }
  .take-main .cine-copy:has(.home-estimate) { gap: 12px; }
  .take-main .cine-copy:has(.home-estimate) .opening-title { margin-block-start: 0; }
  .take-main .cine-copy:has(.home-estimate) .opening-title h1 { font-size: clamp(34px, 10.1vw, 48px); }
  .opening-action:has(.home-estimate) .offer-detail { margin-top: 4px; }
  #zayavka.home-estimate { margin-block-start: .75rem; }
  #zayavka .home-estimate-fields[data-estimate-step="1"] > .lead-field { grid-column: auto; }
  #zayavka.home-estimate [data-estimate-step="1"] select { padding-inline: .5rem; }
}

@media (max-width: 359px) and (max-height: 620px) {
  .opening-action:has(.home-estimate) { display: flex; flex-direction: column; }
  .opening-action:has(.home-estimate) .offer-detail { order: 1; margin-block-start: .65rem; }
  .opening-action:has(.home-estimate) :is(.actions, .buyback-proof) { order: 2; }
}

