/* Modal UX — desktop center + mobile bottom sheet */
:root {
  --sc-m-accent: #20A063;
  --sc-m-primary: #277A58;
  --sc-m-text: #111827;
  --sc-m-muted: #6B7280;
  --sc-m-border: #E5E7EB;
  --sc-m-error: #EF4444;
  --sc-m-ph: #9CA3AF;
}

body.sc-modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* Overlay */
.fly {
  pointer-events: none;
}
.fly.active {
  pointer-events: auto;
  z-index: 10050 !important;
}
.fly .overlay {
  background: rgba(17, 24, 39, 0.6) !important;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .2s ease-out;
}
.fly.active .overlay {
  opacity: 1;
}

/* Desktop modal card */
.fly .block_form {
  width: calc(100% - 32px);
  max-width: 480px !important;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px 24px 24px !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 48px rgba(17, 24, 39, 0.18);
  margin-top: 0 !important;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 12px)) scale(0.92) !important;
  transition:
    opacity .25s cubic-bezier(0.16, 1, 0.3, 1),
    transform .25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.fly.active .block_form {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) !important;
}

.fly .block_form .sc-modal-grabber {
  display: none;
}

.fly .block_form .close {
  top: 12px !important;
  right: 12px !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  z-index: 3;
  transition: transform .2s ease, background .2s ease;
}
.fly .block_form .close:hover {
  opacity: 1 !important;
  background: rgba(17, 24, 39, 0.06);
  transform: rotate(90deg);
}
.fly .block_form .close i {
  line-height: 1 !important;
  font-size: 18px;
  color: var(--sc-m-muted);
}

.fly .header {
  margin: 0 28px 18px 0 !important;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 20px !important;
  font-weight: 800 !important;
  color: var(--sc-m-text);
  line-height: 1.25;
}

/* Fields */
.fly .feedback_form_param9,
.fly .fancy-form.bottom-21 {
  margin-bottom: 12px;
}
.fly .form-control,
.fly input.tel,
.fly input[type="tel"],
.fly input[type="text"],
.fly input[type="email"],
.fly textarea.form-control {
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--sc-m-border) !important;
  border-radius: 10px !important;
  background: #fff;
  font-family: "Manrope", system-ui, sans-serif !important;
  font-size: 15px !important;
  color: var(--sc-m-text) !important;
  line-height: 1.3;
  transition: border-color .2s ease, box-shadow .2s ease;
  outline: none;
}
.fly textarea.form-control {
  min-height: 110px;
  resize: vertical;
}
.fly .form-control::placeholder,
.fly input::placeholder,
.fly textarea::placeholder {
  color: var(--sc-m-ph);
}
.fly .form-control:focus,
.fly input.tel:focus,
.fly input[type="tel"]:focus,
.fly input[type="text"]:focus,
.fly input[type="email"]:focus,
.fly textarea.form-control:focus {
  border: 1.5px solid var(--sc-m-accent) !important;
  box-shadow: 0 0 0 4px rgba(32, 160, 99, 0.12);
}
.fly .sc-field {
  position: relative;
}
.fly .sc-field.is-valid .form-control,
.fly .sc-field.is-valid input.tel,
.fly .sc-field.is-valid input[type="tel"] {
  border-color: var(--sc-m-accent) !important;
  padding-right: 42px;
}
.fly .sc-field.is-invalid .form-control,
.fly .sc-field.is-invalid input.tel,
.fly .sc-field.is-invalid input[type="tel"],
.fly .sc-field.is-invalid textarea {
  border: 1.5px solid var(--sc-m-error) !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}
.fly .sc-field__check {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  color: var(--sc-m-accent);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.fly .sc-field.is-valid .sc-field__check { opacity: 1; }
.fly .sc-field__error {
  display: none;
  margin: 6px 0 0;
  color: var(--sc-m-error);
  font-size: 12px;
  line-height: 1.35;
  animation: scModalSlideDown .15s ease;
}
.fly .sc-field.is-invalid .sc-field__error { display: block; }
.fly .form-check.checkbox,
.fly .form-check {
  position: relative;
  margin: 14px 0 4px;
  font-size: 13px !important;
  line-height: 1.45;
}
.fly .custom-checkbox + label,
.fly .form-check-label,
.fly label.form-check-label {
  display: inline-flex !important;
  align-items: flex-start !important;
  gap: 0;
  width: 100%;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  color: var(--sc-m-muted) !important;
  user-select: none;
}
.fly .custom-checkbox + label::before {
  margin-top: 0.2em;
  margin-right: 0.55em;
  flex-shrink: 0;
}
.fly .form-check-label a {
  color: var(--sc-m-primary) !important;
  text-decoration: underline !important;
}
.fly .form-check.checkbox.is-invalid {
  outline: 1.5px solid var(--sc-m-error);
  outline-offset: 4px;
  border-radius: 8px;
}
.fly .sc-check-error {
  display: none;
  margin: 6px 0 0;
  color: var(--sc-m-error);
  font-size: 12px;
  line-height: 1.4;
}
.fly .form-check.checkbox.is-invalid + .sc-check-error,
.fly .form-check.checkbox.is-invalid .sc-check-error {
  display: block;
}

@keyframes scModalSlideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scModalShake {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  20% { transform: translate(calc(-50% - 8px), -50%) scale(1); }
  40% { transform: translate(calc(-50% + 8px), -50%) scale(1); }
  60% { transform: translate(calc(-50% - 6px), -50%) scale(1); }
  80% { transform: translate(calc(-50% + 6px), -50%) scale(1); }
}
@keyframes scModalShakeSheet {
  0%, 100% { transform: translateY(0); }
  20% { transform: translateY(0) translateX(-8px); }
  40% { transform: translateY(0) translateX(8px); }
  60% { transform: translateY(0) translateX(-6px); }
  80% { transform: translateY(0) translateX(6px); }
}

.fly .block_form.is-shaking {
  animation: scModalShake .3s ease;
}
.fly .btn_box { margin-top: 16px !important; }
.fly .btn_box .btn,
.fly .btn_box button[type="submit"] {
  position: relative;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  background: var(--sc-m-accent) !important;
  color: #fff !important;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.fly .btn_box .btn:hover,
.fly .btn_box button[type="submit"]:hover {
  background: #198250 !important;
}
.fly .btn_box .btn.is-loading,
.fly .btn_box button[type="submit"].is-loading {
  color: transparent !important;
  pointer-events: none;
  opacity: .9;
}
.fly .btn_box .btn.is-loading::after,
.fly .btn_box button[type="submit"].is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: scModalSpin .7s linear infinite;
}
@keyframes scModalSpin {
  to { transform: rotate(360deg); }
}

/* Success screen */
.fly .sc-modal-success {
  display: none;
  text-align: center;
  padding: 12px 8px 4px;
}
.fly.is-success .feedback_form,
.fly.is-success .header,
.fly.is-success .ec-form,
.fly.is-success form.ajax_form {
  display: none !important;
}
.fly.is-success .sc-modal-success { display: block; }
.fly .sc-modal-success__icon {
  width: 72px;
  height: 72px;
  margin: 8px auto 18px;
  border-radius: 50%;
  background: rgba(32, 160, 99, 0.12);
  color: var(--sc-m-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scModalPulse 1.6s ease-in-out infinite;
}
.fly .sc-modal-success__icon svg {
  width: 34px;
  height: 34px;
}
@keyframes scModalPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(32,160,99,.25); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 12px rgba(32,160,99,0); }
}
.fly .sc-modal-success__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--sc-m-text);
}
.fly .sc-modal-success__text {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--sc-m-muted);
}
.fly .sc-modal-success__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 160px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: var(--sc-m-accent);
  color: #fff !important;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

/* Mobile bottom sheet — kill legacy left:50% + translateX(-50%) overflow */
@media (max-width: 767px) {
  .fly {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
  }
  .fly .block_form,
  .fly#sc-order .block_form,
  .fly .block_form.sc-order-modal {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
    max-height: min(90vh, 90dvh) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom)) !important;
    -webkit-transform: translateY(100%) !important;
    -moz-transform: translateY(100%) !important;
    -ms-transform: translateY(100%) !important;
    -o-transform: translateY(100%) !important;
    transform: translateY(100%) !important;
    opacity: 1 !important;
    transition: transform .3s cubic-bezier(0.32, 0.72, 0, 1) !important;
  }
  .fly.active .block_form,
  .fly.active#sc-order .block_form,
  .fly.active .block_form.sc-order-modal {
    -webkit-transform: translateY(0) !important;
    -moz-transform: translateY(0) !important;
    -ms-transform: translateY(0) !important;
    -o-transform: translateY(0) !important;
    transform: translateY(0) !important;
  }
  .fly .block_form.is-shaking {
    animation: scModalShakeSheet .3s ease;
  }
  .fly .block_form .sc-modal-grabber {
    display: block;
    width: 36px;
    height: 4px;
    margin: 2px auto 14px;
    border-radius: 2px;
    background: #E5E7EB;
  }
  .fly .block_form .close {
    top: 8px !important;
    right: 8px !important;
  }
  .fly .header {
    margin-top: 4px !important;
    font-size: 18px !important;
    max-width: calc(100% - 48px);
    word-break: break-word;
  }
  .fly .form-control,
  .fly input.tel,
  .fly input[type="tel"],
  .fly input[type="text"],
  .fly textarea.form-control {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Also style phone fields outside modals lightly when using sc-phone */
input.tel.sc-phone-ready,
input[type="tel"].sc-phone-ready {
  font-variant-numeric: tabular-nums;
}
