/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --black:     #050505;
    --dark:      #111111;
    --dark2:     #1a1a1a;
    --mid:       #2b2b2b;
    --mid2:      #3a3a3a;
    --gray:      #777;
    --gray-l:    #aaa;
    --light:     #f0f0f0;
    --white:     #ffffff;
    --bg:        #f2f2f0;
    --red:       #e8001d;
    --red-h:     #c4001a;
    --red-glow:  rgba(232,0,29,.25);
    --gold:      #d4a017;
    --orange:    #ff6a00;
    --orange-h:  #e65f00;
    --font-h:    'Barlow Condensed', 'Oswald', Arial, sans-serif;
    --font-b:    'Barlow', Arial, sans-serif;
    --radius:    3px;
    --radius-lg: 6px;
    --trans:     0.2s ease;
    --trans-slow:0.4s ease;
    --shadow:    0 4px 24px rgba(0,0,0,.22);
    --shadow-lg: 0 12px 48px rgba(0,0,0,.35);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-b);
    font-weight: 400;
    font-size: 17px;
    color: var(--dark);
    background: var(--bg);
    line-height: 1.65;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

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

/* =========================================
   USER INFO BAR
   ========================================= */
.user-info-bar {
    background: rgba(0, 0, 0, 0.85);
    border-bottom: 1px solid rgba(220, 38, 38, 0.4);
    padding: 5px 0;
    font-size: 12px;
    color: #aaa;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
}
.user-info-bar .container {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-info-bar__name {
    color: #e5e5e5;
    font-weight: 500;
}
.user-info-bar__role {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================
   HEADER
   ========================================= */
.has-user-bar .site-header {
    top: 29px;
}
.has-user-bar .site-main {
    margin-top: calc(68px + 29px);
    min-height: calc(100vh - 68px - 29px);
}

.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(5,5,5,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(232,0,29,.15);
    transition: border-color var(--trans), box-shadow var(--trans);
}

.site-header.header--scrolled {
    box-shadow: 0 2px 32px rgba(232,0,29,.12);
    border-bottom-color: rgba(232,0,29,.3);
}

.header-inner {
    display: flex;
    align-items: center;
    height: 68px;
    gap: 32px;
}

/* Logo — same stacked wordmark treatment as the footer, sized for the 68px header */
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.header-logo {
    font-family: var(--font-h);
    font-size: 18px;
    font-weight: 900;
    line-height: 0.92;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--white);
}

/* Navigation */
.main-nav {
    flex: 1;
}

.main-nav ul {
    display: flex;
    align-items: center;
    gap: 0;
}

.main-nav li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-family: var(--font-h);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--white);
    border-radius: 0;
    border: 2px solid rgba(255,255,255,.3);
    background: transparent;
    white-space: nowrap;
    position: relative;
    transition: background var(--trans), color var(--trans), border-color var(--trans);
}

.main-nav li + li { margin-left: -2px; }

.main-nav li a:hover {
    border-color: var(--white);
    background: rgba(255,255,255,.06);
    z-index: 1;
}

.main-nav li.selected a,
.main-nav li.active a,
.main-nav li a.selected,
.main-nav li a.active {
    background: var(--red) !important;
    border-color: var(--red) !important;
    color: var(--white) !important;
    z-index: 1;
}

/* Header buttons */
/* Расстояние задаётся gap, а не отступом у соседних кнопок: «Выйти» лежит
   внутри <form>, и правило вида .btn + .btn через него не срабатывало —
   последняя кнопка прилипала к предыдущей. */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-family: var(--font-h);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background var(--trans), color var(--trans), border-color var(--trans), box-shadow var(--trans), transform var(--trans);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.08);
    opacity: 0;
    transition: opacity var(--trans);
}

.btn:hover::before { opacity: 1; }

.btn--lg {
    padding: 14px 32px;
    font-size: 16px;
    letter-spacing: 0.12em;
}

.btn-primary {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.btn-primary:hover {
    background: var(--red-h);
    border-color: var(--red-h);
    box-shadow: 0 0 24px var(--red-glow);
    transform: translateY(-1px);
}

/* Outline button. The default is for light surfaces (cabinet pages, panels);
   dark surfaces flip it to white below. Getting this the other way round makes
   the button invisible on every page that isn't dark. */
.btn-outline {
    background: transparent;
    color: var(--dark);
    border-color: rgba(0,0,0,.25);
}

.btn-outline:hover {
    border-color: var(--dark);
    background: rgba(0,0,0,.04);
    transform: translateY(-1px);
}

/* Dark surfaces: the header (including its mobile dropdown) and the dark
   home-page sections. */
.site-header .btn-outline,
.section--dark .btn-outline,
.section--black .btn-outline,
.home-hero .btn-outline,
.home-cta .btn-outline {
    color: var(--white);
    border-color: rgba(255,255,255,.3);
}

.site-header .btn-outline:hover,
.section--dark .btn-outline:hover,
.section--black .btn-outline:hover,
.home-hero .btn-outline:hover,
.home-cta .btn-outline:hover {
    border-color: var(--white);
    background: rgba(255,255,255,.06);
}

/* Burger */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px; height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}

.burger span {
    display: block;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform var(--trans), opacity var(--trans);
    transform-origin: center;
}

.burger--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger--open span:nth-child(2) { opacity: 0; }
.burger--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================
   MAIN CONTENT AREA
   ========================================= */
.site-main {
    min-height: calc(100vh - 68px);
    margin-top: 68px;
    padding-bottom: 60px;
    background:
        repeating-linear-gradient(
            -55deg,
            transparent,
            transparent 28px,
            rgba(0,0,0,.018) 28px,
            rgba(0,0,0,.018) 29px
        ),
        var(--bg);
}

/* =========================================
   HOME HERO
   ========================================= */
.home-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--black);
    overflow: hidden;
    margin-top: -68px;
    padding-top: 68px;
}

.home-hero__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 70% 50%, rgba(232,0,29,.12) 0%, transparent 70%),
        radial-gradient(ellipse 50% 80% at 20% 80%, rgba(232,0,29,.06) 0%, transparent 60%),
        linear-gradient(135deg, #050505 0%, #111 50%, #0a0a0a 100%);
}

.home-hero__noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
}

/* Diagonal accent line */
.home-hero::before {
    content: '';
    position: absolute;
    top: 0; right: 15%;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--red), transparent);
    opacity: 0.3;
}

.home-hero__content {
    position: relative;
    z-index: 1;
    padding-top: 80px;
    padding-bottom: 80px;
}

.home-hero__label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-h);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 24px;
}

.home-hero__label::before {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    background: var(--red);
}

.home-hero__title {
    font-family: var(--font-h);
    font-size: clamp(64px, 10vw, 130px);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 28px;
}

.home-hero__title em {
    color: var(--red);
    font-style: normal;
    display: block;
}

.home-hero__sub {
    font-size: 18px;
    color: rgba(255,255,255,.6);
    margin-bottom: 40px;
    max-width: 520px;
    line-height: 1.65;
}

.home-hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.home-hero__scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.home-hero__scroll-hint span {
    display: block;
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, rgba(255,255,255,.4), transparent);
    animation: scrollPulse 1.6s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.15); }
}

/* =========================================
   HOME STATS BAR
   ========================================= */
.home-stats {
    background: var(--red);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.home-stats::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 20px,
        rgba(0,0,0,.06) 20px,
        rgba(0,0,0,.06) 40px
    );
}

.home-stats__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: relative;
    z-index: 1;
}

.home-stats__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,.15);
    transition: background var(--trans);
}

.home-stats__item:last-child { border-right: none; }
.home-stats__item:hover { background: rgba(0,0,0,.12); }

.home-stats__num {
    font-family: var(--font-h);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 900;
    color: var(--white);
    line-height: 1;
    letter-spacing: -0.01em;
}

.home-stats__num em {
    font-style: normal;
    font-size: 0.6em;
    opacity: 0.8;
}

.home-stats__label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.75);
    margin-top: 6px;
    font-family: var(--font-h);
}

/* =========================================
   HOME FEATURES
   ========================================= */
.home-features {
    padding: 96px 0;
    background: var(--dark);
    position: relative;
    overflow: hidden;
}

.home-features::before {
    content: 'SPORT';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    font-family: var(--font-h);
    font-size: 180px;
    font-weight: 900;
    color: rgba(255,255,255,.02);
    letter-spacing: 0.1em;
    pointer-events: none;
    white-space: nowrap;
}

.home-features .section-title { color: var(--white); }
.home-features .section-sub { color: var(--gray); }

.home-features__header {
    margin-bottom: 56px;
}

.home-features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.home-feature {
    background: var(--dark2);
    padding: 48px 36px;
    position: relative;
    overflow: hidden;
    transition: background var(--trans-slow), transform var(--trans-slow);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
}

.home-feature::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px;
    height: 0;
    background: var(--red);
    transition: height var(--trans-slow);
}

.home-feature:hover {
    background: #1f1f1f;
    transform: translateY(-4px);
}

.home-feature:hover::before { height: 100%; }

.home-feature__icon {
    font-size: 36px;
    margin-bottom: 20px;
    display: block;
    filter: saturate(1.5);
}

.home-feature__title {
    font-family: var(--font-h);
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--white);
    margin-bottom: 12px;
}

.home-feature__text {
    font-size: 14px;
    color: var(--gray-l);
    line-height: 1.7;
}

/* =========================================
   HOME CTA
   ========================================= */
.home-cta {
    position: relative;
    padding: 100px 0;
    background: var(--black);
    text-align: center;
    overflow: hidden;
}

.home-cta__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 50% 50%, rgba(232,0,29,.15) 0%, transparent 70%);
}

/* big diagonal stripes */
.home-cta::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: repeating-linear-gradient(
        -55deg,
        transparent,
        transparent 60px,
        rgba(232,0,29,.03) 60px,
        rgba(232,0,29,.03) 62px
    );
}

.home-cta__content {
    position: relative;
    z-index: 1;
}

.home-cta__title {
    font-family: var(--font-h);
    font-size: clamp(42px, 7vw, 88px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--white);
    margin-bottom: 16px;
}

.home-cta__sub {
    font-size: 18px;
    color: rgba(255,255,255,.55);
    margin-bottom: 40px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   HERO SECTION (generic, for inner pages)
   ========================================= */
.hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    background: var(--black);
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--red), transparent);
    opacity: 0.5;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    filter: grayscale(30%);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--white);
    max-width: 660px;
    padding: 80px 0;
}

.hero-content h1 {
    font-family: var(--font-h);
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero-content h1 em {
    color: var(--red);
    font-style: normal;
}

.hero-content p {
    font-size: 18px;
    opacity: 0.75;
    margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* =========================================
   PAGE SECTION
   ========================================= */
.section {
    padding: 72px 0;
}

.section--dark {
    background: var(--dark);
    color: var(--white);
}

.section--gray {
    background: var(--bg);
}

.section--black {
    background: var(--black);
    color: var(--white);
}

.section-title {
    font-family: var(--font-h);
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
    line-height: 1.05;
}

.section-title span { color: var(--red); }

.section-sub {
    color: var(--gray);
    font-size: 16px;
    margin-bottom: 40px;
}

/* =========================================
   CARDS
   ========================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 20px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--trans), box-shadow var(--trans);
    border: 1px solid rgba(0,0,0,.06);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card__img {
    width: 100%; height: 200px;
    object-fit: cover;
    background: var(--light);
}

.card__body { padding: 24px; }

.card__title {
    font-family: var(--font-h);
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.card__text { font-size: 14px; color: var(--gray); margin-bottom: 16px; }

.card__price {
    font-family: var(--font-h);
    font-size: 24px;
    font-weight: 900;
    color: var(--red);
}

/* =========================================
   PAGE CONTENT TYPOGRAPHY
   ========================================= */
.page-content {
    padding: 56px 0;
}

.page-content h1 {
    font-family: var(--font-h);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 24px;
}

.page-content h2 {
    font-family: var(--font-h);
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 36px 0 16px;
}

.page-content p { margin-bottom: 16px; }
.page-content a { color: var(--red); }
.page-content a:hover { text-decoration: underline; }

/* =========================================
   FORM STYLES (shared by auth/profile)
   ========================================= */
.form-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 48px 36px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 64px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
    border: 1px solid rgba(0,0,0,.06);
    position: relative;
}

.form-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--red);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.form-title {
    font-family: var(--font-h);
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 32px;
    text-align: center;
    position: relative;
    padding-bottom: 18px;
}

.form-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--red);
    border-radius: 2px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: var(--font-b);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--trans), box-shadow var(--trans);
    background: var(--white);
    color: var(--dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-glow);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-error {
    color: var(--red);
    font-size: 13px;
    margin-top: 5px;
    font-weight: 500;
}

.form-submit {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

.form-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--gray);
}

.form-links a { color: var(--red); font-weight: 600; }

/* =========================================
   BREADCRUMB
   ========================================= */
.breadcrumb {
    padding: 14px 0;
    font-size: 13px;
    color: var(--gray);
}

.breadcrumb a { color: var(--gray); }
.breadcrumb a:hover { color: var(--red); }
/* Разделитель между любыми крошками, а не только между двумя span:
   первой крошкой обычно идёт ссылка, и она оставалась без него. */
.breadcrumb > * + *::before { content: '/'; padding: 0 6px; }

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
    background: var(--black);
    color: rgba(255,255,255,.7);
    padding-top: 56px;
    border-top: 1px solid rgba(232,0,29,.2);
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--red) 30%, var(--red) 70%, transparent);
    opacity: 0.6;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
}

.footer-logo {
    display: block;
    font-family: var(--font-h);
    font-size: 40px;
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--white);
}

.footer-tagline {
    font-size: 14px;
    color: var(--white);
    margin-top: 20px;
    line-height: 1.6;
}

.footer-legal {
    font-size: 13px;
    color: var(--gray);
    margin-top: 16px;
    line-height: 1.7;
    max-width: 46ch;
}

.footer-nav { display: flex; gap: 40px; }

.footer-nav-col h4,
.footer-contacts h4 {
    font-family: var(--font-h);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 16px;
}

.footer-nav-col li { margin-bottom: 10px; }

.footer-nav-col a {
    font-size: 14px;
    color: var(--orange);
    transition: color var(--trans);
}

.footer-nav-col a:hover { color: var(--orange-h); }

.footer-contacts a {
    font-size: 14px;
    color: rgba(255,255,255,.8);
    transition: color var(--trans);
}

.footer-contacts a:hover { color: var(--white); }

.footer-contacts p { margin-bottom: 8px; font-size: 14px; }

.social-links {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    background: var(--orange);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-h);
    letter-spacing: 0.05em;
    transition: background var(--trans), transform var(--trans);
}

.social-link:hover {
    background: var(--orange-h);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid var(--mid);
    padding: 18px 0;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--gray);
}

.footer-bottom a { color: var(--gray); }
.footer-bottom a:hover { color: var(--white); }

/* =========================================
   BITRIX COMPONENTS — menu override
   ========================================= */
.main-nav > ul { display: flex; align-items: center; gap: 0; }
.main-nav > div > ul { display: flex; align-items: center; gap: 0; }

/* =========================================
   TRAINER DASHBOARD (td__)
   ========================================= */
.td {
    padding: 40px 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.td__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.td__header-left { display: flex; align-items: center; gap: 14px; }

.td__title {
    font-family: var(--font-h);
    font-size: 36px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.td__count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px; height: 32px;
    padding: 0 10px;
    background: var(--red);
    color: var(--white);
    border-radius: 100px;
    font-family: var(--font-h);
    font-size: 16px;
    font-weight: 700;
}

.td__header-right { display: flex; align-items: center; gap: 12px; }

.td__search {
    padding: 10px 16px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    outline: none;
    width: 260px;
    font-family: var(--font-b);
    transition: border-color var(--trans), box-shadow var(--trans);
}

.td__search:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-glow);
}

.td__select {
    padding: 10px 14px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    outline: none;
    font-family: var(--font-b);
    transition: border-color var(--trans);
    cursor: pointer;
}

.td__select:focus { border-color: var(--red); }

.td__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 20px;
}

.td__card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid rgba(0,0,0,.06);
    transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
    position: relative;
    overflow: hidden;
}

.td__card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--trans-slow);
}

.td__card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(232,0,29,.15);
}

.td__card:hover::before { transform: scaleX(1); }

.td__card-top { display: flex; align-items: flex-start; gap: 14px; }

.td__avatar {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--red) 0%, #900015 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-h);
    font-size: 18px;
    font-weight: 900;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.td__card-meta { flex: 1; min-width: 0; }

.td__name {
    font-family: var(--font-h);
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    transition: color var(--trans);
}

.td__name:hover { color: var(--red); }

.td__age, .td__city {
    font-size: 13px;
    color: var(--gray);
    display: inline-block;
    margin-right: 8px;
}

.td__badges { display: flex; flex-direction: column; gap: 4px; }

.td__badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 100px;
    font-family: var(--font-h);
    letter-spacing: 0.05em;
}

.td__badge--injury { background: #fff3cd; color: #856404; }
.td__badge--meds   { background: #d1ecf1; color: #0c5460; }

.td__stats { display: flex; flex-direction: column; gap: 8px; }

.td__stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--light);
}

.td__stat:last-child { border-bottom: none; padding-bottom: 0; }

.td__stat-label {
    color: var(--gray);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.06em;
}

.td__stat-value {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.td__contacts { display: flex; flex-direction: column; gap: 6px; }

.td__contact-link {
    font-size: 13px;
    color: var(--gray);
    display: block;
    transition: color var(--trans);
}

.td__contact-link:hover { color: var(--red); }

.td__notes {
    font-size: 13px;
    color: var(--gray);
    background: var(--light);
    border-radius: var(--radius);
    padding: 10px 14px;
    line-height: 1.6;
    border-left: 3px solid var(--red);
}

.td__actions { display: flex; gap: 8px; margin-top: auto; }

.td__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    font-family: var(--font-h);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background var(--trans), color var(--trans), border-color var(--trans);
}

.td__btn--primary {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.td__btn--primary:hover { background: var(--red-h); border-color: var(--red-h); }

.td__btn--outline {
    background: transparent;
    color: var(--dark);
    border-color: rgba(0,0,0,.2);
}

.td__btn--outline:hover { border-color: var(--red); color: var(--red); }

.td__empty, .td__no-results {
    text-align: center;
    color: var(--gray);
    font-size: 16px;
    padding: 64px 0;
    font-style: italic;
}

/* =========================================
   UTILITIES
   ========================================= */
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .home-features__grid { grid-template-columns: repeat(2, 1fr); }
    .home-stats__grid { grid-template-columns: repeat(2, 1fr); }
    .home-stats__item { border-right: none; border-bottom: 1px solid rgba(255,255,255,.15); }
    .home-stats__item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.15); }
    .home-stats__item:nth-child(3),
    .home-stats__item:nth-child(4) { border-bottom: none; }
}

@media (max-width: 900px) {
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-nav { flex-wrap: wrap; gap: 24px; }
}

@media (max-width: 768px) {
    .burger { display: flex; }

    .main-nav {
        display: none;
        position: absolute;
        top: 68px; left: 0; right: 0;
        background: rgba(5,5,5,.98);
        border-top: 1px solid var(--mid);
        padding: 16px 24px;
        backdrop-filter: blur(12px);
    }

    .main-nav.nav--open { display: block; }

    .main-nav ul,
    .main-nav > div > ul { flex-direction: column; align-items: flex-start; gap: 0; }

    .main-nav li a { padding: 12px 0; font-size: 18px; border: none; border-bottom: 1px solid rgba(255,255,255,.15); border-radius: 0; }

    .header-actions { display: none; }

    .home-hero__title { font-size: clamp(48px, 12vw, 90px); }
    .home-features__grid { grid-template-columns: 1fr; }
    .home-stats__grid { grid-template-columns: repeat(2, 1fr); }

    .card-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .form-wrap { padding: 32px 20px; }
    .section { padding: 48px 0; }
    .home-stats__grid { grid-template-columns: 1fr; }
    .home-stats__item { border-right: none !important; }
    .home-hero__actions { flex-direction: column; }
    .btn--lg { width: 100%; }
}

/* =========================================
   CABINET ADDITIONS (runordie-cabinet)
   ========================================= */

/* Flash messages */
.flash {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid;
}
.flash-success { background: #e7f6ec; color: #1f7a43; border-left-color: #1f7a43; }
.flash-error   { background: #fcebec; color: var(--red);  border-left-color: var(--red); }

/* Generic cabinet page wrapper */
.cab { padding: 48px 0; }
.cab .container { max-width: 1000px; }
.cab--wide .container { max-width: 1300px; }
.cab__title {
    font-family: var(--font-h);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}
.cab__title span { color: var(--red); }
.cab__sub { color: var(--gray); margin-bottom: 32px; overflow-wrap: anywhere; }
.cab__panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,.06);
    padding: 28px;
    margin-bottom: 24px;
}
.cab__panel h2 {
    font-family: var(--font-h);
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

/* Helper buttons (extend the design system) */
.btn-danger { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-danger:hover { background: var(--red-h); border-color: var(--red-h); }
.btn-light { background: #ececec; color: var(--dark); border-color: #ececec; }
.btn-light:hover { background: #e0e0e0; border-color: #e0e0e0; }
.btn-sm { padding: 6px 12px; font-size: 12px; letter-spacing: 0.06em; }
form.inline { display: inline-block; }

/* Переходы между разделами админки (includes/admin_nav.php) */
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }

/* Data table (admin users list, trainer clients) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}
.data-table th, .data-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--light);
    font-size: 14px;
    vertical-align: middle;
}
.data-table th {
    font-family: var(--font-h);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray);
    background: #fafafa;
}
.data-table tr:hover td { background: #fcfcfc; }

/* Phones: a multi-column table is wider than the screen. Let each table scroll
   on its own — body{overflow-x:hidden} would otherwise clip the right columns
   with no way to reach them. */
@media (max-width: 768px) {
    .data-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* display:block делает внутреннюю таблицу shrink-to-fit, и узкие таблицы
       (оплата, прошедшие тренировки) переставали занимать всю ширину панели.
       tbody как таблица на 100% возвращает ширину, но шире контейнера всё так
       же прокручивается. */
    .data-table > tbody { display: table; width: 100%; }
    .data-table th, .data-table td { padding: 10px 10px; }
}
.data-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.data-table select,
.data-table input[type="text"],
.data-table input[type="number"],
.data-table input[type="date"] {
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius);
    font-family: var(--font-b);
    font-size: 13px;
}
/* Native inputs render ~19px tall on a phone — too small to hit reliably. */
.data-table input[type="text"],
.data-table input[type="number"],
.data-table input[type="date"] { max-width: 100%; }
.tag {
    display: inline-block;
    font-family: var(--font-h);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 100px;
}
.tag--admin { background: rgba(232,0,29,.12); color: var(--red); }
.tag--role  { background: var(--light); color: var(--mid); }
.tag--blocked { background: rgba(232,0,29,.12); color: var(--red); }

/* Mobile: the burger toggles the action buttons (cabinet has no separate nav) */
@media (max-width: 768px) {
    #header-actions {
        display: none;
        position: absolute;
        top: 68px; left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        background: rgba(5,5,5,.98);
        border-top: 1px solid var(--mid);
        padding: 16px 24px;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    #header-actions.actions--open { display: flex; }
    #header-actions .btn,
    #header-actions form,
    #header-actions form .btn { width: 100%; }

    /* Trainer/admin client search & filter bar: fixed widths overflow on narrow screens */
    .td__header-right { width: 100%; flex-wrap: wrap; }
    .td__header-right form { width: 100%; }
    .td__select,
    .td__search { width: 100%; }
}

/* Multi-column form rows (profile) */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
/* min-width:0 — without it a flex item can never shrink below the intrinsic width
   of its control; iOS Safari gives date/select controls a wide intrinsic width,
   so the field overflowed its column and overlapped the neighbouring one. */
.form-row > .form-group { flex: 1 1 150px; min-width: 0; }

/* Controls must not push their column wider than the row allows. */
.form-group input,
.form-group select,
.form-group textarea { min-width: 0; max-width: 100%; }

/* iOS renders date/time inputs with a fixed intrinsic size; normalise them. */
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"] {
    -webkit-appearance: none;
    appearance: none;
}

/* Phones: one field per row — 150px columns leave no room for the labels. */
@media (max-width: 560px) {
    .form-row > .form-group { flex: 1 1 100%; }
}

/* Questionnaire controls */
.q-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.q-radio {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border: 2px solid #e0e0e0; border-radius: var(--radius);
    cursor: pointer; font-size: 14px; transition: border-color var(--trans), background var(--trans);
}
.q-radio:hover { border-color: var(--red); }
.q-radio input { accent-color: var(--red); }
.q-radio input:checked + span { color: var(--red); font-weight: 600; }

.q-check {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px; font-size: 15px; cursor: pointer;
}
.q-check input { width: 18px; height: 18px; accent-color: var(--red); flex-shrink: 0; }

.q-range { width: 100%; accent-color: var(--red); cursor: pointer; }
.q-badge {
    display: inline-block; min-width: 22px; text-align: center;
    background: var(--red); color: #fff; border-radius: 4px;
    font-family: var(--font-h); font-weight: 700; padding: 0 6px;
}

/* Build stamp — subtle, bottom-right of every page, never blocks clicks */
.build-stamp {
    position: fixed;
    right: 8px;
    bottom: 6px;
    z-index: 50;
    font-family: var(--font-b);
    font-size: 11px;
    line-height: 1;
    color: var(--gray);
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}
