@font-face {
  font-family: "Lora";
  src: url("/fonts/Lora-Variable.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --olive-slate: #3c4826;
  --olive-deep: #273018;
  --olive-dark: #1d2411;
  --olive-soft: #566238;
  --soft-melon: #ffd289;
  --soft-melon-light: #fff0c8;
  --accent: #dfa238;
  --accent-deep: #a96918;
  --accent-dark: #74440e;
  --text: #fff4d7;
  --muted: #d7cba8;
  --line: rgba(255, 210, 137, 0.5);
  --panel: rgba(39, 48, 24, 0.74);
  --panel-strong: rgba(29, 36, 17, 0.84);
  --shadow: 0 26px 70px rgba(13, 18, 8, 0.36);
  --gold-shadow: 0 2px 0 rgba(83, 48, 5, 0.9), 0 5px 16px rgba(0, 0, 0, 0.42);

  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --card-border: #cda84d;
  --gold-text-gradient: linear-gradient(180deg, #e8b865 0%, #f7dca0 10%, #fff5d6 22%, #fae3a8 38%, #f3c978 52%, #e2ad55 70%, #edc070 84%, #e8b865 100%);

  /* Рамка: ширина угла и положение линий рамки внутри угла (пропорции из images/frame.webp) */
  --frame-w: 170px;
  --frame-h: calc(var(--frame-w) * 1.4556);
  --frame-line-x: calc(var(--frame-w) * 0.105);
  --frame-line-y: calc(var(--frame-h) * 0.0918);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background-color: #262e15; }
body {
  position: relative;
  margin: 0;
  padding: 40px 0 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-serif);
  color: var(--text);
  background:
    radial-gradient(ellipse 75% 40% at 50% 0%, rgba(128, 142, 80, 0.55), transparent 72%),
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(16, 21, 6, 0.55), transparent 75%),
    linear-gradient(90deg, rgba(20, 25, 8, 0.6), transparent 24%, transparent 76%, rgba(20, 25, 8, 0.6)),
    #3e4926;
}

body::before,
body::after {
  content: "";
  position: absolute;
  top: 70px;
  bottom: 0;
  width: min(34vw, 460px);
  background: url("/images/bg-leaves.webp") no-repeat top center / contain;
  opacity: 0.32;
  pointer-events: none;
}
body::before { left: 0; transform: scaleX(-1); }
body::after { right: 0; }

button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1010px, calc(100% - 40px)); margin-inline: auto; }

/* ---------- Главная рамка ---------- */

.hero {
  position: relative;
  z-index: 1;
  isolation: isolate;
  padding: calc(var(--frame-line-y) + 40px) 66px calc(var(--frame-line-y) + 52px);
}

.hero::before,
.checkout::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: var(--frame-line-y) var(--frame-line-x);
  border-radius: calc(var(--frame-w) * 0.45);
  background:
    radial-gradient(ellipse 85% 34% at 50% 0%, rgba(120, 136, 72, 0.42), transparent 78%),
    radial-gradient(ellipse 60% 30% at 50% 100%, rgba(10, 12, 3, 0.45), transparent 80%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .85 0 0 0 0 .8 0 0 0 0 .55 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #46532a 0%, #38441f 26%, #2a3417 55%, #1f2811 80%, #1a210d 100%);
  box-shadow:
    0 34px 80px rgba(8, 11, 3, 0.6),
    0 10px 24px rgba(8, 11, 3, 0.35),
    inset 0 0 90px rgba(8, 11, 3, 0.35);
}

.hero::after,
.checkout::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  border-style: solid;
  border-color: transparent;
  border-width: var(--frame-h) var(--frame-w);
  border-image: url("/images/frame.webp") 524 360 / var(--frame-h) var(--frame-w) stretch;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.frame-ornament {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: calc(var(--frame-line-y) - 3px);
  width: clamp(120px, 17vw, 170px);
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  user-select: none;
}

/* ---------- Золотой текст с мягким свечением ---------- */

.gold-text {
  --gold-line: 1.14em;
  --gold-room: 0.3em;
  color: #f2c86e;
  line-height: var(--gold-line);
  padding-block: var(--gold-room);
  background-image:
    linear-gradient(105deg, transparent 44%, rgba(255, 243, 205, 0.62) 50%, transparent 56%),
    var(--gold-text-gradient);
  background-size: 260% 100%, 100% var(--gold-line);
  background-repeat: no-repeat, repeat-y;
  background-position: 100% 0, 0 0;
  background-origin: padding-box, content-box;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1.5px 0 rgba(92, 55, 8, 0.95)) drop-shadow(0 5px 7px rgba(0, 0, 0, 0.5));
  animation: gold-sheen 7s ease-in-out infinite, gold-glow 3.8s ease-in-out infinite;
}

@keyframes gold-sheen {
  0% { background-position: 100% 0, 0 0; }
  45%, 100% { background-position: 0% 0, 0 0; }
}

@keyframes gold-glow {
  0%, 100% {
    filter:
      drop-shadow(0 1.5px 0 rgba(92, 55, 8, 0.95))
      drop-shadow(0 5px 7px rgba(0, 0, 0, 0.5))
      drop-shadow(0 0 3px rgba(255, 206, 112, 0.18));
  }
  50% {
    filter:
      drop-shadow(0 1.5px 0 rgba(92, 55, 8, 0.95))
      drop-shadow(0 5px 7px rgba(0, 0, 0, 0.5))
      drop-shadow(0 0 13px rgba(255, 212, 122, 0.6));
  }
}

.hero-copy {
  position: relative;
  z-index: 1;
  text-align: center;
}

.eyebrow {
  margin: calc(var(--gold-room) * -1) auto;
  max-width: 820px;
  font-family: var(--font-serif);
  font-size: clamp(30px, 5.1vw, 56px);
  font-weight: 700;
  letter-spacing: -0.012em;
}

.eyebrow-line { display: block; }

.eyebrow-line-ruled {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.42em;
}

.eyebrow-line-ruled::before,
.eyebrow-line-ruled::after {
  content: "";
  flex: 0 1 190px;
  height: 2px;
  margin-top: 0.42em;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(233, 185, 92, 0), #f1c56c);
}
.eyebrow-line-ruled::after { background: linear-gradient(270deg, rgba(233, 185, 92, 0), #f1c56c); }

/* ---------- Герб и венок ---------- */

/* Размеры венка заданы в долях ширины герба (--emblem), чтобы ветки никогда не касались герба */
.emblem-wrap {
  --emblem: clamp(250px, 44vw, 450px);
  --wreath-width: 0.8;
  --wreath-top: 0.51;
  --wreath-gap: 0.17;
  --wrap-height: 1.1;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: calc(var(--emblem) * var(--wrap-height) + 4px);
  margin: 10px auto 4px;
}

.wreath {
  position: absolute;
  z-index: 1;
  top: calc(var(--emblem) * var(--wreath-top));
  width: calc(var(--emblem) * var(--wreath-width));
  height: auto;
  filter: drop-shadow(0 10px 12px rgba(6, 9, 2, 0.5));
  pointer-events: none;
  user-select: none;
}
.wreath-left { right: calc(50% + var(--emblem) * var(--wreath-gap)); }
.wreath-right { left: calc(50% + var(--emblem) * var(--wreath-gap)); }

.emblem {
  position: relative;
  z-index: 2;
  width: var(--emblem);
  aspect-ratio: 1 / 1;
  isolation: isolate;
}

.brand-emblem {
  display: block;
  width: 100%;
  height: 100%;
  filter:
    drop-shadow(0 22px 18px rgba(5, 8, 1, 0.62))
    drop-shadow(0 6px 5px rgba(0, 0, 0, 0.45));
  user-select: none;
}

.emblem-glow,
.emblem-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask: url("/images/emblem.webp") center / 100% 100% no-repeat;
  mask: url("/images/emblem.webp") center / 100% 100% no-repeat;
}

.emblem-glow {
  background: radial-gradient(circle at 50% 44%, rgba(255, 238, 178, 0.95), rgba(255, 212, 115, 0.45) 42%, rgba(255, 200, 90, 0.12) 70%, transparent 85%);
  mix-blend-mode: overlay;
  opacity: 0.2;
  animation: emblem-pulse 3.8s ease-in-out infinite;
}

.emblem-shine {
  background: linear-gradient(112deg, transparent 40%, rgba(255, 250, 228, 0.95) 50%, transparent 60%) no-repeat;
  background-size: 280% 100%;
  background-position: 100% 0;
  mix-blend-mode: overlay;
  animation: emblem-sheen 6.5s ease-in-out infinite;
}

@keyframes emblem-pulse {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 0.62; }
}

@keyframes emblem-sheen {
  0%, 12% { background-position: 100% 0; }
  58%, 100% { background-position: 0% 0; }
}

h1 {
  margin: calc(var(--gold-room) * -1) auto;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.9vw, 54px);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-align: center;
}

.title-divider {
  display: block;
  width: min(520px, 78%);
  height: auto;
  margin: 19px auto 26px;
  overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

/* ---------- Карточки услуг ---------- */

.service-card {
  position: relative;
  z-index: 1;
}

.service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

.service-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 18px;
  min-height: 118px;
  padding: 18px 20px 18px 18px;
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  background:
    radial-gradient(ellipse 70% 90% at 20% 0%, rgba(255, 214, 128, 0.07), transparent 70%),
    linear-gradient(180deg, rgba(46, 56, 26, 0.72), rgba(24, 30, 12, 0.82));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.28),
    0 0 12px rgba(255, 198, 92, 0.2),
    inset 0 0 16px rgba(255, 208, 118, 0.07),
    0 14px 26px rgba(6, 9, 2, 0.34);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.service-item:hover {
  transform: translateY(-2px);
  border-color: #f1c86c;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.28),
    0 0 18px rgba(255, 204, 100, 0.32),
    inset 0 0 18px rgba(255, 208, 118, 0.09),
    0 18px 30px rgba(6, 9, 2, 0.4);
}

.service-item.selected {
  border-color: #f6cf77;
  background:
    radial-gradient(ellipse 70% 90% at 20% 0%, rgba(255, 214, 128, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(54, 62, 28, 0.78), rgba(28, 33, 13, 0.86));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.28),
    0 0 20px rgba(255, 204, 100, 0.34),
    inset 0 0 22px rgba(255, 208, 118, 0.1),
    0 14px 26px rgba(6, 9, 2, 0.34);
}

.service-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  box-shadow: 0 8px 16px rgba(4, 6, 1, 0.5);
}
.service-icon img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  user-select: none;
}

.service-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.service-name {
  color: #fcf1dc;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

.service-desc {
  color: #dcd3c1;
  font-size: 15px;
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.service-price {
  margin-top: 3px;
  color: #f1c66b;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ---------- Кнопка «Подробнее» (тот же вид, что у цены) ---------- */

/* Строка может заходить под колонку чекбокса: он прижат к верху карточки, а цена всегда ниже */
.service-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 20px;
  margin-right: -52px;
}

.service-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: -6px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  color: #f1c66b;
  background: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.12s ease;
}

.service-more-label {
  padding-bottom: 2px;
  background: linear-gradient(90deg, currentColor, rgba(241, 198, 107, 0)) left bottom / 45% 1px no-repeat;
  transition: background-size 0.3s ease;
}

.service-more::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 1px;
  border-top: 1.8px solid currentColor;
  border-right: 1.8px solid currentColor;
  transform: rotate(45deg);
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.55));
  animation: more-nudge 2.6s ease-in-out infinite;
}

@keyframes more-nudge {
  0%, 55%, 100% { transform: translateX(0) rotate(45deg); }
  70% { transform: translateX(4px) rotate(45deg); }
  85% { transform: translateX(0) rotate(45deg); }
}

.service-more:hover,
.service-more:focus-visible {
  color: #ffe29a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 205, 110, 0.5);
}
.service-more:hover .service-more-label,
.service-more:focus-visible .service-more-label { background-size: 100% 1px; }
.service-more:hover::after,
.service-more:focus-visible::after { animation: none; transform: translateX(4px) rotate(45deg); }
.service-more:active { transform: translateY(1px); }

.service-check {
  appearance: none;
  -webkit-appearance: none;
  align-self: start;
  width: 34px;
  height: 34px;
  margin: 4px 0 0;
  border: 1.5px solid #e2b458;
  border-radius: 7px;
  display: grid;
  place-content: center;
  background: rgba(10, 13, 4, 0.28);
  box-shadow: inset 0 0 8px rgba(255, 210, 120, 0.1), 0 2px 5px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.service-check::before {
  content: "";
  width: 14px;
  height: 8px;
  margin-top: -3px;
  border-left: 3.5px solid #fffdf6;
  border-bottom: 3.5px solid #fffdf6;
  border-radius: 1px;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.14s ease;
  filter: drop-shadow(0 1px 1px rgba(120, 70, 8, 0.6));
}

.service-check:checked {
  border-color: #ffe29a;
  background: linear-gradient(180deg, #fad97f 0%, #efb34c 55%, #d8922e 100%);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.42),
    0 0 12px rgba(255, 200, 90, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.service-check:checked::before { transform: rotate(-45deg) scale(1); }

/* ---------- Итог и кнопка ---------- */

/* Подсказка и строка итога занимают одну ячейку сетки, поэтому при первом выборе ничего не сдвигается */
.summary-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 26px;
  text-align: center;
}

.summary-meta,
.summary-hint { grid-row: 1; grid-column: 1; }

.summary-meta {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 30px;
  margin: 0 auto 22px;
}

.summary-hint {
  align-self: center;
  max-width: 440px;
  margin: 0 auto 22px;
  color: rgba(236, 216, 170, 0.82);
  font-size: 16px;
  font-style: italic;
  line-height: 1.45;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.summary-box.is-empty .summary-meta,
.summary-box:not(.is-empty) .summary-hint { visibility: hidden; }

.selected-line,
.total-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.total-line {
  padding-left: 30px;
  border-left: 1px solid rgba(255, 210, 137, 0.35);
}

.selected-line span,
.total-line span {
  color: rgba(236, 216, 170, 0.78);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.selected-line strong {
  color: #fcf1dc;
  font-size: 17px;
  font-weight: 600;
}

.total-line strong {
  color: #f6cf74;
  font-size: 28px;
  font-weight: 700;
  text-shadow: 0 2px 0 rgba(92, 55, 8, 0.9), 0 0 14px rgba(255, 205, 110, 0.3);
}

.pay-button,
.primary-wide {
  border: 1px solid #ffdd9e;
  color: #302f18;
  background: linear-gradient(180deg, #ffd98e 0%, #e8a83d 58%, #cf841f 100%);
  box-shadow:
    0 11px 26px rgba(111, 62, 5, 0.34),
    0 0 24px rgba(255, 210, 137, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.pay-button {
  width: min(560px, 100%);
  min-height: 86px;
  margin: 0 auto;
  padding: 0 34px;
  border: 2px solid #ffe9a8;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  color: #2a1c07;
  background: linear-gradient(180deg, #ffe8a4 0%, #fdd47c 20%, #f7b957 52%, #f1a945 78%, #fbcb68 100%);
  box-shadow:
    0 0 0 1px rgba(120, 72, 10, 0.5),
    0 0 26px rgba(255, 196, 84, 0.55),
    0 0 60px rgba(255, 190, 80, 0.2),
    0 14px 26px rgba(5, 7, 1, 0.42),
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    inset 0 -4px 8px rgba(170, 96, 12, 0.28);
  font-family: var(--font-serif);
  font-size: clamp(22px, 3.1vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.pay-button:not(:disabled):hover,
.primary-wide:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.05); }
.pay-button:not(:disabled):active,
.primary-wide:not(:disabled):active { transform: translateY(0); }
/* Пока услуга не выбрана — тихий золотой контур; яркое золото включается после выбора */
.pay-button:disabled {
  cursor: not-allowed;
  border: 1.5px solid rgba(226, 180, 88, 0.45);
  color: rgba(246, 214, 140, 0.5);
  background: rgba(17, 22, 10, 0.3);
  box-shadow: inset 0 0 24px rgba(255, 210, 120, 0.05), 0 10px 22px rgba(5, 7, 1, 0.22);
}

.pay-button:not(:disabled) { animation: pay-ready 0.7s cubic-bezier(0.22, 0.9, 0.3, 1); }

@keyframes pay-ready {
  0% { transform: scale(0.97); filter: brightness(1.18); }
  45% { transform: scale(1.025); }
  100% { transform: none; filter: none; }
}

/* ---------- Панель с суммой внизу экрана (телефон) ---------- */

.pay-bar {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(560px, calc(100% - 20px));
  margin-inline: auto;
  padding: 9px 9px 9px 18px;
  border: 1.5px solid var(--card-border);
  border-radius: 999px;
  background:
    radial-gradient(ellipse 70% 120% at 20% 0%, rgba(255, 214, 128, 0.09), transparent 70%),
    linear-gradient(180deg, rgba(46, 56, 26, 0.94), rgba(24, 30, 12, 0.96));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 16px rgba(255, 198, 92, 0.22),
    0 16px 34px rgba(4, 6, 1, 0.6);
  transform: translateY(calc(100% + 30px));
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0s linear 0.32s;
}

.pay-bar.is-visible {
  transform: none;
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0s;
}

.pay-bar-info {
  display: grid;
  min-width: 0;
  text-align: left;
}

.pay-bar-label {
  color: rgba(236, 216, 170, 0.78);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pay-bar-total {
  color: #f6cf74;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(92, 55, 8, 0.9), 0 0 14px rgba(255, 205, 110, 0.3);
}

.pay-bar-button {
  flex: none;
  min-height: 48px;
  padding: 0 24px;
  border: 1.5px solid #ffe9a8;
  border-radius: 999px;
  color: #2a1c07;
  background: linear-gradient(180deg, #ffe8a4 0%, #fdd47c 20%, #f7b957 52%, #f1a945 78%, #fbcb68 100%);
  box-shadow:
    0 0 0 1px rgba(120, 72, 10, 0.5),
    0 0 16px rgba(255, 196, 84, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    inset 0 -3px 6px rgba(170, 96, 12, 0.28);
  font-size: 17px;
  font-weight: 700;
  transition: transform 0.12s ease, filter 0.18s ease;
}
.pay-bar-button:active { transform: translateY(1px); filter: brightness(1.05); }

/* ---------- Модальное окно оплаты (та же рамка, что у главного блока) ---------- */

.checkout {
  --frame-w: 96px;
  --frame-h: calc(var(--frame-w) * 1.4556);
  --frame-line-x: calc(var(--frame-w) * 0.105);
  --frame-line-y: calc(var(--frame-h) * 0.0918);
  /* Отступы, при которых содержимое не заходит под угловые завитки рамки */
  --safe-x: calc(var(--frame-w) * 0.46 + 12px);
  --safe-y: calc(var(--frame-h) * 0.24 + 12px);
  isolation: isolate;
  overflow: visible;
  width: min(640px, calc(100% - 20px));
  max-width: calc(100% - 20px);
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
}
.checkout::backdrop { background: rgba(17, 22, 10, 0.72); backdrop-filter: blur(6px); }

.dialog-shell {
  position: relative;
  margin: var(--frame-line-y) var(--frame-line-x);
  padding: calc(var(--safe-y) - var(--frame-line-y)) calc(var(--safe-x) - var(--frame-line-x));
  max-height: calc(100vh - 20px - 2 * var(--frame-line-y));
  max-height: calc(100dvh - 20px - 2 * var(--frame-line-y));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 210, 137, 0.45) transparent;
}

.dialog-close {
  position: absolute;
  z-index: 5;
  top: calc(var(--safe-y) - 10px);
  right: calc(var(--safe-x) - 10px);
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1.5px solid rgba(241, 198, 108, 0.75);
  border-radius: 50%;
  color: #f6cf74;
  background: radial-gradient(circle at 50% 35%, rgba(255, 214, 128, 0.16), rgba(20, 26, 10, 0.65));
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 0 8px rgba(255, 210, 120, 0.1);
  transition: transform 0.25s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.dialog-close::before,
.dialog-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}
.dialog-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.dialog-close:hover {
  transform: rotate(90deg);
  color: #fff1c9;
  border-color: #ffe29a;
  box-shadow: 0 0 14px rgba(255, 200, 90, 0.45), 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 0 10px rgba(255, 210, 120, 0.18);
}
.dialog-close.is-pressed { animation: close-press 0.28s ease forwards; }

@keyframes close-press {
  0% { transform: rotate(90deg) scale(1); }
  45% { transform: rotate(135deg) scale(0.78); box-shadow: 0 0 0 7px rgba(255, 210, 120, 0.2), 0 0 18px rgba(255, 200, 90, 0.55); }
  100% { transform: rotate(180deg) scale(0.9); opacity: 0; }
}

.checkout[open] { animation: checkout-in 0.42s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
.checkout[open]::backdrop { animation: backdrop-in 0.42s ease both; }
.checkout.is-closing { animation: checkout-out 0.28s ease-in both; }
.checkout.is-closing::backdrop { animation: backdrop-out 0.28s ease-in both; }

@keyframes checkout-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes checkout-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(10px) scale(0.975); }
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-out { from { opacity: 1; } to { opacity: 0; } }

.dialog-kicker { color: var(--soft-melon); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.checkout h2 {
  --gold-room: 0.3em;
  margin: calc(8px - var(--gold-room)) 0 calc(var(--gold-room) * -1);
  padding-block: var(--gold-room);
  padding-right: 48px;
  color: #f2c86e;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.14em;
  background: var(--gold-text-gradient) 0 0 / 100% 1.14em repeat-y content-box;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1.5px 0 rgba(92, 55, 8, 0.95)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
}
.success-step h2 { padding-inline: 44px; }
.dialog-subtitle { margin: 11px 0 24px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.checkout-step { display: none; }
.checkout-step.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field span { font-size: 12px; color: var(--muted); font-weight: 700; }
.field input { width: 100%; border: 1px solid rgba(255,210,137,.22); background: rgba(17,22,10,.26); border-radius: 12px; padding: 13px 14px; outline: none; color: #fff7e8; transition: .18s ease; }
.field input::placeholder { color: rgba(230,218,186,.45); }
.field input:focus { border-color: var(--soft-melon); box-shadow: 0 0 0 3px rgba(255,210,137,.10); background: rgba(17,22,10,.4); }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.consent input { margin-top: 2px; accent-color: var(--accent); }
.dialog-summary, .order-preview, .receipt { border: 1px solid rgba(255,210,137,.2); border-radius: 15px; padding: 14px 16px; background: rgba(17,22,10,.2); }
.dialog-summary { margin: 20px 0; display: grid; gap: 10px; }
.dialog-summary div, .order-preview div, .receipt div { display: flex; justify-content: space-between; gap: 20px; }
.dialog-summary span, .order-preview span, .receipt span { color: var(--muted); font-size: 12px; }
.dialog-summary strong, .order-preview strong, .receipt strong { color: var(--soft-melon-light); font-size: 13px; }
.primary-wide, .secondary-wide { width: 100%; height: 54px; border-radius: 14px; font-weight: 800; }
.secondary-wide { background: transparent; border: 1px solid rgba(255,210,137,.3); color: var(--soft-melon-light); margin-top: 10px; }
.form-error { min-height: 18px; color: #ff9a8f; font-size: 12px; margin: 10px 2px 0; text-align: center; }
.payment-notice { margin: 14px 0 0; padding: 12px 14px; border: 1px solid rgba(255,210,137,.32); border-radius: 12px; background: rgba(223,162,56,.12); color: var(--soft-melon-light); font-size: 13px; line-height: 1.5; text-align: center; }
.demo-warning { color: #ffd8b0; background: rgba(143,49,34,.2); border: 1px solid rgba(255,177,143,.32); border-radius: 11px; padding: 10px 12px; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-align: center; margin-bottom: 14px; }
.card-mock { background: linear-gradient(145deg, #252d17, #4b5a2e); border: 1px solid rgba(255,210,137,.34); border-radius: 20px; padding: 22px; color: white; box-shadow: 0 20px 34px rgba(13,18,8,.3); }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; font-size: 10px; letter-spacing: .13em; opacity: .78; font-weight: 850; }
.card-chip { width: 34px; height: 24px; border-radius: 6px; background: linear-gradient(135deg, var(--soft-melon), var(--accent-deep)); opacity: .95; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.field-dark span { color: rgba(255,255,255,.7); }
.field-dark input { background: rgba(255,255,255,.08); border-color: rgba(255,210,137,.16); color: white; font-weight: 700; letter-spacing: .04em; }
.order-preview { margin: 18px 0; display: grid; gap: 10px; }
.success-step { text-align: center; padding: 18px 0 2px; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; background: rgba(223,162,56,.16); border: 1px solid rgba(255,210,137,.38); display: grid; place-items: center; margin: 0 auto 18px; color: var(--soft-melon); }
.success-icon svg { width: 35px; height: 35px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.success-step .dialog-subtitle { max-width: 470px; margin-inline: auto; }
.receipt { text-align: left; display: grid; gap: 12px; margin: 24px 0; }

/* ---------- Окно «Подробнее» об услуге (та же рамка, что у окна оплаты) ---------- */

.service-dialog .dialog-shell {
  --fade: calc(var(--safe-y) - var(--frame-line-y));
  min-height: min(calc(2 * var(--frame-h) - 2 * var(--frame-line-y) + 60px), calc(100vh - 20px - 2 * var(--frame-line-y)));
  min-height: min(calc(2 * var(--frame-h) - 2 * var(--frame-line-y) + 60px), calc(100dvh - 20px - 2 * var(--frame-line-y)));
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
  mask-image: linear-gradient(180deg, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
}

.service-dialog .dialog-close {
  background: radial-gradient(circle at 50% 35%, rgba(255, 214, 128, 0.16), rgba(20, 26, 10, 0.65)), #3a4620;
}

/* Заголовок по центру на всю ширину, начинается ниже кнопки закрытия */
.service-details h2 {
  margin-top: calc(34px - var(--gold-room));
  padding-inline: 0;
  text-align: center;
}

.service-details h3 {
  margin: 22px 0 8px;
  color: var(--soft-melon);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.service-details h2 + h3 { margin-top: 18px; }
.service-details p,
.service-details li { color: var(--muted); font-size: 14px; line-height: 1.6; }
.service-details p { margin: 0 0 8px; }
.service-details ol { margin: 0; padding-left: 22px; }
.service-details li { padding-left: 4px; }
.service-details li + li { margin-top: 6px; }
.service-details li::marker { color: #f1c66b; font-weight: 700; }
.service-details .service-details-price {
  margin: 16px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(255, 210, 137, 0.2);
  border-radius: 15px;
  background: rgba(17, 22, 10, 0.2);
}
.service-details-price strong { color: #f6cf74; font-weight: 700; }
.service-details > :last-child { margin-bottom: 0; }
.service-details h2 + :not(h3) { margin-top: 18px; }
.service-details h2 + .details-meta { margin: 10px 0 16px; text-align: center; font-size: 13px; }
.service-details ul { margin: 0; padding-left: 22px; list-style-type: "— "; }
.service-details li ul { margin-top: 6px; }
.service-details ol + p,
.service-details ul + p { margin-top: 14px; }
.service-details li strong { color: var(--soft-melon-light); font-weight: 700; }
.service-details a,
.consent-link {
  color: var(--soft-melon);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.service-details a:hover,
.consent-link:hover { color: #ffe29a; }

.requisites {
  margin: 0;
  border: 1px solid rgba(255, 210, 137, 0.2);
  border-radius: 15px;
  background: rgba(17, 22, 10, 0.2);
}
.requisites div {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 16px;
}
.requisites div + div { border-top: 1px solid rgba(255, 210, 137, 0.12); }
.requisites dt { color: var(--muted); font-size: 13px; line-height: 1.5; }
.requisites dd { margin: 0; color: var(--soft-melon-light); font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }

/* ---------- Согласия в форме оплаты ---------- */

.consents { display: grid; gap: 12px; margin: 18px 0; }
.consents .consent { margin: 0; }
.consent-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.consent-link {
  padding: 0;
  border: 0;
  background: none;
  font-weight: 600;
  text-underline-offset: 2px;
}

/* ---------- Подвал ---------- */

/* Фон подвала начинается под нижней частью рамки (поэтому сдвинут вверх) и плавно темнеет до низа страницы */
.site-footer {
  position: relative;
  margin-top: -110px;
  padding: 140px 0 44px;
  text-align: center;
  background: linear-gradient(180deg, rgba(18, 23, 9, 0) 0, rgba(18, 23, 9, 0.5) 140px, rgba(20, 26, 10, 0.92) 70%, #10150a 100%);
}

/* Москва слева и Боробудур справа по краям подвала (как листья по краям страницы); лежат под главной рамкой */
.site-footer { --landmark-w: clamp(300px, 42vw, 640px); }
.site-footer::before,
.site-footer::after {
  content: "";
  position: absolute;
  z-index: 0;
  bottom: 14px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.32;
  pointer-events: none;
}
.site-footer::before {
  left: 0;
  width: var(--landmark-w);
  aspect-ratio: 841 / 447;
  background-image: url("/images/footer-moscow.webp?v=20261002-1");
  background-position: left bottom;
}
.site-footer::after {
  right: 0;
  width: calc(var(--landmark-w) * 0.88);
  aspect-ratio: 737 / 341;
  background-image: url("/images/footer-borobudur.webp?v=20261002-1");
  background-position: right bottom;
}

.footer-inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.footer-inner::before {
  content: "";
  width: min(520px, 78%);
  height: 2px;
  margin-bottom: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(233, 185, 92, 0), #f1c56c, rgba(233, 185, 92, 0));
  opacity: 0.75;
}

.site-footer p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.site-footer .footer-company { color: #fcf1dc; font-weight: 600; letter-spacing: 0.01em; }
.site-footer .footer-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 28px; }
.site-footer .footer-copy { margin-top: 6px; color: rgba(215, 203, 168, 0.7); font-size: 12.5px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 28px;
  margin: 12px 0 4px;
}
.footer-links button,
.footer-links a {
  padding: 2px 0;
  border: 0;
  color: #f1c66b;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: color 0.2s ease, background-size 0.3s ease;
}
.footer-links button:hover,
.footer-links a:hover,
.footer-links button:focus-visible,
.footer-links a:focus-visible { color: #ffe29a; background-size: 100% 1px; }

/* ---------- Страницы документов: оферта и политика ---------- */

.legal-page {
  min-height: calc(2 * var(--frame-h) + 120px);
  padding-top: calc(var(--frame-line-y) + 56px);
}
.legal-back {
  display: inline-block;
  color: #f1c66b;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: color 0.2s ease;
}
.legal-back:hover { color: #ffe29a; }
.legal-page h1 { margin-top: 18px; font-size: clamp(28px, 4vw, 44px); }
.legal-meta { margin: 14px 0 30px; color: var(--muted); font-size: 14px; text-align: center; }
.legal-text { max-width: 780px; margin: 0 auto; color: #e3d8bd; font-size: 15px; line-height: 1.7; }
.legal-text h2 { margin: 28px 0 10px; color: var(--soft-melon); font-size: 19px; line-height: 1.35; }
.legal-text p { margin: 0 0 12px; }
.legal-text ol,
.legal-text ul { margin: 0 0 12px; padding-left: 24px; }
.legal-text ul { list-style-type: "— "; }
.legal-text li + li { margin-top: 6px; }
.legal-text strong { color: var(--soft-melon-light); }
.legal-text a { color: var(--soft-melon); text-underline-offset: 3px; }
.legal-text li::marker { color: #f1c66b; font-weight: 700; }

button:focus-visible,
input:focus-visible,
a:focus-visible,
.service-item:has(.service-check:focus-visible) {
  outline: 3px solid rgba(255, 210, 137, 0.36);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  :root { --frame-w: 128px; }
  .hero { padding-left: 46px; padding-right: 46px; }
  .service-item { grid-template-columns: 64px minmax(0, 1fr) 32px; gap: 14px; padding: 16px 16px 16px 14px; }
  .service-icon { width: 64px; height: 64px; }
  .service-name { font-size: 17px; }
  .service-desc { font-size: 14px; }
  .service-check { width: 32px; height: 32px; }
  .service-price-row { column-gap: 16px; margin-right: -46px; }
}

@media (max-width: 760px) {
  :root { --frame-w: 96px; }
  .shell { width: min(100% - 24px, 1010px); }
  body { padding: 14px 0 0; }
  .site-footer { padding-bottom: 18px; }
  .hero {
    padding: calc(var(--frame-line-y) + 64px) 30px calc(var(--frame-h) * 0.8);
  }
  body::before, body::after { opacity: 0.2; }
  .emblem-wrap {
    --emblem: min(44vw, calc((100vw - 64px) / 1.63));
    --wreath-width: 0.6;
    --wreath-top: 0.718;
    --wreath-gap: 0.215;
    --wrap-height: 1.16;
    margin-top: 8px;
  }
  .service-list { grid-template-columns: 1fr; gap: 14px; }
  .pay-button { min-height: 70px; gap: 20px; padding-inline: 24px; font-size: 23px; }
  .pay-bar { display: flex; }
}

@media (max-width: 620px) {
  :root { --frame-w: 78px; }
  .hero { padding: calc(var(--frame-line-y) + 62px) 22px calc(var(--frame-h) * 0.8); }
  .eyebrow { font-size: clamp(26px, 7.6vw, 36px); }
  .eyebrow-line-ruled::before,
  .eyebrow-line-ruled::after { flex-basis: 40px; }
  h1 { font-size: clamp(26px, 7.4vw, 36px); }
  .title-divider { width: 86%; margin-top: 13px; margin-bottom: 20px; }
  .emblem-wrap { --emblem: min(42vw, calc((100vw - 60px) / 1.63)); }
  .service-item { grid-template-columns: 56px minmax(0, 1fr) 30px; gap: 12px; min-height: 96px; padding: 14px 14px 14px 12px; border-radius: 14px; }
  .service-icon { width: 56px; height: 56px; }
  .service-name { font-size: 16px; }
  .service-desc { font-size: 13.5px; }
  .service-price,
  .service-more { font-size: 13px; }
  .service-price-row { column-gap: 16px; margin-right: -42px; }
  .service-check { width: 30px; height: 30px; margin-top: 2px; }
  .summary-meta { flex-direction: column; align-items: center; gap: 4px; }
  .total-line { padding-left: 0; border-left: 0; }
  .total-line strong { font-size: 24px; }
  .pay-button { min-height: 64px; gap: 14px; padding-inline: 18px; font-size: 20px; }
  .frame-ornament { width: 104px; }
  .checkout { --frame-w: 70px; }
  .checkout h2 { font-size: 25px; }
  .form-grid { grid-template-columns: 1fr; }
  .requisites div { grid-template-columns: 1fr; gap: 2px; }
  .site-footer p { font-size: 13px; }
  .footer-links { flex-direction: column; align-items: center; gap: 10px; }
  .site-footer { --landmark-w: 54vw; }
  .site-footer::before,
  .site-footer::after { bottom: 4px; opacity: 0.2; }
  .legal-text { font-size: 14px; }
  .field-wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .gold-text,
  .emblem-glow,
  .emblem-shine { animation: none; }
  .emblem-shine { opacity: 0; }
  .checkout[open],
  .checkout[open]::backdrop,
  .checkout.is-closing,
  .checkout.is-closing::backdrop,
  .dialog-close.is-pressed { animation: none; }
  .dialog-close { transition: none; }
  .service-more::after { animation: none; }
  .pay-button:not(:disabled) { animation: none; }
  .pay-bar,
  .pay-bar.is-visible { transition: none; }
}
