/* «Рис и Хмель» — общие цвета, шрифты и движения для сайта, админки и кухни.
   Цвета — из согласованной презентации: чёрный, кремовый, янтарный.
   Шрифты Oswald и Golos Text: файлы положить в /static/fonts и раскомментировать
   @font-face ниже (без Google Fonts). Пока — близкие системные. */

/*
@font-face { font-family: "Oswald"; src: url("/static/fonts/oswald.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "Golos Text"; src: url("/static/fonts/golos-text.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
*/

:root {
  color-scheme: dark;
  --bg: #161412;
  --surface: #1f1b18;
  --surface-2: #26221e;
  --surface-3: #2f2a25;
  --line: #3a352f;
  --text: #f3eee5;
  --muted: #a69e92;
  --faint: #6f675d;
  --amber: #f2a33a;
  --amber-2: #f6b65c;
  --amber-ink: #1d1406;
  --amber-soft: #2b2319;
  --ok: #7cc47f;
  --danger: #ec6a5c;
  --radius: 16px;
  --radius-s: 12px;
  --head: "Oswald", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  --body: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.45 var(--body); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--amber); color: var(--amber-ink); }

.h-display {
  font-family: var(--head); font-weight: 700; text-transform: uppercase;
  letter-spacing: .01em; line-height: 1.02; font-stretch: condensed;
}
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--amber);
}
.muted { color: var(--muted); }
.price { font-weight: 700; color: var(--amber); white-space: nowrap; }

/* Кнопки */
.btn {
  appearance: none; border: 0; border-radius: 14px; padding: 15px 18px;
  font-weight: 650; font-size: 16px; line-height: 1.1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s var(--ease), background-color .2s, opacity .2s, color .2s;
  text-decoration: none; user-select: none; -webkit-user-select: none; min-height: 48px;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn-amber { background: var(--amber); color: var(--amber-ink); }
.btn-amber:hover { background: var(--amber-2); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-line { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px #5a2d27; }
.btn-block { width: 100%; }
.btn-s { padding: 9px 14px; min-height: 38px; font-size: 14px; border-radius: 11px; }

/* Поля */
.field { display: block; margin: 0 0 12px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px 2px; }
.input {
  width: 100%; background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--radius-s);
  padding: 13px 14px; font-size: 16px; outline: none; transition: border-color .2s, background-color .2s;
}
.input:focus { border-color: var(--amber); background: var(--surface-3); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; min-height: 76px; }
select.input { appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }

/* Переключатели */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 4px; border-radius: 14px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 11px; padding: 11px 8px; font-weight: 600; cursor: pointer;
  color: var(--muted); transition: background-color .2s, color .2s; }
.seg button.on { background: var(--text); color: var(--bg); }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background-color .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #cfc8bd; transition: transform .22s var(--ease), background-color .2s; }
.switch input:checked + i { background: var(--amber); }
.switch input:checked + i::after { transform: translateX(18px); background: #fff; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 14px; line-height: 1.4; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border-radius: 7px;
  border: 1.5px solid var(--line); background: var(--surface-2); display: grid; place-content: center; transition: background-color .15s, border-color .15s; }
.check input::after { content: ""; width: 11px; height: 6px; border: 2.5px solid var(--amber-ink); border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(0); transition: transform .15s var(--ease); margin-top: -3px; }
.check input:checked { background: var(--amber); border-color: var(--amber); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 99px;
  background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge.amber { background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1px #5b4421; }
.badge.ok { background: #1f2c20; color: var(--ok); }
.badge.danger { background: #33201d; color: var(--danger); }

/* Движение: появление, раскрытие, уход */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; } }
.rise { animation: rise .26s var(--ease) backwards; }
.fade-in { animation: fade .22s ease-out backwards; }
body.leaving { opacity: 0; transition: opacity .16s ease-in; }

.reveal { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .28s var(--ease), opacity .22s, margin .28s var(--ease); }
.reveal > * { overflow: hidden; min-height: 0; }
.reveal.open { grid-template-rows: 1fr; opacity: 1; }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); display: flex; justify-content: center; pointer-events: none; z-index: 90; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 15px;
  max-width: min(92vw, 440px); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .25s var(--ease); }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #f6d3cd; color: #4d140c; }

html.booting .boot-hide { opacity: 0; }
.boot-hide { transition: opacity .25s ease-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
