@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================
   AirFlow design tokens — Apple / Telegram, светлая + тёмная
   Тема задаётся атрибутом data-theme на <html> ("light"|"dark").
   theme.js разрешает выбор (auto/light/dark) в конкретную тему
   ДО первой отрисовки. :root = светлая, [data-theme=dark] = тёмная.
   ============================================================ */
:root {
  color-scheme: light;
  /* шрифты */
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'Fira Code', 'JetBrains Mono', Menlo, Consolas, monospace;
  /* поверхности */
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;                 /* сплошные карточки/шиты/инпут в фокусе */
  --bg-surface: rgba(120,120,128,0.08);   /* вторичная заливка iOS */
  --bg-card: rgba(255,255,255,0.72);      /* стеклянная карточка */
  --bg-hover: rgba(0,0,0,0.04);
  --fill: rgba(120,120,128,0.10);         /* заливка инпута в покое */
  --fill-strong: rgba(120,120,128,0.16);
  /* линии */
  --border: rgba(0,0,0,0.08);
  --border-light: rgba(0,0,0,0.12);
  --hairline: rgba(0,0,0,0.10);
  /* текст */
  --text: #1d1d1f;
  --text-secondary: rgba(60,60,67,0.60);
  --text-muted: rgba(60,60,67,0.32);
  /* акцент — iOS System Blue */
  --accent: #007aff;
  --accent-light: #0a84ff;
  --accent-hover: #0071eb;
  --accent-glow: rgba(0,122,255,0.18);
  --accent-soft: rgba(0,122,255,0.10);
  --on-accent: #ffffff;
  /* семантические */
  --green: #34c759; --green-bg: rgba(52,199,89,0.12);
  --red: #ff3b30;   --red-bg: rgba(255,59,48,0.12);
  --orange: #ff9500;--orange-bg: rgba(255,149,0,0.12);
  /* шапка / хром */
  --header-bg: rgba(255,255,255,0.72);
  --header-border: rgba(0,0,0,0.06);
  --overlay: rgba(0,0,0,0.45);
  --toast-bg: #1d1d1f;
  --toast-text: #ffffff;
  --footer-bg: #1d1d1f;
  /* единая премиум-карточка */
  --card-bg: linear-gradient(165deg, #ffffff 0%, #f4f6f9 100%);
  --card-border: rgba(0,0,0,0.07);
  --card-highlight: inset 0 1px 0 rgba(255,255,255,0.9);
  --card-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 14px 34px rgba(15,23,42,0.07);
  --card-shadow-hover: 0 1px 2px rgba(0,0,0,0.05), 0 28px 60px rgba(0,122,255,0.16);
  /* радиусы / метрики */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-lg: 22px;
  --max-w: 1200px;
  --header-h: 64px;
  /* тени */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
  /* переходы */
  --transition-fast: 0.15s cubic-bezier(0.4,0,0.2,1);
  --transition-base: 0.3s cubic-bezier(0.4,0,0.2,1);
  --transition-spring: 0.5s cubic-bezier(0.34,1.56,0.64,1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --bg-surface: rgba(120,120,128,0.20);
  --bg-card: rgba(28,28,30,0.72);
  --bg-hover: rgba(255,255,255,0.06);
  --fill: rgba(120,120,128,0.24);
  --fill-strong: rgba(120,120,128,0.32);
  --border: rgba(255,255,255,0.10);
  --border-light: rgba(255,255,255,0.16);
  --hairline: rgba(255,255,255,0.12);
  --text: #f5f5f7;
  --text-secondary: rgba(235,235,245,0.60);
  --text-muted: rgba(235,235,245,0.32);
  --accent: #0a84ff;
  --accent-light: #409cff;
  --accent-hover: #2a90ff;
  --accent-glow: rgba(10,132,255,0.30);
  --accent-soft: rgba(10,132,255,0.16);
  --on-accent: #ffffff;
  --green: #30d158; --green-bg: rgba(48,209,88,0.16);
  --red: #ff453a;   --red-bg: rgba(255,69,58,0.16);
  --orange: #ff9f0a;--orange-bg: rgba(255,159,10,0.16);
  --header-bg: rgba(28,28,30,0.72);
  --header-border: rgba(255,255,255,0.08);
  --overlay: rgba(0,0,0,0.60);
  --toast-bg: #2c2c2e;
  --toast-text: #ffffff;
  --footer-bg: #0d0d0f;
  --card-bg: linear-gradient(165deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  --card-border: rgba(255,255,255,0.10);
  --card-highlight: inset 0 1px 0 rgba(255,255,255,0.07);
  --card-shadow: 0 1px 2px rgba(0,0,0,0.5), 0 16px 40px rgba(0,0,0,0.55);
  --card-shadow-hover: 0 1px 2px rgba(0,0,0,0.5), 0 30px 64px rgba(10,132,255,0.28);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.40);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.55);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.70);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Плавный кросс-фейд при смене темы. Класс theme-ready ставит
   theme.js после первой отрисовки — чтобы старт не анимировался.
   Ограничено цветовыми свойствами: transform/opacity не трогаем. */
.theme-ready,
.theme-ready *:not(.no-theme-fade) {
  transition-property: background-color, border-color, color, fill, stroke, box-shadow;
  transition-duration: 0.35s;
  transition-timing-function: cubic-bezier(0.4,0,0.2,1);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent; height: var(--header-h);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.site-header.scrolled {
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.site-header .header-nav a { color: var(--text-secondary); font-weight: 500; transition: color 0.3s; }
.site-header .header-nav a:hover { color: var(--accent); background: rgba(0,122,255,0.06); }
.site-header .header-logo {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.site-header .header-user, .site-header #headerName { color: var(--text); font-weight: 500; }

/* Hero slides up behind transparent header */
.hero { margin-top: calc(-1 * var(--header-h)); padding-top: calc(var(--header-h) + 80px); }
.header-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 24px;
}
.header-logo {
  font-size: 22px; font-weight: 900; letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-decoration: none;
}
.header-nav { display: flex; gap: 4px; margin-left: auto; }
.header-nav a {
  padding: 8px 16px; border-radius: var(--radius-xs); font-size: 14px; font-weight: 500;
  color: var(--text-secondary); transition: all 0.2s;
}
.header-nav a:hover, .header-nav a.active { color: var(--text); background: var(--bg-hover); }
.header-user { display: flex; align-items: center; gap: 10px; }
.header-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
}
.header-logout {
  font-size: 13px; color: var(--red); cursor: pointer; background: none; border: none;
  font-family: var(--font-sans); transition: opacity 0.2s;
}
.header-logout:hover { opacity: 0.8; }

/* ── Container ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 32px 24px; }

/* ── Hero ── */
.hero { text-align: center; padding: 80px 24px 60px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; top: -50%; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,122,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(38px, 6vw, 66px); font-weight: 700; letter-spacing: -0.025em;
  line-height: 1.06; margin-bottom: 16px;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 18px; color: var(--text-secondary); max-width: 500px; margin: 0 auto 32px; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm); font-family: var(--font-sans);
  font-size: 15px; font-weight: 600; cursor: pointer; border: none;
  transition: all 0.2s; letter-spacing: -0.2px; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 8px 25px var(--accent-glow); }
.btn-outline { background: transparent; border: 1px solid var(--border-light); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-light); background: rgba(0,122,255,0.05); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #e0352b; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }

/* ── Cards ── */
.card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--card-shadow), var(--card-highlight);
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}
.card:hover { border-color: var(--accent-soft); }
.card-glass {
  background: var(--card-bg); border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow), var(--card-highlight);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  margin-bottom: 6px; letter-spacing: 0.3px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--fill);
  color: var(--text); font-family: var(--font-sans); font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s; letter-spacing: -0.2px;
  -webkit-appearance: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input[readonly] { background: var(--bg-surface); color: var(--text-secondary); cursor: default; }
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .form-input { width: 100%; padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 10px; font-size: 18px;
  line-height: 1; color: var(--text-muted); transition: color 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.pw-toggle:hover { color: var(--text); }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238e8e93' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.form-checkbox input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }

/* ── Anti-bot «Я не робот» ── */
.botcheck { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-card);
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base); }
.botcheck:hover { border-color: var(--accent); }
.botcheck input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.botcheck__box { position: relative; flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px;
  border: 2px solid var(--border-light); background: var(--bg-elevated); box-sizing: border-box;
  transition: border-color var(--transition-base), background var(--transition-base), box-shadow var(--transition-fast); }
.botcheck__check { position: absolute; inset: 0; width: 100%; height: 100%;
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: scale(0.4); transform-origin: center;
  transition: opacity var(--transition-fast), transform var(--transition-spring); }
.botcheck input:checked ~ .botcheck__box { background: var(--green); border-color: var(--green); }
.botcheck input:checked ~ .botcheck__box .botcheck__check { opacity: 1; transform: scale(1); }
.botcheck input:focus-visible ~ .botcheck__box { box-shadow: 0 0 0 3px var(--accent-glow); }
.botcheck__label { display: flex; flex-direction: column; line-height: 1.25; }
.botcheck__title { font-size: 14px; font-weight: 600; color: var(--text); }
.botcheck__hint { font-size: 12px; color: var(--text-secondary); }
.botcheck__shield { margin-left: auto; width: 22px; height: 22px; flex-shrink: 0;
  fill: none; stroke: var(--text-muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke var(--transition-base); }
.botcheck input:checked ~ .botcheck__shield { stroke: var(--green); }
.botcheck.is-verified { border-color: var(--green); background: var(--green-bg); }
@media (prefers-reduced-motion: reduce) {
  .botcheck, .botcheck__box, .botcheck__check, .botcheck__shield { transition: none; }
}

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-floating {
  position: fixed; top: 20px; left: 0; right: 0; margin: 0 auto; z-index: 9999;
  max-width: 500px; width: 90%; animation: springIn 0.4s var(--transition-spring) both;
  box-shadow: var(--shadow-lg); pointer-events: auto;
}
body.miniapp .alert-floating { top: 70px; }
.error-alert-shake {
  position: fixed; top: 20px; left: 0; right: 0; margin: 0 auto; z-index: 9999;
  max-width: 440px; width: 90%; padding: 14px 24px; border-radius: var(--radius);
  background: var(--red); color: #fff; font-size: 14px; font-weight: 600;
  text-align: center; box-shadow: 0 8px 32px rgba(255,59,48,0.35);
  animation: shakeX 0.5s ease-in-out;
  pointer-events: auto;
}
body.miniapp .error-alert-shake { top: 70px; }
.alert-floating.alert-error { background: var(--red); color: #fff; border: none; }
.alert-floating.alert-success { background: var(--green); color: #fff; border: none; }
.alert-floating.alert-info { background: var(--accent); color: #fff; border: none; }
.alert-error { background: var(--red-bg); color: var(--red); border: 1px solid rgba(255,59,48,0.25); }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(52,199,89,0.25); }
.alert-info { background: rgba(0,122,255,0.1); color: var(--accent-light); border: 1px solid rgba(0,122,255,0.25); }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  box-shadow: var(--card-shadow), var(--card-highlight);
  padding: 20px; text-align: center; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-light); }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.stat-value.accent { color: var(--accent-light); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  padding: 12px 16px; text-align: left; font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary);
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase;
  white-space: nowrap;
}
.badge-blue { background: rgba(0,122,255,0.08); color: var(--accent-light); }
.badge-green { background: rgba(52,199,89,0.08); color: #1b8c3a; }
.badge-red { background: rgba(255,59,48,0.08); color: #d63024; }
.badge-orange { background: rgba(255,149,0,0.08); color: #cc7700; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; background: var(--bg-surface); border-radius: var(--radius-sm); padding: 4px; border: 1px solid var(--border); overflow-x: auto; }
.tab-btn {
  padding: 10px 20px; border-radius: 8px; border: none; background: transparent;
  color: var(--text-secondary); font-family: var(--font-sans); font-size: 14px;
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--accent); color: #fff; }

/* ── Search ── */
.search-box { position: relative; margin-bottom: 16px; }
.search-box .form-input { padding-left: 42px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; }

/* ── Filters ── */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-btn {
  padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  cursor: pointer; font-family: var(--font-sans); transition: all 0.2s; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent-light); background: var(--bg-elevated); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,122,255,0.25); }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.5);
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; max-width: 520px; width: 90%; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn 0.25s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.3px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-secondary); font-size: 22px; cursor: pointer;
}

/* ── Auth Pages ── */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-spacer { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px; width: 100%; max-width: 420px;
}


.animate-in { animation: fadeInUp 0.4s ease-out; }
.animate-in-delay-1 { animation: fadeInUp 0.4s ease-out 0.1s both; }
.animate-in-delay-2 { animation: fadeInUp 0.4s ease-out 0.2s both; }
.animate-in-delay-3 { animation: fadeInUp 0.4s ease-out 0.3s both; }
.loading {
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-hover) 50%, var(--bg-card) 100%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm);
}

/* ── Animations ── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes springIn { from { opacity: 0; transform: scale(0.85) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); } 50% { box-shadow: 0 0 0 12px transparent; } }
@keyframes shakeX { 0%,100% { transform: translateX(0); } 10%,30%,50%,70%,90% { transform: translateX(-4px); } 20%,40%,60%,80% { transform: translateX(4px); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(100%); } }
@keyframes drawLine { from { height: 0; } to { height: 100%; } }
@keyframes glowMove { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes countPop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes confettiFall { 0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }

/* Scroll reveal — скрыто до попадания в вид. Класс .reveal-on на <html>
   ставит site.js сразу (в <head>) → без JS контент остаётся видимым.
   .visible добавляет IntersectionObserver, когда элемент входит в экран. */
/* Плавное появление на transition (масляный easing). Базовое состояние —
   видимое; .reveal-on прячет до .visible. JS добавляет .visible → плавный переход. */
.reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-spring {
  opacity: 1; transform: none;
  transition: opacity 0.9s var(--ease-smooth), transform 0.9s var(--ease-smooth),
              background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
  will-change: opacity, transform;
}
.reveal-on .reveal:not(.visible)        { opacity: 0; transform: translateY(26px); }
.reveal-on .reveal-left:not(.visible)   { opacity: 0; transform: translateX(-26px); }
.reveal-on .reveal-right:not(.visible)  { opacity: 0; transform: translateX(26px); }
.reveal-on .reveal-scale:not(.visible)  { opacity: 0; transform: scale(0.965); }
.reveal-on .reveal-spring:not(.visible) { opacity: 0; transform: translateY(26px) scale(0.975); }
/* лёгкий каскад для сеток (через transition-delay) */
.features-wide .reveal:nth-child(2), .compare-grid .reveal:nth-child(2) { transition-delay: 0.07s; }
.features-wide .reveal:nth-child(3), .compare-grid .reveal:nth-child(3) { transition-delay: 0.14s; }
.features-wide .reveal:nth-child(4), .compare-grid .reveal:nth-child(4) { transition-delay: 0.21s; }
.features-wide .reveal:nth-child(5), .compare-grid .reveal:nth-child(5) { transition-delay: 0.28s; }
.features-wide .reveal:nth-child(6) { transition-delay: 0.35s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-spring { transition: none !important; }
  .reveal-on .reveal, .reveal-on .reveal-left, .reveal-on .reveal-right,
  .reveal-on .reveal-scale, .reveal-on .reveal-spring { opacity: 1 !important; transform: none !important; }
}

/* Stagger delays for child elements */
.stagger-children > *:nth-child(1) { animation-delay: 0.04s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.08s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.12s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.16s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.24s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.28s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.32s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.36s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.40s; }

.delay-1 { animation-delay: 0.1s; transition-delay: 0.08s; }
.delay-2 { animation-delay: 0.2s; transition-delay: 0.16s; }
.delay-3 { animation-delay: 0.3s; transition-delay: 0.24s; }
.delay-4 { animation-delay: 0.4s; transition-delay: 0.32s; }
.delay-5 { animation-delay: 0.5s; transition-delay: 0.40s; }
.delay-6 { animation-delay: 0.6s; transition-delay: 0.48s; }
.delay-7 { animation-delay: 0.7s; transition-delay: 0.56s; }
.delay-8 { animation-delay: 0.8s; transition-delay: 0.64s; }

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 0%, var(--bg-hover) 50%, var(--bg-surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin: 8px 0; border-radius: 4px; }
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-80 { width: 80%; }
.skeleton-text.w-40 { width: 40%; }
.skeleton-card { height: 120px; border-radius: var(--radius); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-header { height: 24px; width: 50%; margin-bottom: 12px; border-radius: 6px; }

/* Shake on error */
.shake { animation: shakeX 0.5s ease-in-out; }

/* Screen transitions */
.screen-enter { animation: fadeInUp 0.35s ease-out both; }
.screen-exit { animation: slideDown 0.25s ease-in both; }

/* Glass effect */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}

/* Glow button */
.btn-glow {
  position: relative; overflow: hidden;
}
.btn-glow::after {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
  animation: glowMove 3s ease infinite;
  background-size: 200% 200%;
}

/* Animated counter */
.counter-animate {
  display: inline-block;
  animation: countPop 0.4s var(--transition-spring) both;
}

/* Toast notification */
.toast-container {
  position: fixed; top: 72px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: var(--toast-text);
  background: var(--toast-bg);
  box-shadow: var(--shadow-lg);
  animation: springIn 0.4s var(--transition-spring) both;
  pointer-events: auto; max-width: 360px;
  display: flex; align-items: center; gap: 10px;
}
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-info { background: var(--accent); }

/* OTP Code Input — individual digit cells */
.code-input-group { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.code-input-group input {
  width: 48px; height: 54px; text-align: center; font-size: 22px; font-weight: 700;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text); outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.code-input-group input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Progress bar */
.progress-bar { height: 4px; background: var(--bg-surface); border-radius: 2px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.5s var(--transition-spring); }

/* Confetti container */
.confetti-container {
  position: fixed; inset: 0; pointer-events: none; z-index: 9998; overflow: hidden;
}
.confetti-piece {
  position: absolute; width: 10px; height: 10px;
  animation: confettiFall 3s ease-in forwards;
}

/* Pull to refresh indicator */
.pull-indicator {
  text-align: center; padding: 12px; color: var(--text-muted); font-size: 13px;
  transition: all 0.3s; overflow: hidden; max-height: 0;
}
.pull-indicator.active { max-height: 60px; }

/* Key code display */
.code-display {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 800; letter-spacing: 6px;
  color: var(--accent-light); text-align: center; padding: 12px;
  background: var(--bg-surface); border-radius: var(--radius-sm);
}

/* Animated timeline line */
.timeline-line {
  position: absolute; left: 15px; top: 0; bottom: 0; width: 2px;
  background: var(--border);
}
.timeline-line-fill {
  position: absolute; left: 0; top: 0; width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-light));
  transition: height 0.3s linear;
}

/* Social proof counter */
.stat-count-up { font-variant-numeric: tabular-nums; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Enhanced hover effects */
.card, .card-glass, .feature-card, .order-item, .stat-card {
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
}
.card:hover, .card-glass:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover), var(--card-highlight);
  border-color: var(--accent-soft);
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover), var(--card-highlight);
  border-color: var(--accent-soft);
}
.order-item:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(0,122,255,0.15);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}


/* ── Utility ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent-light); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.hidden { display: none; }

/* ── Pricing block ── */
.price-display {
  text-align: center; padding: 20px; background: rgba(0,122,255,0.08);
  border: 1px solid rgba(0,122,255,0.2); border-radius: var(--radius);
  margin-bottom: 20px;
}
.price-amount { font-size: 32px; font-weight: 900; color: var(--accent-light); letter-spacing: -1px; }
.price-label { font-size: 13px; color: var(--text-secondary); }

/* ── Tracking result ── */
.track-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-top: 16px;
}
.track-code { font-size: 20px; font-weight: 800; letter-spacing: 1px; color: var(--accent-light); }
.track-status { font-size: 16px; font-weight: 600; margin-top: 8px; }
.track-route { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ── Order list items ── */
.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
  margin-bottom: 12px;
  transition: all 0.25s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  display: flex; flex-direction: column; gap: 14px;
}
.order-card:hover {
  border-color: rgba(0,122,255,0.12);
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.order-card.cancelled { opacity: 0.6; }
.oc-header { display: flex; align-items: center; gap: 12px; }
.oc-status-icon {
  width: 38px; height: 38px; min-width: 38px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.oc-status-icon.new       { background: rgba(0,122,255,0.08); }
.oc-status-icon.progress  { background: rgba(255,149,0,0.08); }
.oc-status-icon.done      { background: rgba(52,199,89,0.08); }
.oc-status-icon.cancelled { background: rgba(255,59,48,0.08); }
.oc-tracking { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.oc-code {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 17px; letter-spacing: 1px; color: var(--text);
}
.oc-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.oc-body { display: flex; flex-direction: column; gap: 5px; }
.oc-row {
  display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-secondary);
}
.oc-row-icon {
  width: 26px; min-width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; background: var(--bg-surface);
}
.oc-row-icon.accent { background: rgba(0,122,255,0.08); }
.oc-row-icon.green  { background: rgba(52,199,89,0.08); }
.oc-row-icon.orange { background: rgba(255,149,0,0.08); }
.oc-row-icon.red    { background: rgba(255,59,48,0.08); }
.oc-row-text { flex: 1; line-height: 1.5; padding-top: 3px; }
.oc-row-text strong { color: var(--text); }
.oc-highlight {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 10px; font-size: 13px; font-weight: 500;
}
.oc-highlight.driver {
  background: rgba(52,199,89,0.04); border: 1px solid rgba(52,199,89,0.1);
}
.oc-highlight.driver .oc-row-icon { background: rgba(52,199,89,0.12); }
.oc-highlight.timer {
  background: rgba(255,59,48,0.04); border: 1px solid rgba(255,59,48,0.1); color: var(--red);
}
.oc-highlight.timer .oc-row-icon { background: rgba(255,59,48,0.1); }
.oc-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.oc-price { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--accent-light); }
.oc-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); }
.oc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.oc-actions .btn { padding: 8px 16px; font-size: 13px; border-radius: 10px; }
.oc-empty { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
.oc-empty-icon { font-size: 40px; margin-bottom: 8px; }

@media (max-width: 600px) {
  .order-card { padding: 16px 14px; }
  .oc-actions .btn { padding: 7px 12px; font-size: 12px; }
}

/* ── Feature cards (landing) ── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 20px;
  box-shadow: var(--card-shadow), var(--card-highlight);
  padding: 32px; transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base); text-align: center;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 12px 40px rgba(0,122,255,0.08); }
.feature-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 16px; }
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ── Profile Grid ── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 700px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* Profile card (shared) */
.profile-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

/* ── Personal Info Card ── */
.profile-avatar-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  margin-bottom: 24px;
}
.profile-avatar-area .btn-icon {
  position: absolute;
  top: 0;
  right: 0;
}
.profile-name-lg {
  font-size: 20px;
  font-weight: 700;
  margin-top: 12px;
  letter-spacing: -0.3px;
}
.profile-role-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-light);
  background: rgba(0,122,255,0.08);
  padding: 3px 12px;
  border-radius: 20px;
  margin-top: 6px;
}

/* Fields list */
.profile-fields-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 -28px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex: 1;
}
.profile-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
}
.profile-field-row + .profile-field-row {
  border-top: 1px solid var(--border);
}
.profile-field-icon {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.profile-field-label {
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1;
}
.profile-field-value {
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

/* Logout button */
.profile-logout-btn {
  margin-top: 16px;
  width: 100%;
}

/* ── Support Card ── */
.profile-support-card {
  padding: 28px;
}
.profile-support-head {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.profile-support-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.profile-support-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 -28px;
  flex: 1;
  display: flex;
  justify-content: center;
}
.profile-support-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: background 0.15s;
}
.profile-support-item + .profile-support-item {
  border-top: 1px solid var(--border);
}
.profile-support-item:hover {
  background: var(--bg-hover);
}
.profile-support-icon-wrap {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.profile-support-label {
  flex: 1;
  color: var(--text-secondary);
}
.profile-support-detail {
  font-weight: 500;
  font-size: 13px;
  color: var(--accent-light);
}

/* Avatar upload */
.avatar-upload-wrap {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 28px; color: #fff;
  cursor: pointer; flex-shrink: 0;
  position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  background-size: cover; background-position: center;
  box-shadow: 0 4px 16px rgba(0,122,255,0.25);
}
.avatar-upload-wrap:hover { transform: scale(1.05); box-shadow: 0 6px 24px rgba(0,122,255,0.35); }
.avatar-upload-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
  border-radius: 50%;
}
.avatar-upload-wrap:hover .avatar-upload-overlay { opacity: 1; }

/* Icon button (pencil) */
.btn-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-icon:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Address / City Autocomplete ── */
.autocomplete-wrapper { position: relative; }
.city-suggestions {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  max-height: 180px; overflow-y: auto;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1); display: none;
}
.city-suggestions.active { display: block; }
.city-suggestion {
  padding: 12px 14px; font-size: 14px; cursor: pointer;
  border-bottom: 1px solid var(--border); color: var(--text);
  transition: background 0.15s;
}
.city-suggestion:last-child { border-bottom: none; }
.city-suggestion:hover, .city-suggestion:active { background: var(--bg-hover); }
.city-suggestion.muted { color: var(--text-muted); cursor: default; font-style: italic; }

/* ── Payment Modal ── */
.pm-dialog {
  background: var(--bg-elevated);
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 92%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.15);
  animation: modalIn 0.25s ease-out;
}
.pm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}
.pm-title {
  font-size: 18px;
  font-weight: 700;
  display: block;
  color: var(--text);
}
.pm-code {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  display: block;
}
.pm-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0 4px;
}
.pm-close:hover { color: var(--text); }
.pm-amount {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent-light);
  margin-bottom: 16px;
}
.pm-status {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pm-spinner {
  width: 32px; height: 32px;
  margin: 0 auto 8px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: pmSpin 0.8s linear infinite;
}
@keyframes pmSpin { to { transform: rotate(360deg); } }
.pm-buttons { margin-top: 4px; }
.pm-method-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  margin-top: 8px;
}
.pm-success { text-align: center; }
.pm-success-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(52,199,89,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--green);
  margin: 0 auto 16px;
}
.pm-success-code {
  font-size: 24px; font-weight: 900;
  letter-spacing: 1px; color: var(--accent-light);
  margin: 8px 0;
}

/* ── Cookie Consent Banner ── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: rgba(29,29,31,0.96);
  color: rgba(255,255,255,0.85); padding: 14px 24px;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  font-size: 13px; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.cookie-banner p { margin: 0; max-width: 700px; line-height: 1.5; }
.cookie-banner a { color: var(--accent); text-decoration: underline; }
.cookie-banner button {
  padding: 8px 24px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: background 0.2s;
}
.cookie-banner button:hover { background: var(--accent-light); }

/* ── Legal Footer (for pages without full footer) ── */
.legal-footer {
  padding: 24px; text-align: center;
  border-top: 1px solid var(--border); font-size: 12px;
  color: var(--text-muted); background: var(--bg-surface);
  margin-top: auto;
}
.legal-footer-inner { max-width: var(--max-w); margin: 0 auto; }
.legal-footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.legal-footer-links a { color: var(--text-secondary); font-size: 13px; }
.legal-footer-links a:hover { color: var(--accent); }
.legal-footer-info { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .container { padding: 20px 16px; }
  .hero { padding: calc(var(--header-h) + 60px) 16px 40px; }
  .header-inner { padding: 0 16px; }
  .header-nav { gap: 2px; }
  .header-nav a { padding: 6px 10px; font-size: 13px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .features { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
  .modal { padding: 24px; margin: 16px; }
}

/* ── Site-wide animations ── */
html { scroll-behavior: smooth; }

/* Button press */
.btn:active { transform: scale(0.96) !important; transition: transform 0.1s ease !important; }
.submit-btn:active { transform: scale(0.97) !important; }

/* Card entrance stagger */
.order-card { animation: fadeInUp 0.4s ease-out both; }
.order-card:nth-child(1) { animation-delay: 0.03s; }
.order-card:nth-child(2) { animation-delay: 0.06s; }
.order-card:nth-child(3) { animation-delay: 0.09s; }
.order-card:nth-child(4) { animation-delay: 0.12s; }
.order-card:nth-child(5) { animation-delay: 0.15s; }

/* Form input focus glow */
.form-input, .form-select, .form-textarea {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  background: var(--bg-elevated); border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Tab button */
.tab-btn { transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.tab-btn:active { transform: scale(0.95); }

/* Filter button */
.filter-btn { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.filter-btn:active { transform: scale(0.94); }

/* Stat card hover */
.stat-card { transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease; }

/* Smooth link hover */
a { transition: color 0.2s ease, opacity 0.2s ease; }

/* Alert entrance */
.alert { animation: fadeInUp 0.3s ease-out both; }

/* Badge pulse for live status */
.badge-orange { animation: badgePulse 2s ease-in-out infinite; }
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── Focus-visible ── */
.btn:focus-visible, a:focus-visible, .form-input:focus-visible, .tab-btn:focus-visible, .filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Theme toggle (auto / light / dark) ── */
.theme-toggle {
  --tt-size: 38px;
  position: relative;
  width: var(--tt-size); height: var(--tt-size);
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--fill); color: var(--text);
  cursor: pointer; -webkit-tap-highlight-color: transparent; padding: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}
.theme-toggle:hover { background: var(--fill-strong); border-color: var(--border-light); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { position: absolute; width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle.tt-compact { --tt-size: 34px; }
.theme-toggle.tt-compact svg { width: 18px; height: 18px; }
.tt-auth-slot { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; z-index: 60; }
.theme-toggle .tt-ico {
  opacity: 0; transform: scale(0.4) rotate(-90deg);
  transition: opacity var(--transition-base), transform var(--transition-spring);
}
:root[data-theme="light"] .theme-toggle .tt-dark,
:root[data-theme="dark"]  .theme-toggle .tt-light {
  opacity: 1; transform: scale(1) rotate(0deg);
}
/* floating variant for pages without a header bar */
.theme-toggle.floating {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px; z-index: 60;
  background: var(--bg-card); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
}
body.miniapp .theme-toggle.floating { top: calc(env(safe-area-inset-top, 0px) + 70px); }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle .tt-ico { transition: opacity 0.01ms; transform: none !important; }
}

/* ── Print styles ── */
@media print {
  .site-header, .site-footer, .cookie-banner, .btn, .toast-container, nav { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card, .order-card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ── Аудит 2026-06-12: мобильная шапка не должна выезжать за вьюпорт ──
   .header-inner держала gap:24px на мобиле; при 4 флекс-элементах (лого/спейсер/навигация/тогл)
   это 72px пустот → тогл темы вылезал на 21px за 390px (горизонтальный скролл на /new-order). */
@media (max-width: 768px) {
  .header-inner { gap: 12px; }
}
@media (max-width: 430px) {
  .header-inner { gap: 8px; padding: 0 12px; }
  .theme-toggle { --tt-size: 34px; }
  .site-header { overflow-x: clip; } /* шапка-бар сама себя обрезает, не растягивая документ (страховка) */
}
/* Cookie-баннер на мобиле не должен залезать под чат-аватар (Алина, низ-право) */
@media (max-width: 600px) {
  .cookie-banner { justify-content: flex-start; text-align: left; padding-right: 88px; }
}
