.cw-form-modal[hidden] { display: none !important; }
.cw-form-modal,
.cw-form-inline,
.cw-form-trigger,
.cw-form-shell,
.cw-form-shell * { box-sizing: border-box; }

.cw-form-trigger,
.cw-form-trigger:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 16px 24px;
  border-radius: 18px;
  border: 0 !important;
  background: linear-gradient(135deg, #ff8a3d 0%, #ff5f6d 100%) !important;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 18px 38px rgba(255, 95, 109, 0.22);
  transition: box-shadow .25s ease, filter .25s ease;
  cursor: pointer;
}
.cw-form-trigger:hover,
.cw-form-trigger:focus,
.cw-form-trigger:active {
  transform: none !important;
  filter: brightness(1.02);
  box-shadow: 0 18px 38px rgba(255, 95, 109, 0.28);
  color: #ffffff !important;
}

.cw-form-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  padding: 24px;
}
.cw-form-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.56);
  backdrop-filter: blur(4px);
}
.cw-form-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(100%, 760px);
  margin: 0 auto;
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 34px;
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 209, 102, 0.16), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(255, 126, 95, 0.12), transparent 22%),
    linear-gradient(180deg, #fff9f2 0%, #ffffff 100%);
  box-shadow: 0 40px 100px rgba(17, 24, 39, 0.24);
}
.cw-form-modal__close,
.cw-form-modal__close:hover,
.cw-form-modal__close:focus,
.cw-form-modal__close:active {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  display: inline-block !important;
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
  color: #ff7a2f !important;
  -webkit-text-fill-color: #ff7a2f !important;
  font-size: 32px !important;
  font-weight: 400 !important;
  line-height: 32px !important;
  cursor: pointer !important;
  transform: none !important;
  transition: none !important;
  filter: none !important;
}


.cw-form-inline {
  position: relative;
  border-radius: 34px;
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 209, 102, 0.16), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(255, 126, 95, 0.12), transparent 22%),
    linear-gradient(180deg, #fff9f2 0%, #ffffff 100%);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.08);
}

.cw-form-shell { padding: 36px 34px 34px; }
.cw-form-shell__head { margin-bottom: 24px; }
.cw-form-shell__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  margin: 0 0 18px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #ff7a2f;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(255, 122, 47, 0.12);
}
.cw-form-shell__title {
  margin: 0 0 10px;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.06;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: #1d1d1f;
}
.cw-form-shell__subtitle {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: #5a6270;
}

.cw-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}
.cw-field { min-width: 0; }
.cw-field--full { grid-column: 1 / -1; }
.cw-field__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  color: #1d1d1f;
}

/* hard visual override for inputs/selects */
.cw-form .cw-field__input,
.cw-form input[type="text"].cw-field__input,
.cw-form input[type="tel"].cw-field__input,
.cw-form select.cw-field__input,
.cw-form textarea.cw-field__input,
.cw-form .cw-field__select {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 58px !important;
  height: 58px !important;
  margin: 0 !important;
  padding: 0 18px !important;
  border: 1px solid #d9dee7 !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85) !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  font-weight: 500 !important;
  color: #1d1d1f !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease !important;
}

.cw-form .cw-field__input::placeholder,
.cw-form input[type="text"].cw-field__input::placeholder,
.cw-form input[type="tel"].cw-field__input::placeholder,
.cw-form textarea.cw-field__input::placeholder {
  color: #8b95a3 !important;
  opacity: 1 !important;
}

.cw-form .cw-field__input:hover,
.cw-form .cw-field__input:focus,
.cw-form input[type="text"].cw-field__input:hover,
.cw-form input[type="text"].cw-field__input:focus,
.cw-form input[type="tel"].cw-field__input:hover,
.cw-form input[type="tel"].cw-field__input:focus,
.cw-form select.cw-field__input:hover,
.cw-form select.cw-field__input:focus,
.cw-form .cw-field__select:hover,
.cw-form .cw-field__select:focus {
  border-color: rgba(255, 122, 47, 0.45) !important;
  box-shadow: 0 0 0 4px rgba(255, 122, 47, 0.10) !important;
}

.cw-form select.cw-field__input,
.cw-form .cw-field__select {
  cursor: pointer;
  padding-right: 48px !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #ff7a2f 50%),
    linear-gradient(135deg, #ff7a2f 50%, transparent 50%) !important;
  background-position:
    calc(100% - 22px) 24px,
    calc(100% - 16px) 24px !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
}

.cw-form__agreement { margin: 0 0 18px; }
.cw-checkbox {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
}
.cw-checkbox__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cw-checkbox__box {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 8px !important;
  background: #ffffff !important;
  border: 1px solid rgba(17, 24, 39, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.cw-checkbox__input:checked + .cw-checkbox__box {
  background: linear-gradient(135deg, #ff8a3d 0%, #ff5f6d 100%) !important;
  border-color: transparent !important;
}
.cw-checkbox__input:checked + .cw-checkbox__box::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.cw-checkbox__text {
  font-size: 14px;
  line-height: 1.5;
  color: #5a6270;
}

.cw-form__bottom {
  display: flex;
  gap: 14px;
  align-items: center;
}

.cw-form__submit,
.cw-form__submit:hover,
.cw-form__submit:focus,
.cw-form__submit:active,
.cw-form button.cw-form__submit,
.cw-form button.cw-form__submit:hover,
.cw-form button.cw-form__submit:focus,
.cw-form button.cw-form__submit:active {
  position: relative;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-height: 58px !important;
  padding: 16px 24px !important;
  border: 0 !important;
  outline: none !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, #ff8a3d 0%, #ff5f6d 100%) !important;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 16px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: 0 18px 38px rgba(255, 95, 109, 0.22) !important;
  transition: box-shadow .25s ease, filter .25s ease, opacity .25s ease !important;
  transform: none !important;
}
.cw-form__submit::before,
.cw-form__submit::after { display: none !important; content: none !important; }
.cw-form__submit:hover,
.cw-form__submit:focus,
.cw-form__submit:active,
.cw-form button.cw-form__submit:hover,
.cw-form button.cw-form__submit:focus,
.cw-form button.cw-form__submit:active {
  transform: none !important;
  top: auto !important;
  filter: brightness(1.03) !important;
  box-shadow: 0 18px 38px rgba(255, 95, 109, 0.30) !important;
}
.cw-form__submit.is-loading {
  opacity: .78 !important;
  pointer-events: none !important;
}

.cw-form__status {
  margin-top: 16px;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
}
.cw-form__status.is-success { color: #117a4a; }
.cw-form__status.is-error { color: #c0362c; }
.cw-form__spamtrap {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
body.cw-modal-open { overflow: hidden; }

@media (max-width: 767px) {
  .cw-form-modal { padding: 16px; }
  .cw-form-modal__dialog,
  .cw-form-inline { border-radius: 26px; }
  .cw-form-shell { padding: 26px 20px 22px; }
  .cw-form-shell__head { margin-bottom: 20px; }
  .cw-form__grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .cw-field--full { grid-column: auto; }
  .cw-form__bottom { display: block; }
  .cw-form__submit,
  .cw-form-trigger { width: 100% !important; }
  .cw-form-modal__close {
    top: 8px;
    right: 10px;
    font-size: 32px !important;
    line-height: 32px !important;
  }
  .cw-form-shell__title { font-size: 28px; }
  .cw-form-shell__subtitle {
    font-size: 15px;
    line-height: 1.6;
  }
  .cw-form .cw-field__input,
  .cw-form input[type="text"].cw-field__input,
  .cw-form input[type="tel"].cw-field__input,
  .cw-form select.cw-field__input,
  .cw-form .cw-field__select {
    min-height: 54px !important;
    height: 54px !important;
    border-radius: 16px !important;
    font-size: 16px !important;
    padding: 0 16px !important;
  }
  .cw-form select.cw-field__input,
  .cw-form .cw-field__select {
    padding-right: 42px !important;
    background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px !important;
  }
  .cw-form__submit,
  .cw-form button.cw-form__submit {
    min-height: 54px !important;
    padding: 14px 20px !important;
    border-radius: 16px !important;
    font-size: 15px !important;
  }
}
