/* Концепция: ретро-плакат о Таиланде и билет на обмен, который перекрывает его нижний край.
   Единая солнечная тема: Telegram-клиент может быть тёмным, но приложение остаётся светлым. */
:root {
  color-scheme: light;
  --sun: #F7A501;
  --sun-pale: #FFC93C;
  --tangerine: #EE5A1E;
  --tangerine-deep: #A83A0C;
  --sand: #FBEBC8;
  --paper: #FFF8E7;
  --sea: #0B6B74;
  --ink: #3A1A08;
  --ink-soft: #6F4A2E;
  --line: #E3C48F;

  --font-brand: 'Pattaya', 'Segoe Script', cursive;
  --font-display: 'Sofia Sans Extra Condensed', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Golos Text', 'Segoe UI', Roboto, Arial, sans-serif;
}

@font-face { font-family: 'Pattaya'; src: url('/fonts/pattaya-latin.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Sofia Sans Extra Condensed'; font-weight: 800; src: url('/fonts/sofia-cyrillic.woff2') format('woff2'); font-display: swap; unicode-range: U+0400-04FF, U+2116; }
@font-face { font-family: 'Sofia Sans Extra Condensed'; font-weight: 800; src: url('/fonts/sofia-latin.woff2') format('woff2'); font-display: swap; unicode-range: U+0000-03FF, U+2000-22FF; }
@font-face { font-family: 'Golos Text'; font-weight: 400; src: url('/fonts/golos-cyrillic-400.woff2') format('woff2'); font-display: swap; unicode-range: U+0400-04FF, U+2116; }
@font-face { font-family: 'Golos Text'; font-weight: 400; src: url('/fonts/golos-latin-400.woff2') format('woff2'); font-display: swap; unicode-range: U+0000-03FF, U+2000-22FF; }
@font-face { font-family: 'Golos Text'; font-weight: 600; src: url('/fonts/golos-cyrillic-600.woff2') format('woff2'); font-display: swap; unicode-range: U+0400-04FF, U+2116; }
@font-face { font-family: 'Golos Text'; font-weight: 600; src: url('/fonts/golos-latin-600.woff2') format('woff2'); font-display: swap; unicode-range: U+0000-03FF, U+2000-22FF; }

* { box-sizing: border-box; }

/* Скрытие должно работать и у элементов со своим display */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 400 15px/1.5 var(--font-body);
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }

/* Плакат */
.poster {
  position: relative;
  height: 272px;
  overflow: hidden;
  /* Лучи расходятся от центра солнца на рисунке */
  background: repeating-conic-gradient(from 0deg at 70.5% 62%, var(--sun) 0 9deg, var(--sun-pale) 9deg 18deg);
  padding: 18px max(16px, env(safe-area-inset-left, 0px)) 0;
}
.poster-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.brand { position: relative; display: flex; align-items: center; gap: 10px; }
.logo {
  flex: none;
  width: 62px;
  height: 62px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  overflow: hidden;
  background: var(--ink);
}
/* Увеличение убирает тёмные поля вокруг круглой эмблемы */
.logo img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.4); }
.wordmark {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-weight: 400;
}
.wordmark-top {
  font: 800 25px/1 var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.wordmark-name {
  font: 400 clamp(42px, 13vw, 50px)/1.12 var(--font-brand);
  color: var(--paper);
  text-shadow: 3px 3px 0 var(--ink);
}

/* Страница */
.page {
  position: relative;
  max-width: 560px;
  margin: -58px auto 0;
  padding-block: 0 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Билет */
.ticket {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
}
.ticket-part { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; }
.field-label {
  font: 800 19px/1 var(--font-display);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.amount {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  font: 800 58px/1.1 var(--font-display);
  font-variant-numeric: tabular-nums;
}
.amount::placeholder { color: var(--line); }

.segmented { display: flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.segment {
  border: 0;
  background: transparent;
  padding: 6px 13px;
  font-weight: 600;
  font-size: 14px;
}
.segment[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.segment:focus-visible { outline-offset: -5px; outline-color: var(--sun); }

.currency-fixed {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 6px 13px;
  font-weight: 600;
  font-size: 14px;
}

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: transparent;
  padding: 6px 11px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.chip:active { background: var(--sand); }

/* Линия отрыва с вырезами по краям билета */
.perforation {
  position: relative;
  display: flex;
  justify-content: center;
  border-top: 2px dashed var(--line);
  height: 0;
}
.perforation::before, .perforation::after {
  content: "";
  position: absolute;
  top: -14px;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--sand);
}
.perforation::before { left: -15px; clip-path: inset(0 0 0 50%); }
.perforation::after { right: -15px; clip-path: inset(0 50% 0 0); }
.rate-stamp {
  position: absolute;
  top: -15px;
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 2px 13px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.upgrade {
  border: 2px dashed var(--tangerine-deep);
  border-radius: 12px;
  background: transparent;
  padding: 10px 14px;
  text-align: left;
  color: var(--tangerine-deep);
  font-weight: 600;
  font-size: 14px;
}

.round-note { margin: -10px 0 -8px; color: var(--ink-soft); font-size: 14px; text-align: center; }

/* Блоки */
.block { display: flex; flex-direction: column; gap: 10px; }
.block-title {
  margin: 0;
  font: 800 25px/1.1 var(--font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  text-wrap: balance;
}

.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  padding: 14px 8px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
}
.method svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.method[aria-pressed="true"] { background: var(--sun); border-color: var(--ink); }

/* Заявка */
.submit-area { display: flex; flex-direction: column; gap: 10px; }
.notice {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 6px;
  background: var(--sun-pale);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  line-height: 1.35;
}
.notice strong { font-weight: 600; font-size: 15px; }
.cta {
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--tangerine);
  color: var(--paper);
  box-shadow: 0 5px 0 var(--ink);
  padding: 13px;
  font: 800 27px/1.1 var(--font-display);
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: transform .08s, box-shadow .08s;
}
.cta:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.cta:disabled { background: var(--line); border-color: var(--ink-soft); color: var(--ink-soft); box-shadow: none; cursor: not-allowed; }
.hint { margin: 0; color: var(--ink-soft); font-size: 14px; text-align: center; }
.hint:empty { display: none; }

/* Таблица курсов */
.rates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rate-card { background: var(--paper); border: 2px solid var(--line); border-radius: 14px; padding: 12px; }
.rate-card h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--sea); }
.rate-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; font-size: 13px; }
.rate-row + .rate-row { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 5px; }
.rate-row b { font: 800 22px/1.1 var(--font-display); }
.rates-error { grid-column: 1 / -1; margin: 0; }
.retry { background: none; border: 0; padding: 0; color: var(--tangerine-deep); font-weight: 600; text-decoration: underline; }

/* FAQ */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font: 800 30px/.8 var(--font-display);
  color: var(--tangerine-deep);
  transition: transform .15s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.answer { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; max-width: 65ch; color: var(--ink-soft); }
.answer p, .answer ol, .answer ul { margin: 0; }
.answer ol, .answer ul { display: flex; flex-direction: column; gap: 4px; padding-left: 20px; }
.answer ol { color: var(--ink); }

.ask {
  align-self: center;
  background: none;
  border: 0;
  border-bottom: 2px dashed var(--tangerine-deep);
  padding: 8px 2px 2px;
  color: var(--tangerine-deep);
  font-weight: 600;
}

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