:root {
  --cf-orange: #f58220;
  --cf-orange-h: #e0700f;
  --cf-dark: #333333;
  --cf-grey: #8a8a8a;
  --cf-bg: #f2f2f2;
  --cf-field: #ffffff;
  --cf-border: #e3e3e3;
  --cf-width: 1440px;
}

.cform,
.cform * {
  box-sizing: border-box;
}

/* ---- секция ---- */
.cform {
  position: relative;
  color: var(--cf-dark);
  width: var(--cf-width);
  max-width: 100%;
  margin: 40px auto;
  background-color: var(--cf-bg);
  background-image: url(../img/form.jpg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.cform__inner {
  padding: 48px 56px 56px;
}

/* ---- заголовки ---- */
.cform__title {
  margin: 0 0 14px;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #4a4a4a;
}

.cform__lead {
  margin: 0 0 30px;
  max-width: 820px;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--cf-dark);
}

/* ---- поля ---- */
.cform__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 1340px;
}

.cform__input {
  height: 66px;
  width: 100%;
  padding: 0 26px;
  font: inherit;
  font-size: 16px;
  color: var(--cf-dark);
  background: var(--cf-field);
  border: 1px solid var(--cf-border);
  border-radius: 0;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.cform__input::placeholder {
  color: var(--cf-grey);
}

.cform__input:focus {
  border-color: var(--cf-orange);
  box-shadow: inset 0 0 0 1px var(--cf-orange);
}

.cform__input--wide {
  grid-column: span 2;
}

/* ловушка для ботов */
.cform__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.orange-btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.cform__bottom .orange-btn {
  flex: 0 0 auto;
}
/* ---- низ формы ---- */
.cform__bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  margin-top: 32px;
}

.cform__agreements {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---- чекбоксы ---- */
.cform__check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.cform__check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cform__box {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1px solid var(--cf-orange);
  background: #fff;
  position: relative;
}

.cform__box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid var(--cf-orange);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s;
}

.cform__check input:checked + .cform__box::after {
  transform: rotate(45deg) scale(1);
}
.cform__check input:focus-visible + .cform__box {
  outline: 2px solid var(--cf-orange);
  outline-offset: 2px;
}

.cform__label {
  font-size: 13px;
  line-height: 1.45;
  color: var(--cf-dark);
}

.cform__label a {
  color: inherit;
  text-decoration: underline;
}
.cform__label a:hover {
  color: var(--cf-orange);
}

/* ---- кнопка ---- */
.cform__submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: 356px;
  height: 52px;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  color: #1a1a1a;
  background: var(--cf-orange);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s;
}

.cform__submit:hover {
  background: var(--cf-orange-h);
}
.cform__submit:disabled {
  opacity: 0.6;
  cursor: default;
}
.cform__submit svg {
  display: block;
}

.cform__note {
  margin: 44px 0 0;
  font-size: 18px;
  color: #6e6e6e;
  font-weight: 600;
}

/* ---- попап поверх формы ---- */
.cform__popup {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(242, 242, 242, 0.94);
  animation: cfFade 0.2s ease-out;
}

.cform__popup[hidden] {
  display: none;
}

.cform__popup-box {
  text-align: center;
  padding: 48px 64px;
  background: #fff;
  border-top: 4px solid var(--cf-orange);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
}

.cform__popup-text {
  margin: 0 0 26px;
  font-size: 26px;
  font-weight: 500;
  color: var(--cf-dark);
}

.cform__popup-close {
  min-width: 200px;
  height: 48px;
  font: inherit;
  font-size: 16px;
  color: #1a1a1a;
  background: var(--cf-orange);
  border: 0;
  cursor: pointer;
  transition: background 0.2s;
}

.cform__popup-close:hover {
  background: var(--cf-orange-h);
}

@keyframes cfFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cform__popup {
    animation: none;
  }
  .cform__box::after {
    transition: none;
  }
}

/* ---- адаптив ----
   1920 → секция 1440px по центру
   1440 → ширина 100%, отступы 40px
    960 → поля в один столбец
    680 → отступы 20px
    480 → отступы 10px                       */

@media (max-width: 1440px) {
  .cform {
    width: 100%;
  }
  .cform__inner {
    padding: 48px 40px 48px;
  }
}

@media (max-width: 960px) {
  .cform__bottom .orange-btn {
    width: 100%;
    max-width: 356px;
  }

  .cform {
    background-position: right -180px center;
  }
  .cform__grid {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .cform__input--wide {
    grid-column: span 1;
  }
  .cform__bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }
  .cform__agreements {
    max-width: none;
  }
  .cform__submit {
    width: 100%;
    max-width: 356px;
  }
  .cform__note {
    margin-top: 32px;
  }
  section.cform {
    background-image: none;
    /* background-color: #dddddd; */
  }
}

@media (max-width: 680px) {
  .cform__bottom .orange-btn {
    max-width: none;
  }
  .cform {
    background-image: none;
  }
  .cform__inner {
    padding: 36px 20px 36px;
  }
  .cform__title {
    font-size: 26px;
  }
  .cform__lead {
    font-size: 17px;
  }
  .cform__lead br {
    display: none;
  }
  .cform__submit {
    max-width: none;
  }
  .cform__popup-box {
    padding: 36px 28px;
    margin: 0 20px;
  }
  .cform__popup-text {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .cform__inner {
    padding: 28px 10px 10px;
  }
  .cform__title {
    font-size: 22px;
  }
  .cform__lead {
    font-size: 16px;
    margin-bottom: 22px;
  }
  .cform__input {
    height: 56px;
    padding: 0 16px;
    font-size: 15px;
  }
  .cform__popup-box {
    padding: 28px 18px;
    margin: 0 10px;
  }
  .cform__popup-text {
    font-size: 19px;
  }
  .cform__popup-close {
    min-width: 0;
    width: 100%;
  }
  p.cform__note {
    text-align: center;
    padding: 0 20px;
    font-size: 16px;
  }
  section.cform {
    margin: 20px auto;
  }
  p.cform__lead {
    text-align: center;
  }
}
