/**
 * PUMPIO — Главный CSS
 * Тёмная спортивная тема, mobile-first
 */

/* ===== Переменные ===== */
:root {
    --primary: #FF5722;
    --primary-dark: #E64A19;
    --primary-light: #FF8A65;
    --primary-glow: rgba(255, 87, 34, 0.25);
    --accent: #FF9100;
    --brand: #1B3A8C;
    --brand-light: #2E4FA0;
    --bg: #0f0f13;
    --bg-elevated: #16161e;
    --bg-card: #1a1a24;
    --bg-card-hover: #1f1f2c;
    --bg-input: #12121a;
    --text: #e8e6e3;
    --text-secondary: #a8a8b8;
    --text-muted: #6a6a7a;
    --border: #2a2a3a;
    --border-light: #353545;
    --success: #4CAF50;
    --success-bg: rgba(76, 175, 80, 0.12);
    --warning: #FFC107;
    --warning-bg: rgba(255, 193, 7, 0.12);
    --error: #f44336;
    --error-bg: rgba(244, 67, 54, 0.12);
    --info: #29B6F6;
    --info-bg: rgba(41, 182, 246, 0.12);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --nav-height: 72px;
    --header-height: 56px;
    --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s ease;
}

/* ===== Сброс ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

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

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

img { max-width: 100%; height: auto; display: block; }

/* ===== Контейнер ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Шапка ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(15, 15, 19, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.logo {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
}

.logo img {
    height: 34px;
    width: auto;
}

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

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    overflow: hidden;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notif-badge {
    background: var(--error);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ===== Нижняя навигация ===== */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(15, 15, 19, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: all var(--transition);
    position: relative;
    text-decoration: none;
}

.nav-item:hover, .nav-item.active {
    color: var(--primary);
}

.nav-item.active svg {
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-item-add {
    width: 52px;
    height: 52px;
    background: var(--primary);
    border-radius: 50%;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -20px;
    box-shadow: 0 4px 20px var(--primary-glow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.nav-item-add:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(255, 87, 34, 0.4);
}

.nav-item-add span { display: none; }

.nav-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    background: var(--error);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Основной контент ===== */
.main-content {
    min-height: 100vh;
}

.auth-content {
    padding-top: calc(var(--header-height) + 16px);
    padding-bottom: calc(var(--nav-height) + 16px);
    padding-left: 16px;
    padding-right: 16px;
}

/* ===== Карточки ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-light);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* ===== Формы ===== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 15px;
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

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

.form-input::placeholder {
    color: var(--text-muted);
}

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

.form-error {
    color: var(--error);
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.form-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* ===== Кнопки ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255, 87, 34, 0.35);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--border-light);
    color: var(--text);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
}
.btn-ghost:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
    border-radius: var(--radius-lg);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== Flash-сообщения ===== */
.flash-container {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    left: 16px;
    right: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    animation: flashIn 0.3s ease;
}

.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(76, 175, 80, 0.25); }
.flash-error { background: var(--error-bg); color: var(--error); border: 1px solid rgba(244, 67, 54, 0.25); }
.flash-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(255, 193, 7, 0.25); }
.flash-info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(41, 182, 246, 0.25); }

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Заголовки страниц ===== */
.page-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ===== Auth-формы ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    padding: 40px 30px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 16px;
}

.auth-logo img {
    max-height: 80px;
    width: auto;
    margin: 0 auto;
}

.auth-logo-text {
    font-size: 32px;
    font-weight: 900;
    color: var(--brand);
    letter-spacing: 3px;
}

.auth-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    font-weight: 600;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ===== Футер (публичный) ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
}

.footer-logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Утилиты ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.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; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }

/* ===== Пустое состояние ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ===== Таблицы ===== */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

tr:last-child td { border-bottom: none; }

tr:hover td {
    background: var(--bg-card-hover);
}

/* ===== Бейджи ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: rgba(255,87,34,0.12); color: var(--primary); }

/* ===== Анимации ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ===== Адаптив ===== */
@media (min-width: 768px) {
    .auth-content {
        max-width: 800px;
        margin: 0 auto;
    }

    .nav-bottom {
        top: 0;
        bottom: auto;
        right: auto;
        width: 72px;
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        padding: 80px 0 20px;
        border-top: none;
        border-right: 1px solid var(--border);
    }

    .nav-item-add {
        margin-top: 8px;
        margin-bottom: 8px;
    }

    .auth-content {
        padding-left: 88px;
        padding-bottom: 16px;
    }

    .app-header {
        left: 72px;
    }
}

@media (min-width: 1024px) {
    .auth-content {
        max-width: 960px;
    }
}

/* ===== Лендинг ===== */
.landing-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255, 87, 34, 0.08) 0%, transparent 60%);
    animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 87, 34, 0.1);
    border: 1px solid rgba(255, 87, 34, 0.2);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(36px, 7vw, 64px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-section {
    padding: 80px 20px;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(255, 87, 34, 0.1);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 87, 34, 0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.feature-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Лендинг — навбар */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(15, 15, 19, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.landing-nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.landing-nav-links a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

/* ===== Pricing (тарифы) ===== */
.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

.pricing-toggle span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color var(--transition);
}

.pricing-toggle span.active-period {
    color: var(--text);
}

.toggle-switch {
    width: 52px;
    height: 28px;
    background: var(--border);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background var(--transition);
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform var(--transition);
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card.popular {
    border-color: var(--primary);
    box-shadow: 0 0 40px var(--primary-glow);
}

.pricing-card.popular::before {
    content: 'Популярный';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.pricing-price {
    font-size: 36px;
    font-weight: 900;
    margin: 12px 0 4px;
}

.pricing-price small {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.pricing-save {
    color: var(--success);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin: 20px 0;
}

.pricing-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-features li::before {
    content: '✓';
    color: var(--primary);
    font-weight: 800;
    font-size: 14px;
}

.pricing-features li.disabled {
    opacity: 0.4;
}

.pricing-features li.disabled::before {
    content: '—';
    color: var(--text-muted);
}
