/* Inter — https://rsms.me/inter/ (SIL OFL 1.1, fonts/LICENSE.txt), свой файл: не зависим от внешнего сайта */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/InterVariable.woff2") format("woff2");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* Все кнопки — один нейтральный фон, без цветных (синих) заливок */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --hint: #8a8a8e;
  --btn: #f0f0f0;
  --border: #e2e2e2;
  --error: #d93025;
  --star: #f5a623;
}

body.dark {
  --bg: #1c1c1e;
  --fg: #f2f2f2;
  --hint: #98989d;
  --btn: #2c2c2e;
  --border: #3a3a3c;
  --error: #ff6b5e;
}

/* Типографика: основной текст 400/16, кнопки и названия 500/16, заголовки 600/22, подписи 400/14 */
body {
  background: var(--bg); color: var(--fg); padding: 12px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; font-weight: 400; line-height: 1.45;
  font-feature-settings: "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }

#app { max-width: 480px; margin: 0 auto; }
.screen { display: none; animation: fade .15s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.logo { text-align: center; padding: 24px 0 8px; }
.logo-img { height: 34px; display: inline-block; }
.welcome { text-align: center; color: var(--hint); margin-bottom: 20px; }
h2 { font-size: 22px; font-weight: 600; line-height: 1.25; margin: 14px 0 12px; }
p { margin-bottom: 14px; }

.hint, .field label, .product-meta, .card-meta, .summary .k, .error, .badge { font-size: 14px; font-weight: 400; }

.menu { display: flex; flex-direction: column; gap: 10px; }
#screen-education > .menu { margin-bottom: 16px; }

.btn {
  display: block; width: 100%; border: none; border-radius: 10px;
  padding: 14px 16px; font-size: 16px; font-weight: 500; cursor: pointer; text-align: center;
  text-decoration: none; background: var(--btn); color: var(--fg);
}
.btn:active, .chip:active, .step:active { opacity: .7; }
.btn:disabled { opacity: .5; }
.btn.primary { margin-top: 18px; }

.back { background: none; border: none; color: var(--fg); font-size: 16px; font-weight: 500; cursor: pointer; padding: 8px 0; }

.field { margin-bottom: 16px; }
.field label { display: block; color: var(--hint); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 12px; font-size: 16px; font-weight: 400; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg); color: var(--fg); resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--fg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 18px; border: 1.5px solid transparent;
  background: var(--btn); color: var(--fg); font-size: 16px; font-weight: 500; cursor: pointer;
}
/* Выбранный вариант — рамкой, фон тот же, что у остальных кнопок */
.chip.selected { border-color: var(--fg); }

.summary { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.summary .row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.summary .row:last-child { border-bottom: none; }
.summary .k { width: 45%; color: var(--hint); }
.summary .v { width: 55%; word-break: break-word; }

.error { color: var(--error); margin-top: 10px; text-align: center; }

.success-icon { font-size: 48px; font-weight: 600; text-align: center; padding: 40px 0 12px; }
.success-image { display: block; width: 100%; max-width: 320px; aspect-ratio: 1; object-fit: cover; margin: 24px auto 8px; border-radius: 16px; }
#screen-success { text-align: center; }
#success-text { margin: 12px 0 16px; }
#success-text a { color: var(--fg); text-decoration: underline; }
#screen-success .summary { text-align: left; margin-bottom: 16px; }
#screen-success .btn { margin-top: 10px; }
#success-footer { margin: 0 0 6px; font-weight: 500; }

.hint { color: var(--hint); margin-bottom: 12px; }
.btn.small { display: inline-block; width: auto; padding: 8px 14px; margin-left: 6px; white-space: nowrap; }

.product, .cart-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
#products-list .product:last-child { border-bottom: none; margin-bottom: 14px; }
#free-input-wrap { margin-top: 4px; }
.product-info { flex: 1; min-width: 0; }
.product-name { font-size: 16px; font-weight: 500; overflow-wrap: break-word; }
.product-meta { color: var(--hint); margin-top: 2px; }

.stepper { display: flex; align-items: center; gap: 6px; }
.step {
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: var(--btn); color: var(--fg); font-size: 16px; font-weight: 500; cursor: pointer;
}
.qty-input {
  width: 52px; height: 34px; padding: 0 4px; text-align: center; font-size: 16px; font-weight: 500;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--fg);
}
.qty-input:focus { outline: none; border-color: var(--fg); }
.qty-unit { color: var(--hint); font-size: 14px; }

.free-row { display: flex; gap: 8px; }
.free-row input { flex: 1; }
.free-row .btn.small { margin-left: 0; align-self: stretch; }

#cart-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50;
  max-width: 456px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--btn); color: var(--fg);
  font-size: 16px; font-weight: 500; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
#cart-bar[hidden] { display: none; }

/* ---------- Мои заказы, мероприятия ---------- */
.card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; }
.card-meta { color: var(--hint); margin-top: 4px; }
.card-body { margin-top: 6px; overflow-wrap: break-word; }
.card .btn.small { margin: 10px 8px 0 0; }
.badge { padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border); color: var(--hint); white-space: nowrap; }

/* ---------- Отзывы ---------- */
.stars { display: flex; gap: 6px; margin-bottom: 16px; }
.stars button { font-size: 34px; line-height: 1; background: none; border: none; color: var(--border); cursor: pointer; padding: 0 2px; }
.stars button.on { color: var(--star); }

/* ---------- Фото к заявке ---------- */
.photo-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.photo-previews .ph { position: relative; }
.photo-previews img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; display: block; }
.photo-previews .ph button {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--btn); color: var(--fg);
  font-size: 16px; font-weight: 500; line-height: 22px; cursor: pointer;
}
#f-photos .btn.small { margin-left: 0; }
