/* popup-order.css — единый попап заявки (шаг 2.18) */

/* box-sizing: border-box на весь попап — иначе width:100% + padding у input
   ломает ширину на мобильном (поля уезжают за экран). */
.site-popup, .site-popup * { box-sizing: border-box; }

.site-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Inter', system-ui, sans-serif;
}

.site-popup.is-open {
  display: flex;
  animation: site-popup-fade 0.2s ease-out;
}

@keyframes site-popup-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.site-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.78);
  backdrop-filter: blur(6px) saturate(130%);
  -webkit-backdrop-filter: blur(6px) saturate(130%);
  cursor: pointer;
}

.site-popup__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #0f0f1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 36px 32px 24px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  color: #fff;
  animation: site-popup-slide 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes site-popup-slide {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.site-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  padding: 0;
}

.site-popup__close:hover {
  background: rgba(255, 45, 120, 0.2);
  border-color: rgba(255, 45, 120, 0.6);
  transform: rotate(90deg);
}

.site-popup__header {
  margin-bottom: 22px;
  text-align: center;
}

.site-popup__eyebrow {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
}

.site-popup__title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(22px, 5vw, 26px);
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 8px;
  color: #fff;
  letter-spacing: 0.01em;
}

.site-popup__descr {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.site-popup__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.site-popup__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-popup__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-popup__label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.02em;
}

.site-popup__field input,
.site-popup__form input[type="text"],
.site-popup__form input[type="tel"],
.site-popup__form input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.site-popup__field input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.site-popup__field input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.site-popup__field input:focus {
  outline: none;
  border-color: #ff2d78;
  background: rgba(255, 255, 255, 0.05);
}

.site-popup__field input:invalid:not(:placeholder-shown) {
  border-color: rgba(255, 45, 120, 0.5);
}

.site-popup__options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.site-popup__option {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.site-popup__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.site-popup__option span {
  display: block;
  padding: 10px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s;
}

.site-popup__option:hover span {
  border-color: rgba(0, 245, 255, 0.3);
  color: #fff;
}

.site-popup__option input:checked + span {
  background: rgba(0, 245, 255, 0.08);
  border-color: #00f5ff;
  color: #00f5ff;
  box-shadow: 0 0 0 1px rgba(0, 245, 255, 0.3);
}

.site-popup__submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 24px;
  margin-top: 4px;
  background: #ff2d78;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.site-popup__submit:hover {
  background: #ff1466;
  transform: translateY(-1px);
}

.site-popup__submit:active {
  transform: translateY(0);
  background: #e01060;
}

.site-popup__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.site-popup__submit svg {
  transition: transform 0.2s;
}

.site-popup__submit:hover svg {
  transform: translateX(3px);
}

.site-popup__footer {
  margin-top: 2px;
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.45);
}

.site-popup__footer a {
  color: rgba(0, 245, 255, 0.8);
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 245, 255, 0.4);
}

.site-popup__footer a:hover {
  color: #00f5ff;
}

.site-popup__contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  padding: 16px 0 0;
  margin: 12px 0 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-popup__contacts a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.site-popup__contacts a:hover {
  color: #00f5ff;
}

.site-popup__contacts svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* SUCCESS + ERROR states */

.site-popup__success {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  text-align: center;
  background: rgba(0, 245, 255, 0.04);
  border: 1px solid rgba(0, 245, 255, 0.3);
  border-radius: 14px;
  animation: site-popup-success-in 0.4s ease-out;
}

.site-popup__success[style*="display:none"],
.site-popup__success[style*="display: none"] {
  display: none !important;
}

@keyframes site-popup-success-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.site-popup__success-title {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: #fff;
}

.site-popup__success-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.site-popup__error {
  padding: 12px 14px;
  background: rgba(255, 45, 120, 0.08);
  border: 1px solid rgba(255, 45, 120, 0.4);
  border-radius: 10px;
  color: #ffbbd1;
  font-size: 13px;
  line-height: 1.4;
}

/* body lock when popup open */
body.site-popup-open {
  overflow: hidden;
}

/* MOBILE: bottom-sheet как в современных приложениях */
@media (max-width: 640px) {
  .site-popup {
    padding: 0;
    align-items: flex-end;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .site-popup__panel {
    width: 100%;
    max-width: 100vw;
    max-height: 94vh;
    border-radius: 16px 16px 0 0;
    padding: 28px 16px 20px;
    border-left: none;
    border-right: none;
    border-bottom: none;
    animation: site-popup-slide-mobile 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .site-popup__form { width: 100%; max-width: 100%; }
  .site-popup__row { width: 100%; max-width: 100%; }
  .site-popup__field { width: 100%; max-width: 100%; }
  /* Drag-handle-индикатор вверху — как у iOS/Android sheet */
  .site-popup__panel::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
  }
  @keyframes site-popup-slide-mobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .site-popup__header { margin-bottom: 18px; padding-top: 4px; }
  .site-popup__title { font-size: 20px; margin-bottom: 6px; }
  .site-popup__descr { font-size: 13px; line-height: 1.45; }
  .site-popup__close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }
  .site-popup__form { gap: 12px; }
  .site-popup__field input,
  .site-popup__form input[type="text"],
  .site-popup__form input[type="tel"],
  .site-popup__form input[type="email"] {
    font-size: 16px;  /* >= 16px чтобы iOS Safari не зумил при фокусе */
    padding: 13px 14px;
  }
  .site-popup__label { font-size: 11px; }
  .site-popup__options { grid-template-columns: 1fr; gap: 6px; }
  .site-popup__option span { padding: 12px 14px; font-size: 14px; text-align: left; }
  .site-popup__submit {
    width: 100%;
    padding: 15px 20px;
    font-size: 14px;
    min-height: 50px;
  }
  .site-popup__footer {
    margin-top: 10px;
    font-size: 10.5px;
    line-height: 1.4;
  }
  .site-popup__contacts {
    gap: 8px 14px;
    padding-top: 12px;
    margin-top: 10px;
  }
  .site-popup__contacts a { font-size: 11.5px; }
}

@media (max-width: 380px) {
  .site-popup__panel { padding: 24px 16px 16px; }
  .site-popup__title { font-size: 19px; }
  .site-popup__descr { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-popup.is-open,
  .site-popup__panel,
  .site-popup__submit,
  .site-popup__success {
    animation: none !important;
    transition: none !important;
  }
}
