:root {
  --kg-focus: #0b63ce;
  --kg-danger: #9b351c;
  --kg-success: #1f6b3d;
}

html {
  scroll-padding-top: 78px;
}

#estimate,
[id] {
  scroll-margin-top: 78px;
}

:focus-visible {
  outline: 3px solid var(--kg-focus);
  outline-offset: 3px;
}

.kg-hero--estimate {
  min-height: 560px;
}

.kg-hero--estimate .kg-hero__grid {
  display: flex;
  min-height: 560px;
  align-items: center;
}

.kg-hero__human-note {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .82);
  font-size: 14px;
  font-weight: 700;
}

.kg-header__estimate {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--kg-yellow);
  color: #21190a;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.kg-icon-link--phone {
  background: var(--kg-green);
  color: #fff;
  font-size: 18px;
}

.kg-sticky--estimate {
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: 1.65fr 1fr;
}

.kg-footer {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.kg-sticky--estimate .kg-sticky__lead {
  background: var(--kg-yellow);
  color: #21190a;
}

.kg-sticky--estimate .kg-sticky__call {
  background: #fff;
  color: var(--kg-green-dark);
}

.kg-estimate-section {
  padding: 48px 0;
  background: #eef2ed;
}

.kg-estimate-section__grid {
  display: grid;
  gap: 24px;
}

.kg-estimate-section__intro {
  align-self: start;
}

.kg-estimate-section__intro h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.02;
}

.kg-estimate-section__intro > p:not(.kg-kicker) {
  max-width: 600px;
  margin: 14px 0 0;
  color: var(--kg-muted);
  font-size: 18px;
}

.kg-estimate-section .kg-kicker,
.kg-estimate-success .kg-kicker {
  color: var(--kg-green-dark);
}

.kg-estimate-points {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.kg-estimate-points li {
  position: relative;
  padding-left: 28px;
  color: var(--kg-muted);
}

.kg-estimate-points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--kg-green);
  font-weight: 900;
}

.kg-estimate-form {
  position: relative;
  padding: 18px;
  border: 1px solid var(--kg-line);
  border-radius: 16px;
  background: var(--kg-panel);
  box-shadow: var(--kg-shadow);
}

.kg-estimate-form input.kg-form__hp[type="text"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.kg-progress {
  margin-bottom: 22px;
}

.kg-progress p {
  margin: 0 0 8px;
  color: var(--kg-muted);
  font-size: 14px;
  font-weight: 800;
}

.kg-progress__track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebe6;
}

.kg-progress__track span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: var(--kg-yellow);
  transition: width .2s ease;
}

.kg-form-step {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.kg-form-step[hidden],
.kg-estimate-success[hidden],
.kg-conditional[hidden],
.kg-building-fields[hidden],
[data-kg-custom-date][hidden] {
  display: none !important;
}

.kg-form-step legend {
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 900;
  line-height: 1.08;
}

.kg-form-step__hint {
  margin: 10px 0 18px;
  color: var(--kg-muted);
}

.kg-form-error-summary {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #e8b3a8;
  border-radius: 10px;
  background: #fff4f1;
  color: var(--kg-danger);
  font-weight: 700;
}

.kg-connection-status {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #e9f5ed;
  color: var(--kg-success);
  font-weight: 700;
}

.kg-connection-status.is-error {
  background: #fff4f1;
  color: var(--kg-danger);
}

.kg-uploader {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 22px;
  border: 2px dashed #aebaae;
  border-radius: 14px;
  background: #f9faf7;
  text-align: center;
}

.kg-uploader__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.kg-uploader p {
  margin: 9px 0 0;
  color: var(--kg-muted);
  font-size: 13px;
}

.kg-uploader [data-kg-photo-count] {
  color: var(--kg-ink);
  font-weight: 900;
}

.kg-photo-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.kg-photo-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--kg-line);
  border-radius: 12px;
  background: #fff;
}

.kg-photo-card__preview {
  display: grid;
  place-items: center;
  width: 72px;
  height: 60px;
  overflow: hidden;
  border-radius: 8px;
  background: #e8ece8;
}

.kg-photo-card__preview.is-file::after {
  content: "ФАЙЛ";
  color: var(--kg-muted);
  font-size: 12px;
  font-weight: 900;
}

.kg-photo-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kg-photo-card__details {
  min-width: 0;
}

.kg-photo-card__details strong,
.kg-photo-card__details span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-photo-card__details span {
  margin-top: 3px;
  color: var(--kg-muted);
  font-size: 13px;
}

.kg-photo-card__remove,
.kg-inline-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--kg-danger);
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.kg-form-privacy-note,
.kg-form-fallback {
  margin: 12px 0 0;
  color: var(--kg-muted);
  font-size: 14px;
}

.kg-form-fallback a {
  color: var(--kg-green-dark);
  font-weight: 800;
}

.kg-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.kg-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.kg-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.kg-choice span {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 10px 13px;
  border: 1px solid #cdd6cd;
  border-radius: 10px;
  background: #fff;
  font-weight: 750;
}

.kg-choice input:checked + span {
  border-color: var(--kg-green);
  background: #e9f5ed;
  box-shadow: inset 0 0 0 1px var(--kg-green);
}

.kg-choice input:focus-visible + span {
  outline: 3px solid var(--kg-focus);
  outline-offset: 2px;
}

.kg-conditional,
.kg-field-group,
.kg-building-fields {
  margin-top: 22px;
}

.kg-field-label {
  margin: 0 0 10px;
  color: var(--kg-muted);
  font-size: 14px;
  font-weight: 800;
}

.kg-field-error {
  display: block;
  margin: 7px 0 0;
  color: var(--kg-danger) !important;
  font-size: 14px !important;
  font-weight: 700;
}

.kg-building-fields,
.kg-form-two-columns {
  display: grid;
  gap: 12px;
}

.kg-estimate-form .kg-form__row,
.kg-estimate-form .kg-form__agree {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.kg-estimate-form .kg-form__row > span {
  color: var(--kg-muted);
  font-size: 14px;
  font-weight: 800;
}

.kg-estimate-form .kg-form__row b {
  color: var(--kg-danger);
}

.kg-estimate-form input[type="text"],
.kg-estimate-form input[type="tel"],
.kg-estimate-form input[type="number"],
.kg-estimate-form input[type="date"],
.kg-estimate-form select,
.kg-estimate-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 11px 12px;
  border: 1px solid #c7d0c8;
  border-radius: 10px;
  background: #fff;
  color: var(--kg-ink);
  font-size: 16px;
}

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

.kg-estimate-form [aria-invalid="true"] {
  border-color: var(--kg-danger) !important;
}

.kg-estimate-form .kg-form__agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  color: var(--kg-muted);
}

.kg-estimate-form .kg-form__agree input {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin-top: 1px;
}

.kg-form-step__actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.kg-form-step:first-of-type .kg-form-step__actions {
  grid-template-columns: 1fr;
}

.kg-btn--quiet {
  border: 1px solid #cbd4cc;
  background: #fff;
  color: var(--kg-green-dark);
}

.kg-btn:disabled,
.kg-estimate-form button:disabled {
  opacity: .58;
  cursor: wait;
}

.kg-estimate-summary {
  margin-top: 18px;
  padding: 15px;
  border-radius: 12px;
  background: #f2f5f1;
}

.kg-estimate-summary h3 {
  margin: 0;
  font-size: 18px;
}

.kg-estimate-summary ul {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--kg-muted);
}

.kg-estimate-summary .kg-inline-button {
  color: var(--kg-green-dark);
}

.kg-estimate-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: #e9f5ed;
  color: var(--kg-success);
  font-weight: 700;
}

.kg-estimate-status.is-error {
  background: #fff4f1;
  color: var(--kg-danger);
}

.kg-estimate-success {
  padding: 8px 0;
}

.kg-estimate-success h2 {
  margin: 0;
  font-size: clamp(27px, 5vw, 38px);
  line-height: 1.06;
}

.kg-estimate-success > p:not(.kg-kicker),
.kg-estimate-success li {
  color: var(--kg-muted);
}

.kg-estimate-success ol {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  padding-left: 22px;
}

.kg-price-factors {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.kg-price-factor {
  padding: 18px;
  border: 1px solid var(--kg-line);
  border-radius: 14px;
  background: #fff;
}

.kg-price-factor h3 {
  margin: 0;
  font-size: 18px;
}

.kg-price-factor p {
  margin: 7px 0 0;
  color: var(--kg-muted);
}

.kg-hazard-note {
  margin-top: 20px;
  padding: 18px;
  border-left: 5px solid var(--kg-yellow);
  border-radius: 10px;
  background: #fff8e6;
}

.kg-hazard-note h3,
.kg-hazard-note p {
  margin: 0;
}

.kg-hazard-note p {
  margin-top: 7px;
  color: var(--kg-muted);
}

@media (min-width: 620px) {
  .kg-choice-grid,
  .kg-form-two-columns,
  .kg-building-fields,
  .kg-price-factors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kg-choice-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kg-photo-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 940px) {
  .kg-header--estimate .kg-icon-link--phone {
    display: none;
  }

  .kg-header--estimate .kg-phone,
  .kg-header__estimate {
    display: inline-flex;
  }

  .kg-hero--estimate,
  .kg-hero--estimate .kg-hero__grid {
    min-height: 620px;
  }

  .kg-hero--estimate .kg-hero__grid {
    display: flex;
  }

  .kg-hero--estimate .kg-hero__copy {
    max-width: 830px;
  }

  .kg-estimate-section {
    padding: 72px 0;
  }

  .kg-footer {
    padding-bottom: 36px;
  }

  .kg-estimate-section__grid {
    grid-template-columns: minmax(0, .8fr) minmax(560px, 1.2fr);
    gap: 56px;
  }

  .kg-estimate-section__intro {
    position: sticky;
    top: 92px;
  }

  .kg-estimate-form {
    padding: 26px;
  }

  .kg-price-factors {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
