[x-cloak] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root {
  --color-navy: #003b6f;
  --color-navy-deep: #002a4f;
  --color-orange: #ff8c2a;
  --color-orange-hover: #e67a22;
  --color-bg: #f5f7fa;
  --color-card: #ffffff;
  --color-muted: #6b7280;
  --color-profile-meta: #acb9c1;
  --color-accent-soft: #e6f2ff;
  --color-link: #2b8fda;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(0, 59, 111, 0.08);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--color-bg);
  color: #1f2937;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* Единый синий заголовков: --color-navy. Исключены блоки главной (.home-bg) и оранжевый .hero-landing h1 ниже по файлу. */
main h1:not(.home-hero__title),
main h2:not(.home-section-title),
main h3:not(.home-section-title) {
  color: var(--color-navy);
}

a {
  color: var(--color-link);
}

.site-header {
  background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-navy-deep) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.site-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, var(--color-orange) 45%, var(--color-navy) 100%);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__text small {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.85;
}

.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  opacity: 0.95;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  padding: 0.55rem 1.25rem 0.75rem;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #fff;
  border-bottom-color: var(--color-orange);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--color-orange);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-orange-hover);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-secondary {
  background: #ffe3cc;
  color: var(--color-navy);
}

.btn-secondary:hover {
  filter: brightness(0.97);
}

main {
  flex: 1;
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* Хлебные крошки — тот же стиль, что на списке школ и карточке школы */
.ss-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
  gap: 0.625rem 0.75rem;
  min-height: 1.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.ss-breadcrumbs a,
.ss-breadcrumbs span {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.ss-breadcrumbs a {
  color: #005d96;
  text-decoration: none;
}

.ss-breadcrumbs a:hover {
  text-decoration: underline;
}

.ss-breadcrumbs span {
  color: #acb9c1;
}

.ss-breadcrumbs .ss-icon {
  flex-shrink: 0;
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

/* Верхнюю часть задаёт только .container (.spd-page > .container и т.д.) */
.ss-page,
.spd-page,
.events-page,
.al-page,
.cl-page,
.auth-page {
  padding-top: 0;
}

.ss-page > .container,
.spd-page > .container,
.events-page > .container,
.al-page > .container,
.cl-page > .container,
.auth-page > .container,
.tp-fig > .container {
  padding-top: 1.5rem;
}

main > .container:not(.auth-page__inner) {
  padding-top: 1.5rem;
}

main .trainer-cabinet.container {
  padding-top: 1.5rem;
}

.page-hint {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 0 0 1rem;
  line-height: 1.45;
}

.page-back-row {
  margin: 1rem 0;
  font-size: 1rem;
  line-height: 1.5;
}

.page-back-row a {
  color: #005d96;
  text-decoration: none;
}

.page-back-row a:hover {
  text-decoration: underline;
}

.card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card h1,
.card h2 {
  color: var(--color-navy);
  margin-top: 0;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .form-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 2px rgba(255, 140, 42, 0.2);
}

.form-error {
  color: #b91c1c;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.form-field--invalid input,
.form-field--invalid select,
.form-field--invalid textarea {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.form-field__hint {
  display: none;
  color: #b91c1c;
  font-size: 0.75rem;
  line-height: 1.35;
  margin: 0.25rem 0 0;
}

.form-field--invalid .form-field__hint {
  display: block;
}

.form-field--consent {
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.form-field--consent.form-field--invalid {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.04);
}

.form-field__consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 500;
  margin-bottom: 0;
  cursor: pointer;
}

.form-field__consent-label input[type="checkbox"] {
  width: auto;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.login-forgot {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  text-align: right;
}

.login-forgot a {
  color: var(--color-orange, #ff8b00);
  text-decoration: none;
}

.login-forgot a:hover {
  text-decoration: underline;
}

.site-footer {
  background: var(--color-navy-deep);
  color: rgba(255, 255, 255, 0.88);
  margin-top: auto;
}

.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .site-footer__inner {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    align-items: start;
  }
}

.footer-col a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  display: block;
  padding: 0.2rem 0;
  font-size: 0.9rem;
}

.footer-col a:hover {
  opacity: 0.85;
}

.copyright {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 0.75rem;
}

.layout-dashboard {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 960px) {
  .layout-dashboard {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }
}

/* Мастер настроек турнира: без левого меню, шире рабочая область */
.layout-dashboard--no-sidebar .sidebar {
  display: none;
}

@media (min-width: 960px) {
  .layout-dashboard.layout-dashboard--no-sidebar {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.5rem 0;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  color: #374151;
  text-decoration: none;
  font-size: 0.92rem;
  border-left: 4px solid transparent;
}

.sidebar a:hover {
  background: #f9fafb;
}

.sidebar a.is-active {
  background: var(--color-accent-soft);
  border-left-color: var(--color-navy);
  color: var(--color-navy);
  font-weight: 600;
}

.sidebar-group {
  padding: 0.25rem 0 0.35rem;
}

.sidebar-group__label {
  display: block;
  padding: 0.5rem 1rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.sidebar-group.is-open .sidebar-group__label {
  color: var(--color-navy);
}

.sidebar-group__submenu a {
  padding: 0.5rem 1rem 0.5rem 1.65rem;
  font-size: 0.875rem;
}

.sidebar-group__submenu a.is-active {
  font-weight: 600;
}

.profile-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.stat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stat-badge {
  background: var(--color-accent-soft);
  color: var(--color-navy);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.data-table th {
  color: var(--color-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.badge {
  display: inline-block;
  background: var(--color-accent-soft);
  color: var(--color-navy);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ok-banner {
  background: #ecfdf5;
  color: #065f46;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 0;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.messages li {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: #ecfdf5;
  color: #065f46;
}

/* Всплывающие уведомления Django messages (автоскрытие через JS) */
@keyframes ls-toast-in {
  from {
    opacity: 0;
    transform: translate3d(20px, -8px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes ls-toast-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(16px, -6px, 0) scale(0.94);
  }
}

@keyframes ls-toast-timer-shrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.ls-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: auto;
  max-width: min(22rem, calc(100vw - 2rem));
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  pointer-events: none;
}

@media (max-width: 520px) {
  .ls-toast-stack {
    right: 0.75rem;
    left: 0.75rem;
    max-width: none;
    align-items: stretch;
  }

  .ls-toast {
    animation: ls-toast-in-mobile 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .ls-toast.ls-toast--hide {
    animation: ls-toast-out-mobile 0.45s cubic-bezier(0.4, 0, 1, 1) forwards;
  }
}

@keyframes ls-toast-in-mobile {
  from {
    opacity: 0;
    transform: translate3d(0, -12px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes ls-toast-out-mobile {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(0, -10px, 0) scale(0.94);
  }
}

.ls-toast {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0.75rem 1rem 0;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  font-size: 0.875rem;
  line-height: 1.45;
  font-weight: 500;
  overflow: hidden;
  animation: ls-toast-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ls-toast.ls-toast--hide {
  animation: ls-toast-out 0.45s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.ls-toast__text {
  padding-bottom: 0.7rem;
}

.ls-toast__timer {
  margin: 0 -1rem 0;
  height: 3px;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 0 0 9px 9px;
  overflow: hidden;
}

.ls-toast__timer-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  animation: ls-toast-timer-shrink 5s linear forwards;
}

.ls-toast--success .ls-toast__timer-bar {
  background: linear-gradient(90deg, #059669, #34d399);
}

.ls-toast--error .ls-toast__timer-bar {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.ls-toast--warning .ls-toast__timer-bar {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.ls-toast--info .ls-toast__timer-bar {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.ls-toast--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.ls-toast--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.ls-toast--warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.ls-toast--info {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}

.hero-landing {
  position: relative;
  color: #fff;
  text-align: center;
  padding: 4rem 1.25rem;
  background: linear-gradient(120deg, rgba(0, 29, 61, 0.92), rgba(0, 59, 111, 0.85)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect fill='%23001d3d' width='120' height='120'/%3E%3Cpath d='M0 60h120M60 0v120' stroke='%23ffffff' stroke-opacity='0.06'/%3E%3C/svg%3E");
  background-size: cover, 120px 120px;
}

.hero-landing h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0.5rem 0;
  color: var(--color-orange);
  letter-spacing: 0.08em;
}

.hero-landing p {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  line-height: 1.55;
  opacity: 0.95;
}

.scoreboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.scoreboard__team {
  flex: 1;
  text-align: center;
  font-weight: 700;
}

.scoreboard__score {
  font-size: 2.5rem;
  font-weight: 800;
}

.timer-display {
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  text-align: center;
  margin: 1rem 0;
  font-weight: 700;
  color: var(--color-navy);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.control-grid .btn-primary {
  width: 100%;
}

.control-grid .btn-secondary {
  width: 100%;
}
