/* ============================================================
   Ваш чек — сторінка фіскального чека
   Макет: Figma «Фіскальний чек», фрейм 10:947

   Зміна бренду:
     1. підмінити logo.svg
     2. перевизначити --brand / --brand-soft нижче
     3. поміняти домен у .site (index.html)
   ============================================================ */

/* Inter — основний шрифт макета (варіативний, ваги 400–800).
   Два сабсети: кирилиця й латиниця, разом ~67 КБ.
   Файли лежать у корені: пайплайн деплою робить scp без -r, теки не копіюються. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('inter-var-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Rajdhani — шрифт цифр у макеті. Кирилиці в ньому немає,
   тому unicode-range обмежений латиницею: текст бере наступний шрифт стека. */
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('rajdhani-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --brand: #3a73e7;
  --brand-soft: #eaf1fc;
  --brand-line: #d8e4fa;
  --accent: #ef8aa9;

  --ink: #181818;
  --ink-muted: #55585f;
  --ink-label: #84878d;
  --surface: #ffffff;

  --card-radius: 20px;
  --card-pad: clamp(16px, 5vw, 24px);
  --block-radius: 12px;

  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-numeric: 'Rajdhani', var(--font);

  color-scheme: light;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  min-height: 100vh;
  background: var(--brand);
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- картка ---------- */

.card {
  background: var(--surface);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
}

.card__logo {
  display: block;
  width: 100%;
  height: auto;
  margin: 12px 0 34px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 34px;
}

.card__title {
  margin: 0;
  font-size: clamp(25px, 7.6vw, 34px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: clamp(32px, 9vw, 40px);
  padding: 0 clamp(10px, 3.4vw, 16px);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: clamp(11px, 3.2vw, 14px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge__icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

/* ---------- підсумок ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: clamp(12px, 3.6vw, 16px) 0;
  border-radius: var(--block-radius);
  background: var(--brand-soft);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 clamp(6px, 2.6vw, 12px);
  min-width: 0;
}

.stat + .stat { border-left: 1px solid var(--brand-line); }

.stat__label {
  font-size: clamp(11px, 3.2vw, 13px);
  line-height: 1.2;
  color: var(--ink-label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat__value {
  display: flex;
  align-items: baseline;
  gap: 0.22em;
  min-width: 0;
  white-space: nowrap;
}

/* макет: Rajdhani Bold, 91.51px на картці 988px, line-height 80%, tracking -4% */
.stat__value b {
  font-family: var(--font-numeric);
  font-size: clamp(29px, 8.2vw, 44px);
  line-height: 0.8;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.stat__value i {
  font-size: clamp(11px, 3.2vw, 16px);
  font-style: normal;
  font-weight: 600;
}

/* ---------- рядки ---------- */

.rows {
  margin: 28px 0 0;
  padding: 0;
}

.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.row__label {
  flex: none;
  font-size: clamp(15px, 4.5vw, 17px);
  line-height: 1.35;
  font-weight: 700;
}

.row__value {
  margin: 0;
  font-size: clamp(15px, 4.5vw, 17px);
  line-height: 1.35;
  color: var(--ink-muted);
  text-align: right;
  overflow-wrap: anywhere;
}

.row__value_address { max-width: 62%; }

/* ---------- повідомлення ---------- */

.note {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: var(--block-radius);
  background: var(--brand-soft);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-muted);
  text-align: center;
}

.note_error {
  background: #fdecf1;
  color: #a63b5b;
}

/* ---------- дії ---------- */

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(54px, 15vw, 64px);
  margin-top: 28px;
  padding: 12px 20px;
  border-radius: var(--block-radius);
  background: var(--brand);
  color: #fff;
  font-size: clamp(15px, 4.4vw, 18px);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
}

.button:active { background: #2f63cd; }

.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  margin-top: 22px;
  padding: 12px 20px;
  border-radius: var(--block-radius);
  background: var(--brand-soft);
  color: var(--brand);
  text-decoration: none;
}

.site__name {
  font-size: clamp(14px, 4.2vw, 16px);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.site__arrow {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ---------- лоадер ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.loader__spinner {
  width: 72px;
  height: 72px;
  border: 7px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .loader__spinner { animation-duration: 3s; }
}

/* ---------- вузькі екрани ---------- */

@media (max-width: 359px) {
  body { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
}
