/* ── Consultation Form Modal ── */

/* Backdrop */
.cf-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(17, 22, 25, 0.80);
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 20px 60px;
}
.cf-modal.is-open {
  display: flex;
}

/* Wrapper */
.cf-modal__wrapper {
  position: relative;
  background: #fff;
  border-radius: 44px;
  width: 100%;
  max-width: 1033px;
  padding: 56px 64px 60px;
  box-sizing: border-box;
  top: 20px;
}

/* Close button */
.cf-modal__close {
  position: absolute;
  top: -52px;
  right: 0;
  width: 42px;
  height: 42px;
  background: #edf3f8;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cf-modal__close:hover { background: #d4e5f2; }

/* Header */
.cf-modal__title {
  font-size: 48px;
  font-weight: 700;
  color: #073248;
  letter-spacing: -2.21px;
  line-height: 1.1;
  text-align: center;
  margin: 0 0 20px;
}
.cf-modal__subtitle {
  font-size: 18px;
  font-weight: 500;
  color: #38596a;
  text-align: center;
  line-height: 30px;
  letter-spacing: -1.03px;
  margin: 0 auto 48px;
  max-width: 640px;
}

/* Success state */
.cf-modal__success {
  text-align: center;
  padding: 40px 0;
}

/* ── Two-column form grid ── */
.cf-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 60px;
}
.cf-form__col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Field wrapper ── */
.cf-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

/* ── Labels ── */
.cf-label {
  font-size: 18px;
  font-weight: 700;
  color: #073248;
  letter-spacing: -0.74px;
  margin-bottom: 8px;
  display: block;
}

/* ── Inputs & selects ── */
.cf-input {
  background: rgba(225, 236, 245, 0.80);
  border-radius: 12px;
  border: none;
  outline: none;
  height: 52px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 500;
  color: #073248;
  letter-spacing: -0.29px;
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}
.cf-input::placeholder {
  opacity: 0.5;
}
.cf-input:focus {
  outline: 2px solid #0083da;
}

/* Select arrow */
.cf-select {
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='9' viewBox='0 0 16 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L8 8L15 1' stroke='%23073248' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
  padding-right: 40px;
  cursor: pointer;
}
.cf-select option[value=""][disabled] { color: rgba(7,50,72,0.5); }

/* Date input wrapper */
.cf-input--date {
  position: relative;
  display: flex;
  align-items: center;
}
.cf-input--date input[type="date"] {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  font-size: 16px;
  font-weight: 500;
  color: #073248;
  letter-spacing: -0.29px;
  opacity: 0.5;
  padding: 0;
}
.cf-input--date input[type="date"]:not(:placeholder-shown),
.cf-input--date input[type="date"]::-webkit-datetime-edit-text,
.cf-input--date input[type="date"]::-webkit-datetime-edit-month-field,
.cf-input--date input[type="date"]::-webkit-datetime-edit-day-field,
.cf-input--date input[type="date"]::-webkit-datetime-edit-year-field {
  opacity: 1;
}
.cf-input__icon {
  position: absolute;
  right: 14px;
  pointer-events: none;
  flex-shrink: 0;
}

/* Hint text */
.cf-hint {
  font-size: 12px;
  font-weight: 500;
  color: #073248;
  opacity: 0.70;
  letter-spacing: -0.4px;
  margin: 4px 0 0;
  line-height: 20px;
}
.cf-hint--top { margin: 0 0 8px; font-size: 13px; }

/* Validation error */
.cf-error {
  font-size: 12px;
  color: #e54f47;
  margin-top: 4px;
  display: block;
}

/* ── Checkboxes ── */
.cf-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cf-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}
.cf-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.cf-checkbox__box {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 6px;
  background: #e1ecf5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  margin-top: 2px;
}
.cf-checkbox input[type="checkbox"]:checked + .cf-checkbox__box {
  background: #0083da;
}
.cf-checkbox input[type="checkbox"]:checked + .cf-checkbox__box::after {
  content: "";
  display: block;
  width: 12px;
  height: 7px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.cf-checkbox__text {
  font-size: 16px;
  font-weight: 500;
  color: #073248;
  letter-spacing: -0.29px;
  line-height: 1.5;
}
.cf-checkbox--other .cf-checkbox__text { opacity: 0.7; }

/* "Другое" text input */
.cf-checkbox-other {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cf-input--other {
  height: 46px;
  padding: 0 14px;
  margin-left: 38px;
  width: calc(100% - 38px);
}
.cf-input--other:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Consent checkboxes ── */
.cf-consents {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 40px;
}
.cf-checkbox--consent .cf-checkbox__text {
  font-size: 15px;
  font-weight: 300;
  line-height: 20px;
  letter-spacing: -0.74px;
}

/* ── Submit button ── */
.cf-form__footer {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}
.cf-submit {
  background: #e54f47;
  border: 2.9px solid #e54f47;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.74px;
  line-height: 27px;
  padding: 12px 60px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-width: 260px;
}
.cf-submit:hover {
  background: #c93c35;
  border-color: #c93c35;
}

/* ── Mobile ── */
@media (max-width: 767px) {
  .cf-modal {
    padding: 0;
    align-items: flex-start;
  }
  .cf-modal__wrapper {
    border-radius: 0;
    padding: 72px 16px 40px;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .cf-modal__close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10;
  }
  .cf-modal__title {
    font-size: 36px;
    letter-spacing: -1.5px;
  }
  .cf-modal__subtitle {
    font-size: 16px;
    margin-bottom: 32px;
  }
  .cf-form__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .cf-submit {
    width: 100%;
    padding: 16px;
  }
}
