/* ============================================================
   ВАРИАНТ B — поп-ап скидки 20%
   Финальная палитра сайта proff-school.com/massage
   + праздничный красный
   ============================================================ */

:root {
  --site-white: #ffffff;
  --site-cream: #f6ede4;
  --site-sand: #eadccd;
  --site-line: #e6d7c8;
  --site-ink: #241a16;
  --site-taupe: #7b6659;
  --site-nude: #f5b590;
  --site-gold: #c9a25b;
  --site-gold-light: #e6c98f;
  --site-gold-pale: #fbe8c2;
  --red: #c8102e;
  --red-deep: #990b22;
  --red-bright: #e2453f;
  --red-soft: #fbe7ea;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }



/* ================= Плавающая кнопка повторного открытия ================= */
.popup-chip {
  position: fixed;
  right: 102px;
  bottom: 22px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--red-bright), var(--red) 55%, var(--red-deep));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid rgba(230, 201, 143, .55);
  box-shadow: 0 14px 30px -6px rgba(153, 11, 34, .5);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: chipIn .45s cubic-bezier(.16, 1.02, .36, 1.06) both;
}
.popup-chip:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -6px rgba(153, 11, 34, .62); }
.popup-chip:focus-visible { outline: 3px solid var(--site-gold-light); outline-offset: 2px; }
@keyframes chipIn {
  from { opacity: 0; transform: translateY(16px) scale(.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ================= ОВЕРЛЕЙ ================= */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  background: rgba(45, 31, 24, .46);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.popup-overlay.is-open { opacity: 1; visibility: visible; }

/* ================= ПОПАП ================= */
.popup {
  position: relative;
  margin: auto;
  width: 100%;
  max-width: 660px;
  display: grid;
  grid-template-columns: 214px 1fr;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(168deg, #ffffff 0%, #fdf8f3 100%);
  box-shadow:
    0 34px 68px -18px rgba(45, 31, 24, .38),
    inset 0 0 0 1px rgba(255, 255, 255, .95),
    inset 0 0 0 1px rgba(201, 162, 91, .36);
  opacity: 0;
  transform: translateY(30px) scale(.94);
  transition: opacity .35s ease, transform .5s cubic-bezier(.16, 1.02, .36, 1.06);
  will-change: transform, opacity;
}
.popup-overlay.is-open .popup { opacity: 1; transform: translateY(0) scale(1); }

.popup--success { grid-template-columns: 1fr !important; }
.popup--success .popup__close { background: rgba(255,255,255,.85); }

/* ---------- кнопка закрытия ---------- */
.popup__close {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 30;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--site-taupe);
  border: 1px solid rgba(201, 162, 91, .4);
  cursor: pointer;
  transition: transform .28s, color .2s, background .2s;
}
.popup__close:hover { background: var(--red-soft); color: var(--red); transform: rotate(90deg); }
.popup__close:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* =============== Боковая панель =============== */
.popup__side {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 40px 18px 26px;
  background: linear-gradient(168deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  overflow: hidden;
  border-right: 1px solid rgba(230, 201, 143, .35);
}
.popup__side::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120px 120px at 25% 10%, rgba(255, 255, 255, .16), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 1px, transparent 1px 9px);
  pointer-events: none;
}

.popup__badge {
  position: relative;
  z-index: 2;
  width: 76px;
  margin-bottom: 2px;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .35));
  transform-origin: 50% 0;
  animation: bellSwing 2.6s cubic-bezier(.45, 0, .55, 1) infinite;
}
.popup__badge .sparkle {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 3px rgba(230, 201, 143, .95);
  animation: twinkle 1.8s ease-in-out infinite;
}
.popup__badge .sparkle--1 { top: -2px; left: -8px; width: 8px; height: 8px; }
.popup__badge .sparkle--2 { top: 50%; right: -7px; width: 5px; height: 5px; animation-delay: .95s; }

.popup__discount {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 52px;
  line-height: .95;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff3d4 0%, var(--site-gold-light) 45%, var(--site-nude) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
.popup__side-text {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .92);
}
.popup__side-divider {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 2px;
  color: var(--site-gold-light);
}
.popup__side-divider::before,
.popup__side-divider::after {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 201, 143, .9), transparent);
}
.popup__side-meta {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
  line-height: 1.7;
}
.popup__side-note {
  position: relative;
  z-index: 2;
  margin: 6px 0 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--site-gold-pale);
}

/* =============== Форма =============== */
.popup__main {
  position: relative;
  padding: 26px 30px 26px 28px;
  display: flex;
  flex-direction: column;
}
.popup__kicker {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--site-gold);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.popup__kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--red), var(--site-gold));
}
.popup__title {
  margin: 0 0 8px;
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -.2px;
  color: var(--site-ink);
}
.popup__title .accent {
  background: linear-gradient(135deg, var(--red) 10%, var(--red-bright) 65%, #e07a3c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.popup__text {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--site-taupe);
}

/* ---------- поля ---------- */
.field { marg!in-bottom: 13px; }
.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--site-taupe);
}
.field__input {
  width: 100%!important;
  height: 48px!important;
  padding: 0 15px!important;
  border: 1.5px solid var(--site-line)!important;
  border-radius: 12px!important;
  background: #fff!important;
  font: inherit!important;
  font-size: 16px!important;
  color: var(--site-ink)!important;
  outline: none!important;
  transition: border-color .2s, box-shadow .2s!important;
}
.field__input::placeholder { color: #c4b3a9; }
.field__input:focus {
  border-color: var(--site-gold);
  box-shadow: 0 0 0 4px rgba(201, 162, 91, .22);
}
.field__error {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
}
.field.is-invalid .field__input {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, .12);
}
.field.is-invalid .field__error { display: block; }

div#fieldName.field{
    margin-top: 20px;
}

/* ---------- чекбокс ---------- */
.agree { margin: 16px 0 2px; }
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.5;
  color: var(--site-taupe);
  user-select: none;
}
.checkbox input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.checkbox__box {
  position: relative;
  flex: 0 0 20px;
  width: 20px; height: 20px;
  margin-top: -1px;
  border: 1.5px solid #d9c6b7;
  border-radius: 6px;
  background: #fff;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.checkbox:hover .checkbox__box { border-color: #c7ab95; }
.checkbox input:checked + .checkbox__box {
  border-color: var(--red);
  background: linear-gradient(135deg, var(--red-bright), var(--red) 60%, var(--red-deep));
  box-shadow: 0 4px 10px rgba(200, 16, 46, .28);
}
.checkbox input:checked + .checkbox__box::after {
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox input:focus-visible + .checkbox__box {
  box-shadow: 0 0 0 4px rgba(200, 16, 46, .22);
}
.checkbox__text .link {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
}
.checkbox__text .link:hover { color: var(--red-deep); }
.agree.is-invalid .checkbox__box { border-color: var(--red); }
.agree.is-invalid .field__error { display: block; }

/* ---------- кнопка ---------- */
.btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 52px;
  margin-top: 16px;
  border: 1px solid rgba(230, 201, 143, .5);
  border-radius: 13px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #fff;
  background: linear-gradient(135deg, #e04a58 0%, var(--red) 52%, var(--red-deep) 100%);
  box-shadow:
    0 12px 26px rgba(200, 16, 46, .30),
    inset 0 1px 0 rgba(255, 255, 255, .26);
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -70%;
  width: 42%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}
.btn:hover::after { left: 130%; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 16px 32px rgba(200, 16, 46, .40); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .65; cursor: default; transform: none; }
.btn:focus-visible { outline: 3px solid rgba(200, 16, 46, .4); outline-offset: 2px; }

.popup__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 12px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--site-taupe);
  text-align: center;
}
.popup__note svg { flex: 0 0 auto; color: var(--site-gold); }
.popup__note b { color: var(--red); font-weight: 800; }
.popup__error {
  display: none;
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--red-soft);
  border: 1px solid rgba(200, 16, 46, .24);
  color: var(--red-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}
.popup__error.is-visible { display: block; }

/* ---------- успех ---------- */
.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 10px 14px;
  animation: fadeUp .45s ease both;
}
.success__icon {
  display: grid;
  place-items: center;
  width: 66px; height: 66px;
  margin: 0 0 16px;
  border-radius: 50%;
  color: var(--site-gold-pale);
  background: linear-gradient(135deg, var(--red-bright), var(--red) 55%, var(--red-deep));
  box-shadow: 0 14px 26px rgba(200, 16, 46, .32);
  animation: popIn .55s cubic-bezier(.34, 1.56, .64, 1) both;
}
.success__title { margin: 0 0 9px; font-size: 20px; font-weight: 800; color: var(--site-ink); }
.success__text { margin: 0; max-width: 300px; font-size: 13.5px; line-height: 1.6; color: var(--site-taupe); }
.success__done {
  margin-top: 20px;
  padding: 12px 28px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  color: var(--red);
  background: var(--red-soft);
  cursor: pointer;
  transition: transform .2s, background .2s;
}
.success__done:hover { background: rgba(200, 16, 46, .14); transform: translateY(-1px); }
.success__done:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.4); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes bellSwing {
  0%   { transform: rotate(0deg); }
  9%   { transform: rotate(-17deg); }
  24%  { transform: rotate(15deg); }
  38%  { transform: rotate(-10deg); }
  52%  { transform: rotate(7deg); }
  66%  { transform: rotate(-4deg); }
  78%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: .2; transform: scale(.55); }
  50%      { opacity: 1;  transform: scale(1.2); }
}

/* ================= АДАПТИВ ================= */
@media (max-width: 560px) {
  .popup-overlay { padding: 34px 14px 22px; }

  .popup {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }
  .popup__side {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    text-align: left;
    padding: 20px 22px 18px;
    border-right: 0;
    border-bottom: 1px solid rgba(230, 201, 143, .35);
  }
  .popup__badge { width: 52px; margin-bottom: 0; flex: 0 0 auto; }
  .popup__badge .sparkle--1 { left: -5px; width: 6px; height: 6px; }
  .popup__badge .sparkle--2 { right: -4px; width: 4px; height: 4px; }
  .popup__discount { font-size: 34px; letter-spacing: -.6px; }
  .popup__side-text { font-size: 10px; letter-spacing: 1px; line-height: 1.5; }
  .popup__side-divider, .popup__side-meta { display: none; }
  .popup__side-note { font-size: 10px; margin-top: 4px; }
  .popup__main { padding: 22px 20px 22px; }
  .popup__title { font-size: 22px; }
  .popup__text { font-size: 13px; margin-bottom: 16px; }
  .popup__kicker { font-size: 9px; letter-spacing: 1.3px; }
  .popup-chip { right: 65px; bottom: 14px; }
}

@media (max-width: 360px) {
  .popup { border-radius: 18px; }
  .popup__main { padding: 20px 16px 20px; }
  .popup__title { font-size: 19px; }
  .popup__discount { font-size: 30px; }
  .popup__side { padding: 18px 18px 16px; gap: 12px; }
  .popup__badge { width: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .popup-chip,
  .popup__badge,
  .popup__badge .sparkle,
  .success__icon { animation: none; }
  .popup, .popup-overlay { transition-duration: .01ms; }
}