/* ─── Переменные и база — подключается везде через base.html ─────────────── */

:root {
  /* Фирменные цвета кортов */
  --court-terracotta: #c0634a;
  --court-blue:       #3a7bd5;
  --court-pink:       #e07ca0;
  --court-green:      #2b9348;
  --court-training:   #8a7fc7;

  /* Тёмная палитра */
  --bg:           #1c1c1e;
  --bg-2:         #242426;
  --bg-3:         #2c2c2e;
  --surface:      #1c1c1e;
  --border:       rgba(255,255,255,0.09);
  --text:         #f0eeea;
  --text-2:       #a8a8b0;
  --text-3:       #68686e;

  /* Типографика */
  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "PT Sans", system-ui, sans-serif;

  /* Размеры */
  --stripe-h:   4px;
  --header-h:   64px;
  --radius:     12px;
  --radius-lg:  20px;
  --container:  1200px;

  /* Тени */
  --shadow:    0 2px 16px rgba(0,0,0,0.32);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.45);
}

/* ─── Сброс ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img    { display: block; max-width: 100%; height: auto; }
a      {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
button { 
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* ─── Контейнер ──────────────────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Полосы-акценты ─────────────────────────────────────────────────────── */
.brand-stripe       { display: flex; height: var(--stripe-h); width: 100%; }
.stripe             { flex: 1; }
.stripe--terracotta { background: var(--court-terracotta); }
.stripe--blue       { background: var(--court-blue); }
.stripe--pink       { background: var(--court-pink); }
.stripe--green      { background: var(--court-green); }

/* ─── Фирменный бордер-барбер ────────────────────────────────────────────── */
.barber-border {
  border: 4px solid transparent;
  background-image:
    linear-gradient(var(--bg-2), var(--bg-2)),
    repeating-linear-gradient(
      45deg,
      var(--court-terracotta) 0px,   var(--court-terracotta) 6px,
      var(--court-blue)       6px,   var(--court-blue)       12px,
      var(--court-pink)       12px,  var(--court-pink)       18px,
      var(--court-green)      18px,  var(--court-green)      24px
    );
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.barber-border--lg {
  border-radius: var(--radius-lg);
  border-width: 5px;
}
.barber-border--round {
  border-radius: 50%;
  border-width: 4px;
}

/* ─── Кнопки ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-sm  { padding: 8px 20px;  font-size: 14px; border-radius: 8px; }
.btn-md  { padding: 12px 28px; font-size: 15px; }
.btn-lg  { padding: 16px 40px; font-size: 17px; }

.btn-primary {
  background: var(--court-green);
  color: #fff;
  border-color: var(--court-green);
}
.btn-primary:hover { filter: brightness(1.12); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--text-2); }

.btn-ghost {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.18); }

/* ─── Секции ─────────────────────────────────────────────────────────────── */
.section        { padding: 88px 0; }
.section--alt   { background: var(--bg-2); }

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
  margin-bottom: 12px;
}
.section-sub {
  font-size: 17px;
  color: var(--text-2);
  margin-bottom: 48px;
  max-width: 560px;
}

/* ─── Хедер ──────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: 0;
}
.site-logo {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
  margin-right: auto;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-right: 32px;
}
.nav-link {
  font-size: 15px;
  color: var(--text-2);
  transition: color .15s;
}
.nav-link:hover { color: var(--text); }
/* активная страница — добавить через Jinja сравнением request.url.path */
.nav-link--active { color: var(--text); font-weight: 700; }

/* ─── Футер ──────────────────────────────────────────────────────────────── */
.site-footer { background: var(--bg-3); border-top: 1px solid var(--border); }
.footer-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 28px 0;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}
.footer-nav { display: flex; gap: 24px; flex: 1; }
.footer-nav a { font-size: 14px; color: var(--text-2); transition: color .15s; }
.footer-nav a:hover { color: var(--text); }
.footer-copy { font-size: 13px; color: var(--text-3); margin-left: auto; }

/* ─── Карта (заглушка) ───────────────────────────────────────────────────── */
.map-placeholder {
  height: 340px;
  background: var(--bg-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 15px;
}
.map-placeholder iframe {
  width: 100%; height: 100%;
  border: none; display: block;
}

/* ─── Мобильные ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .section   { padding: 56px 0; }
  .site-nav  { display: none; }
  .footer-inner {
    align-items: flex-start;
    gap: 18px;
    padding: 27px 18px;
  }
  .footer-nav { flex-direction: column; gap: 12px; }
  .footer-copy { margin-left: 0; }
}

/* ─── Тосты ──────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 21px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.toast {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', system-ui, sans-serif;
  padding: 8px 14px;
  margin-top: 6px;
  font-size: clamp(18px, 5vw, 25px);
  font-weight: 550;
  color: #000;
  border-radius: 10px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, rgba(255,255,255,0.91), rgba(255,255,255,0.8));
  background-blend-mode: overlay;
  border-width: 4px;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  pointer-events: auto;
  text-align: center;
  max-width: 90vw;
  word-break: break-word;
  transition:
  opacity 0.2s ease,
  transform 0.2s ease,
  height 0.3s ease,
  margin 0.3s ease,
  padding 0.3s ease,
  border-width 0.3s ease;
}
.toast-restricted {
  background: #f9e5e5;
  min-width: 60vw;
  font-size: 21px;
  border: 3px solid #aa5757;
}
.toast-error {
  background: #f4d7d7;
  border: 2px solid #fc7272;
}
.toast-book {
  background: var(--accent-light);
}
.toast-init {
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
}
.toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast-hiding {
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  height: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  border-bottom-width: 0;
}
.error { color: #c0392b; font-size: 13px; }