@font-face { font-family: "PT Serif"; font-weight: 700; font-display: swap; src: url(/fonts/pt-serif-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; font-weight: 700; font-display: swap; src: url(/fonts/pt-serif-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Jost"; font-weight: 100 900; font-display: swap; src: url(/fonts/jost-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Jost"; font-weight: 100 900; font-display: swap; src: url(/fonts/jost-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --orange: #F5911E;
  --orange-deep: #E97F0A;
  --orange-ink: #B25C00;
  --plum: #94005E;
  --ink: #333333;
  --muted: #757575;
  --line: #DEDEDE;
  --soft: #F7F7F7;
  --white: #FFFFFF;
  --serif: "PT Serif", Cambria, Georgia, serif;
  --sans: "Jost", "Circe", "Trebuchet MS", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; min-height: 100dvh; margin: 0; background: var(--white); color: var(--ink); font: 400 16px/1.4 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--orange-ink); }
a:hover { color: var(--plum); }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
h1, h2 { font-family: var(--serif); font-weight: 700; }

.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 6px var(--gutter);
}
.topbar-phone { color: var(--ink); text-decoration: none; font-weight: 500; }
.topbar-logo { display: block; line-height: 0; }
.topbar-logo img, .legal-logo img { width: auto; height: 44px; }
.topbar-site { justify-self: end; color: var(--orange-ink); font-weight: 500; }

.hero { position: relative; z-index: 2; overflow: hidden; background: var(--orange); }
.hero-leaves { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: clamp(24px, 4vw, 48px); align-items: end;
  max-width: 980px; margin: 0 auto; padding: 14px var(--gutter) 0;
}
.hero-text { padding-bottom: 14px; color: var(--white); }
.hero h1 { margin: 0; font-size: clamp(23px, 2.6vw, 29px); line-height: 1.15; letter-spacing: -.01em; }
.hero p { margin: 4px 0 0; font-size: 16px; font-weight: 500; }
.hero a { color: var(--white); }
.hero a:hover { color: #FFE2BD; }
.hero-slot { height: 10px; border-radius: 5px 5px 0 0; background: #6B3D08; }

.page { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 0 var(--gutter) 24px; }
.page h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.2; }
.page h2:focus { outline: none; }

.step-entry { max-width: 560px; padding-top: 24px; }
.step-entry .btn { margin-top: 12px; }

.step-data {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
.data { grid-column: 1; grid-row: 1; min-width: 0; padding-top: 14px; }

.check { display: flex; gap: 10px; align-items: flex-start; padding: 3px 0; cursor: pointer; }
.check input {
  flex: none; width: 20px; height: 20px; margin: 1px 0 0; appearance: none; cursor: pointer;
  border: 1.5px solid #B8B8B8; border-radius: 3px; background: var(--white) center / 14px no-repeat;
  transition: background-color .12s, border-color .12s;
}
.check input:hover { border-color: var(--orange); }
.check input:checked {
  border-color: var(--orange); background-color: var(--orange);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.5 12 13 4.5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 2px; font-size: 15px; font-weight: 500; }
.field label::after { content: " *"; color: var(--plum); }
.field input {
  display: block; width: 100%; height: 40px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--white);
  color: var(--ink); font: 400 16px var(--sans);
  transition: border-color .12s, background-color .12s;
}
.field input::placeholder { color: #A8A8A8; }
.field input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 2px rgba(245, 145, 30, .3); }
.field input[aria-invalid="true"] { border-color: var(--plum); }
.field-note { margin: 1px 0 0; color: var(--muted); font-size: 13px; }
.field-error { margin: 1px 0 0; color: var(--plum); font-size: 13px; }

.crop { display: none; }

.consents { margin-top: 10px; font-size: 15px; }
.submit { padding-top: 8px; }
.btn {
  display: inline-block; padding: 11px 26px; border: 0; border-radius: 3px;
  background: var(--orange); color: var(--white);
  font: 600 17px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s;
}
.btn:hover { background: var(--orange-deep); color: var(--white); }
.btn:disabled { background: #E4E4E4; color: #8C8C8C; cursor: not-allowed; }
.submit-status { min-height: 1.4em; margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.submit-status.is-error { color: var(--plum); }

/* Чек выходит из щели на нижнем крае оранжевой полосы и едет рядом с формой */
.receipt {
  grid-column: 2; grid-row: 1; position: sticky; top: 10px; z-index: 1;
  width: min(300px, calc((100vh - 64px) * .6396), 100%); margin: 0 auto;
  filter: drop-shadow(0 3px 10px rgba(60, 35, 0, .28));
}
.receipt-paper {
  position: relative; overflow: hidden; background: var(--white); line-height: 0;
  --tooth: 10px;
  -webkit-mask: conic-gradient(from -45deg at 50% 100%, transparent 90deg, #000 0) 0 100% / var(--tooth) calc(var(--tooth) / 2) repeat-x, linear-gradient(#000 0 0) 0 0 / 100% calc(100% - var(--tooth) / 2 + 1px) no-repeat;
  mask: conic-gradient(from -45deg at 50% 100%, transparent 90deg, #000 0) 0 100% / var(--tooth) calc(var(--tooth) / 2) repeat-x, linear-gradient(#000 0 0) 0 0 / 100% calc(100% - var(--tooth) / 2 + 1px) no-repeat;
  animation: print .9s cubic-bezier(.25, .7, .3, 1) backwards;
}
.receipt-paper img { display: block; width: 100%; height: auto; }
.receipt figcaption { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.25; }
@keyframes print { from { transform: translateY(-100%); } }

/* Подсветка: выбеливаем чек вокруг нужной строки */
.receipt-spot {
  position: absolute; top: var(--y); left: var(--x); width: var(--w); height: var(--h);
  border: 2px solid var(--plum); border-radius: 4px;
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, .8);
  transition: top .28s ease, left .28s ease, width .28s ease, height .28s ease;
}

.footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px;
  padding: 10px var(--gutter); background: var(--ink); color: #C9C9C9; font-size: 13px; text-align: center;
}
.footer a { color: var(--white); }

.done {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 16px; border: 0; background: rgba(38, 22, 6, .84); overflow: auto;
}
.done[open] { display: grid; place-items: center; }
.done::backdrop { background: transparent; }
.done-sky { position: fixed; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.done-card {
  position: relative; z-index: 1; width: min(520px, 100%); padding: 36px clamp(20px, 5vw, 44px) 40px;
  border-radius: 3px; background: var(--white); text-align: center;
  animation: rise .5s ease .2s backwards;
}
.done-card p { margin: 22px 0 28px; font-size: 21px; line-height: 1.4; overflow-wrap: anywhere; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.legal main { max-width: 760px; margin: 0 auto; padding: 32px var(--gutter) 72px; }
.legal-logo { display: block; margin-bottom: 32px; }
.legal h1 { font-size: clamp(25px, 4vw, 32px); line-height: 1.2; }
.legal-stub { padding: 12px 16px; border-left: 3px solid var(--orange); background: var(--soft); }
.legal h2 { margin: 36px 0 12px; font-size: 21px; line-height: 1.25; }
.legal h3 { margin: 24px 0 10px; font-size: 18px; }
.legal p, .legal li { line-height: 1.5; overflow-wrap: anywhere; }
.legal ul { padding-left: 22px; }
.legal li + li { margin-top: 4px; }
.legal-table { overflow-x: auto; margin: 12px 0 20px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal th { background: var(--soft); }
.legal td p { margin: 0; }

.admin-page { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 16px var(--gutter) 24px; }
.admin-page h1 { margin: 0 0 10px; font-size: 26px; }
.admin-sections { display: flex; gap: 18px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.admin-section {
  margin-bottom: -1px; padding: 6px 0 8px; border: 0; border-bottom: 3px solid transparent; background: none;
  color: var(--muted); font: 500 16px var(--sans); cursor: pointer;
}
.admin-section:hover { color: var(--ink); }
.admin-section[aria-current="page"] { border-bottom-color: var(--orange); color: var(--ink); }
.admin-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 15px; }
.admin-filter label { font-weight: 500; }
.admin-filter select, .promo-field input {
  min-width: 0; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--white); color: var(--ink); font: 400 15px var(--sans);
}
.admin-filter select:focus, .promo-field input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 2px rgba(245, 145, 30, .3); }
.promo-form { margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 3px; background: var(--soft); }
.promo-form h2 { margin: 0 0 10px; font-size: 19px; }
.promo-fields { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.promo-field label { display: block; margin-bottom: 2px; font-size: 14px; font-weight: 500; }
.promo-field input { width: 100%; }
.promo-wide { grid-column: 1 / -1; }
.promo-field input[type="file"] { padding: 5px 10px; }
.promo-preview { display: block; width: 100%; height: 480px; margin-top: 4px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); }
.promo-hint { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.admin-table td.wrap { min-width: 220px; white-space: normal; }
.promo-field input[aria-invalid="true"] { border-color: var(--plum); }
.promo-active { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 15px; cursor: pointer; }
.promo-error { color: var(--plum); }
.admin-tab.is-primary { border-color: var(--orange); background: var(--orange); color: var(--white); }
.admin-tab.is-primary:hover { background: var(--orange-deep); }
.admin-table td.actions { display: flex; gap: 6px; }
.admin-table td.actions .admin-tab { padding: 3px 10px; font-size: 14px; }
.promo-badge { display: inline-block; padding: 1px 8px; border-radius: 3px; background: var(--orange-ink); color: var(--white); font-size: 13px; font-weight: 600; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-tab {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--white);
  color: var(--ink); font: 500 15px var(--sans); cursor: pointer;
}
.admin-tab:hover { border-color: var(--orange); }
.admin-tab[aria-pressed="true"] { border-color: var(--orange); background: var(--orange); color: var(--white); }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.admin-actions a.admin-tab { color: inherit; text-decoration: none; }
.admin-actions .admin-tab:disabled { color: #A8A8A8; cursor: not-allowed; }
.admin-status { color: var(--muted); font-size: 14px; }
.admin-table td.result { min-width: 320px; white-space: normal; }
.admin-table td.loyalty { min-width: 200px; white-space: normal; font-weight: 600; }
.admin-note { margin: 8px 0 12px; color: var(--muted); font-size: 14px; }
.admin-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.admin-table th { position: sticky; top: 0; padding: 7px 10px; background: var(--soft); font-weight: 600; text-align: left; }
.admin-table td { padding: 6px 10px; border-top: 1px solid var(--line); }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .is-dup td { background: #FFF6EA; color: var(--muted); }
.admin-table .is-failed td { background: #FDECEC; }
.admin-empty { margin: 0; padding: 24px; color: var(--muted); text-align: center; }
.admin-pager { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 14px; }
.admin-pager .admin-tab:disabled { color: #A8A8A8; cursor: not-allowed; }

@media (max-width: 760px) {
  .promo-fields { grid-template-columns: minmax(0, 1fr); }
  .hero-inner, .step-data { grid-template-columns: minmax(0, 1fr); }
  .hero-slot { display: none; }
  .data { grid-column: 1; grid-row: auto; }
  .receipt { grid-column: 1; grid-row: auto; position: static; width: min(230px, 100%); margin-top: 14px; }
  .receipt figcaption { text-align: center; }
  .receipt-spot { display: none; }
  /* На телефоне чек не виден рядом с полем: показываем нужный фрагмент прямо под полем */
  .field:focus-within .crop {
    display: block; max-width: 100%; width: var(--crop-w); height: var(--crop-h); margin-top: 4px;
    border: 1px solid var(--line); border-radius: 3px;
    background: var(--white) url(/receipt.png) var(--crop-x) var(--crop-y) / 426px 666px no-repeat;
  }
  .field-wide { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar-phone { display: none; }
  .btn { width: 100%; text-align: center; }
}

[data-spot="order"]  { --crop-x: -2px;   --crop-y: -166px; --crop-w: 112px; --crop-h: 28px; }
[data-spot="date"]   { --crop-x: -2px;   --crop-y: -500px; --crop-w: 76px;  --crop-h: 26px; }
[data-spot="amount"] { --crop-x: -320px; --crop-y: -230px; --crop-w: 100px; --crop-h: 30px; }
[data-spot="fp"]     { --crop-x: -2px;   --crop-y: -614px; --crop-w: 138px; --crop-h: 28px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
