/* index.php — Bootstrap 5 + Font Awesome 6 */

:root {
    --home-bg: #070b12;
    --home-border: rgba(148, 163, 184, 0.1);
    --home-text: #f1f5f9;
    --home-muted: #94a3b8;
    --home-cyan: #22d3ee;
    --home-emerald: #34d399;
    --home-gradient: linear-gradient(135deg, #0ea5e9 0%, #6366f1 45%, #a855f7 100%);
    --home-glow: radial-gradient(ellipse 100% 70% at 50% -25%, rgba(34, 211, 238, 0.22), transparent 50%);
    --home-glow-violet: radial-gradient(ellipse 60% 40% at 80% 20%, rgba(167, 139, 250, 0.12), transparent);
    --home-shadow-hover: 0 32px 64px -20px rgba(0, 0, 0, 0.5), 0 0 48px -16px rgba(34, 211, 238, 0.14);
    --home-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

body.home-page {
    font-family: 'Manrope', var(--bs-body-font-family), sans-serif;
    background: var(--home-bg) !important;
    color: var(--home-text);
    min-height: 100vh;
    overflow-x: hidden;
}

.home-page .bg-pattern {
    position: fixed;
    inset: 0;
    background: var(--home-glow-violet), var(--home-glow), linear-gradient(180deg, #070b12 0%, #0f172a 45%, #0a0e17 100%);
    z-index: -2;
}

.home-page .bg-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(34, 211, 238, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.028) 1px, transparent 1px);
    background-size: 56px 56px;
    z-index: -1;
}

.home-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Шапка */
.home-page header.navbar {
    padding: 0.75rem 0;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background: linear-gradient(180deg, rgba(7, 11, 18, 0.92) 0%, rgba(7, 11, 18, 0.85) 100%) !important;
    border-bottom: 1px solid var(--home-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

.home-page header .nav-link {
    color: var(--home-muted) !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: color 0.2s;
}

.home-page header .nav-link:hover {
    color: var(--home-cyan) !important;
}

.home-page header .nav-link i {
    font-size: 0.95em;
    opacity: 0.9;
}

.home-page header .navbar-toggler {
    color: var(--home-muted);
}

.home-page header .navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.35);
}

.home-page .logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--home-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-page .home-theme-toggle {
    cursor: pointer;
    flex-shrink: 0;
}

.home-page .home-nav-actions {
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.home-page .home-nav-actions .ui-theme-toggle .ui-theme-fa {
    font-size: 0.95rem;
    line-height: 1;
}

@media (min-width: 992px) {
    .home-page header.navbar .container {
        flex-wrap: nowrap;
    }

    .home-page header .navbar-collapse {
        flex-grow: 1;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .home-page header .navbar-nav {
        flex-wrap: nowrap !important;
    }

    .home-page .home-nav-actions {
        width: auto;
        margin-left: auto;
        padding-top: 0;
        border-top: none;
    }

    .home-page .home-nav-actions .ui-theme-toggle .ui-theme-toggle-label-full,
    .home-page .home-nav-actions .ui-theme-toggle .ui-theme-toggle-label-short {
        display: none !important;
    }

    .home-page .home-nav-actions .ui-theme-toggle {
        padding: 8px 10px;
        min-width: 38px;
        min-height: 38px;
        border-radius: 10px;
    }
}

@media (min-width: 1200px) {
    .home-page header .navbar-nav {
        gap: 0.35rem 0.65rem !important;
    }
}

@media (max-width: 991.98px) {
    .home-page header .navbar-nav + .home-nav-actions,
    .home-page .home-nav-actions {
        margin-top: 0.25rem;
    }

    .home-page .home-nav-actions .home-btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
    }
}

/* Кнопки */
.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    white-space: nowrap;
}

.home-btn-primary {
    background: var(--home-gradient);
    color: #fff;
}

.home-btn-primary:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 14px 44px -12px rgba(99, 102, 241, 0.55), 0 0 24px -8px rgba(34, 211, 238, 0.2);
}

.home-btn-outline {
    color: var(--home-text);
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.home-btn-outline:hover {
    color: var(--home-cyan);
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.08);
    transform: translateY(-2px);
}

.home-btn-sm {
    padding: 9px 16px;
    font-size: 0.88rem;
    border-radius: 10px;
}

/* Hero */
.home-hero {
    padding: 96px 0 72px;
    text-align: center;
}

.home-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin-bottom: 1.25rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--home-cyan);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.22);
}

.home-hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 22px;
    letter-spacing: -0.03em;
}

.home-hero h1 span {
    background: var(--home-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-hero-lead {
    font-size: 1.2rem;
    color: var(--home-muted);
    max-width: 580px;
    margin: 0 auto 1.75rem;
    line-height: 1.65;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2.5rem;
}

.home-hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.home-stat-card {
    min-width: 120px;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.65) 0%, rgba(30, 41, 59, 0.35) 100%);
    border: 1px solid var(--home-border);
}

.home-stat-card .stat-val {
    color: var(--home-cyan);
    font-weight: 800;
    font-size: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.home-stat-card .stat-val i {
    opacity: 0.9;
    font-size: 1.05rem;
}

.home-stat-card .stat-label {
    display: block;
    color: var(--home-muted);
    font-size: 0.82rem;
    margin-top: 4px;
    font-weight: 500;
}

/* Преимущества */
.home-features {
    padding: 0 0 56px;
}

.home-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.home-feature-card {
    padding: 1.35rem 1.25rem;
    border-radius: 18px;
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.35) 100%);
    border: 1px solid var(--home-border);
    transition: transform var(--home-transition), border-color var(--home-transition), box-shadow var(--home-transition);
}

.home-feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.22);
    box-shadow: var(--home-shadow-hover);
}

.home-feature-ico {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
    font-size: 1.1rem;
    color: #fff;
    background: var(--home-gradient);
}

.home-feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.home-feature-card p {
    margin: 0;
    color: var(--home-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

/* Протоколы */
.protocols-section {
    padding: 48px 0 88px;
}

.section-title {
    text-align: center;
    margin-bottom: 48px;
}

.section-title h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.section-title h2 i {
    color: var(--home-cyan);
}

.section-title p {
    color: var(--home-muted);
    font-size: 1.05rem;
}

.protocols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.protocol-card {
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.35) 100%);
    border: 1px solid var(--home-border);
    border-radius: 22px;
    padding: 30px;
    backdrop-filter: blur(18px);
    transition: transform var(--home-transition), border-color var(--home-transition), box-shadow var(--home-transition);
    position: relative;
    overflow: hidden;
}

.protocol-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 22px 22px 0 0;
    opacity: 0;
    transition: opacity var(--home-transition);
}

.protocol-card:hover {
    transform: translateY(-8px);
    border-color: rgba(34, 211, 238, 0.25);
    box-shadow: var(--home-shadow-hover);
}

.protocol-card:hover::before {
    opacity: 1;
}

.protocol-card.vless::before { background: linear-gradient(90deg, #22d3ee, #06b6d4); }
.protocol-card.vmess::before { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.protocol-card.trojan::before { background: linear-gradient(90deg, #ef4444, #dc2626); }
.protocol-card.reality::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.protocol-card.tuic::before { background: linear-gradient(90deg, #10b981, #059669); }
.protocol-card.hysteria::before { background: linear-gradient(90deg, #ec4899, #f43f5e); }
.protocol-card.wireguard::before { background: linear-gradient(90deg, #eab308, #84cc16); }
.protocol-card.ssh::before { background: linear-gradient(90deg, #64748b, #475569); }
.protocol-card.awg20::before { background: linear-gradient(90deg, #0ea5e9, #3b82f6); }
.protocol-card.awg15::before { background: linear-gradient(90deg, #14b8a6, #0d9488); }

.protocol-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 16px;
    color: #fff;
}

.protocol-icon i {
    font-size: 1.4rem;
}

.protocol-card.vless .protocol-icon { background: linear-gradient(135deg, #22d3ee, #06b6d4); }
.protocol-card.vmess .protocol-icon { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.protocol-card.trojan .protocol-icon { background: linear-gradient(135deg, #ef4444, #dc2626); }
.protocol-card.reality .protocol-icon { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.protocol-card.tuic .protocol-icon { background: linear-gradient(135deg, #10b981, #059669); }
.protocol-card.hysteria .protocol-icon { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.protocol-card.wireguard .protocol-icon { background: linear-gradient(135deg, #eab308, #84cc16); }
.protocol-card.ssh .protocol-icon { background: linear-gradient(135deg, #64748b, #475569); }
.protocol-card.awg20 .protocol-icon { background: linear-gradient(135deg, #0ea5e9, #3b82f6); }
.protocol-card.awg15 .protocol-icon { background: linear-gradient(135deg, #14b8a6, #0d9488); }

.protocol-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.protocol-card .tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--home-muted);
    margin-bottom: 12px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.protocol-card p {
    color: var(--home-muted);
    line-height: 1.65;
    font-size: 0.95rem;
    margin: 0;
}

.protocol-card ul {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
}

.protocol-card li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    color: var(--home-text);
    font-size: 0.9rem;
    line-height: 1.45;
}

.protocol-card li i {
    color: var(--home-emerald);
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 0.8rem;
}

/* CTA */
.home-cta {
    padding: 0 0 72px;
}

.home-cta-card {
    text-align: center;
    padding: 2.5rem 2rem;
    border-radius: 24px;
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.78) 0%, rgba(30, 41, 59, 0.45) 100%);
    border: 1px solid rgba(34, 211, 238, 0.2);
    box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.45);
}

.home-cta-card h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    margin-bottom: 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.home-cta-card h2 i {
    color: var(--home-cyan);
}

.home-cta-card p {
    color: var(--home-muted);
    max-width: 520px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.home-cta-card .home-hero-actions {
    margin-bottom: 0;
}

/* Алерт */
.home-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.home-alert--success {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #34d399;
}

.home-alert--success i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Cookie banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 22px 24px;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-top: 1px solid var(--home-border);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45), 0 -1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    font-size: 0.95rem;
}

.cookie-consent.hidden {
    display: none !important;
}

.cookie-consent .cookie-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-consent .cookie-text {
    flex: 1;
    min-width: 280px;
    color: var(--home-muted);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.cookie-consent .cookie-text > i {
    flex-shrink: 0;
    margin-top: 2px;
    color: #f59e0b;
}

.cookie-consent .cookie-text a {
    color: var(--home-cyan);
    text-decoration: none;
}

.cookie-consent .cookie-text a:hover {
    text-decoration: underline;
}

.cookie-consent .cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.cookie-consent .cookie-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.2s, transform 0.2s;
}

.cookie-consent .cookie-btn:hover {
    transform: translateY(-1px);
}

.cookie-consent .cookie-btn-accept {
    background: var(--home-gradient);
    color: #fff;
}

.cookie-consent .cookie-btn-necessary {
    background: rgba(148, 163, 184, 0.12);
    color: var(--home-text);
    border: 1px solid var(--home-border);
}

.cookie-consent .cookie-btn-necessary:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.3);
}

@media (max-width: 768px) {
    .home-page .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .home-page header.navbar {
        padding-top: max(0.5rem, env(safe-area-inset-top));
        padding-bottom: 0.5rem;
    }

    .home-page header.navbar .navbar-brand.logo {
        font-size: clamp(1.15rem, 4.5vw, 1.45rem);
        max-width: calc(100vw - 5.5rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .home-page header.navbar .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        padding: 0.35rem 0.5rem;
    }

    .home-page header.navbar .navbar-collapse {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(148, 163, 184, 0.15);
    }

    .home-page header.navbar .navbar-nav .nav-link {
        padding: 0.65rem 0.85rem !important;
        border-radius: 10px;
        min-height: 44px;
    }

    .home-page header.navbar .home-nav-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .home-page header.navbar .home-nav-actions .home-btn {
        width: 100%;
        min-height: 46px;
    }

    .home-hero {
        padding: 48px 0 40px;
    }

    .home-hero h1 {
        font-size: clamp(1.65rem, 7vw, 2.4rem);
        line-height: 1.12;
    }

    .home-hero-lead {
        font-size: 1rem;
        margin-bottom: 1.35rem;
    }

    .home-hero-stats {
        gap: 16px;
    }

    .home-stat-card {
        flex: 1 1 calc(50% - 16px);
        min-width: 0;
    }

    .protocols-section {
        padding: 40px 0 72px;
    }

    .section-title {
        margin-bottom: 32px;
    }

    .section-title h2 {
        font-size: clamp(1.35rem, 5vw, 1.85rem);
    }

    .section-title p {
        font-size: 0.98rem;
        padding: 0 4px;
    }

    .protocols-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .protocol-card {
        padding: 22px;
        border-radius: 18px;
    }

    .home-cta-card {
        padding: 2rem 1.25rem;
    }

    .cookie-consent {
        padding: max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
        border-radius: 20px 20px 0 0;
    }

    .cookie-consent .cookie-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .cookie-consent .cookie-buttons {
        justify-content: center;
    }

    .cookie-consent .cookie-btn {
        min-height: 44px;
        padding: 12px 18px;
    }
}

@media (max-width: 400px) {
    .home-stat-card .stat-val {
        font-size: 1.25rem;
    }
}
