.form_demo-container {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(40%, 560px);
  height: 100vh;
  background-color: transparent;
  color: white;
  z-index: 1000;
  transition:
    right 0.5s ease-in-out,
    opacity 0.5s ease-in-out;
  opacity: 0;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  padding: clamp(12px, 2vh, 20px) clamp(16px, 3vw, 40px);
  box-sizing: border-box;
}

.form_demo-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #2e3238;
  padding: clamp(18px, 2.5vw, 30px);
  gap: clamp(12px, 1.5vw, 15px);
  border-radius: 10px;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 20;
  overflow-y: auto;
}

.form_demo-wrapper div {
  width: 100%;
}

.form_demo-logo {
  margin: 0;
  position: relative;
  width: 100%;
  text-align: left;
}

.form_demo-logo a img {
  max-width: 140px;
  width: 100%;
  display: block;
}

.close_span {
  position: absolute;
  top: -15px;
  right: 0;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  z-index: 1001;
  font-size: 50px;
  line-height: 1;
}

.form_demo-title {
  text-align: left;
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.35;
  margin: 0;
}

body.overflow-hidden {
  overflow: hidden;
}

.form_demo-form {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vw, 15px);
  text-align: initial;
  margin-top: 5px;
  width: 100%;
}

.form_demo-group {
  position: relative;
}

.form_demo-group input {
  background-color: transparent;
  border: 1px solid #a4a6a9;
  color: white;
  border-radius: 10px;
  width: 100%;
  padding: clamp(10px, 1.2vw, 12px) 14px;
  font-size: clamp(14px, 1.2vw, 16px);
  box-sizing: border-box;
}

.form_demo-group span.icon-eye,
.form_demo-group span.icon-eye-confirm {
  position: absolute;
  right: 10px;
  top: 10px;
  cursor: pointer;
  font-size: 16px;
  color: #fff;
}

.form_demo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #dacc99;
  border: none;
  border-radius: 8px;
  padding: clamp(10px, 1.2vw, 12px) 16px;
  color: white;
  margin-top: 5px;
  font-size: clamp(14px, 1.2vw, 16px);
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.form_demo-btn p {
  margin: 0;
}

.form_demo-btn:hover {
  color: #2e3238;
}

.form_demo-btn:hover .demo-arrow {
  transform: translateX(2px);
}

.form_demo-btn:hover .demo-arrow path {
  stroke: #2e3238;
}

.form_demo-footer {
  text-align: left;
  font-size: clamp(12px, 1.1vw, 14px);
  line-height: 1.45;
  margin: 0;
}

.important {
  color: #dacc99;
}

.terms_modal {
  border: 3px solid #2e3238;
}

@media (max-width: 1200px) {
  .form_demo-container {
    width: 48%;
    padding: clamp(12px, 2vh, 16px) clamp(14px, 2.5vw, 28px);
  }
}

@media (max-width: 1000px) {
  .form_demo-container {
    width: 58%;
    padding: 12px clamp(12px, 2vw, 20px);
  }

  .form_demo-wrapper {
    padding: 20px;
    height: auto;
    min-height: 100%;
    margin: auto 0;
  }
}

@media (max-width: 900px) {
  .form_demo-container {
    width: 70%;
    padding: 12px 16px;
  }

  .form_demo-title {
    font-size: 18px;
  }

  .form_demo-logo a img {
    max-width: 120px;
  }

  .close_span {
    font-size: 40px;
    top: -10px;
  }
}

@media (max-width: 768px) {
  .form_demo-container {
    width: 85%;
  }

  .form_demo-wrapper {
    padding: 18px 16px;
    gap: 12px;
  }

  .form_demo-btn svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 600px) {
  .form_demo-container {
    width: 70%;
    padding: 10px 12px;
  }

  .form_demo-wrapper {
    padding: 16px 12px;
  }

  .form_demo-title {
    font-size: 16px;
    text-align: left;
  }

  .form_demo-logo a img {
    max-width: 110px;
  }

  .close_span {
    font-size: 36px;
    top: -6px;
    right: -2px;
  }

  .form_demo-footer {
    font-size: 12px;
    text-align: left;
  }
}

@media (max-width: 400px) {
  .form_demo-title {
    font-size: 15px;
  }

  .form_demo-container {
    width: 90%;
  }

  .form_demo-form {
    gap: 10px;
  }

  .form_demo-group input,
  .form_demo-btn {
    padding: 10px 12px;
    font-size: 14px;
  }
}

/* Окно результата заявки (template/header.php, #front_demo_done) - в стиле панели заявки */
.form_demo-done {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(22, 52, 68, 0.6);
  font-family: 'Nunito', sans-serif;
  box-sizing: border-box;
  animation: form_demo-done-fade 0.3s ease-out;
}

.form_demo-done-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 40px 30px 30px;
  background: #2e3238;
  color: #fff;
  text-align: center;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  animation: form_demo-done-up 0.35s ease-out;
}

.form_demo-done-close {
  position: absolute;
  top: 6px;
  right: 14px;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}

.form_demo-done-close:hover {
  color: #dacc99;
}

.form_demo-done-title {
  margin: 0;
  color: #dacc99;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 700;
  line-height: 1.25;
}

.form_demo-done-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.form_demo-done-ok {
  max-width: 220px;
  margin-top: 10px;
}

@keyframes form_demo-done-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes form_demo-done-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .form_demo-done-box {
    padding: 36px 18px 22px;
  }

  .form_demo-done-icon {
    width: 52px;
    height: 52px;
  }
}

/* Окно заявки fancybox (#form-modal, forms/form_front_demo.php) - как панель заявки шапки */
#form-modal.form_demo-modal {
  display: none;
  width: 100%;
  max-width: 480px;
  padding: clamp(24px, 3vw, 36px) clamp(18px, 3vw, 32px);
  background: #2e3238;
  color: #fff;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  box-sizing: border-box;
}

.fancybox-content#form-modal.form_demo-modal {
  display: inline-flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vw, 15px);
}

#form-modal .form_demo-title {
  padding-right: 24px;
  color: #fff;
  font-weight: 700;
}

#form-modal .form_demo-group input::placeholder {
  color: #a4a6a9;
}

#form-modal .fancybox-close-small {
  color: #fff;
  opacity: 0.8;
}

#form-modal .fancybox-close-small:hover {
  color: #dacc99;
  opacity: 1;
}
