:root {
    --bg: #ffffff;
    --bg-alt: #f4f7fb;
    --bg-hero: linear-gradient(180deg, #eef6fc 0%, #ffffff 100%);
    --text: #1c1e21;
    --text-muted: #6d7f8f;
    --accent: #2aabee;
    --accent-hover: #229ed9;
    --accent-light: #e8f4fd;
    --accent-glow: rgba(42, 171, 238, 0.25);
    --success: #31b545;
    --border: #e4e9ef;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow: 0 8px 32px rgba(42, 171, 238, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-lg: 20px;
    --font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.logo-icon {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a.nav-active {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-channel {
    border: 1px solid var(--border);
}

.nav-channel:hover {
    border-color: var(--accent);
}

/* Hero */
.hero {
    position: relative;
    padding: 64px 0 56px;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--bg-hero);
    z-index: 0;
}

.hero-bg::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(42, 171, 238, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.hero-badge strong {
    color: var(--accent);
    font-weight: 700;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--text);
}

.hero-desc {
    max-width: 520px;
    margin: 0 auto 32px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero-box {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow);
}

.hero-hint {
    margin-top: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

a.btn-connect {
    text-decoration: none;
}

.btn-connect {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    background: var(--accent);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-connect:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px var(--accent-glow);
}

.btn-connect:active:not(:disabled) {
    transform: translateY(0);
}

.btn-connect:disabled {
    opacity: 0.75;
    cursor: wait;
}

.btn-connect.is-loading .btn-icon {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.platform-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.platform-tag {
    padding: 7px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: border-color 0.2s, color 0.2s;
}

.platform-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Reasons */
.reasons {
    padding: 72px 0;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
}

.reasons h2 {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 40px;
}

.reasons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.reason-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.reason-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(42, 171, 238, 0.3);
}

.reason-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    background: var(--accent-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.reason-icon svg {
    width: 26px;
    height: 26px;
}

.reason-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.reason-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Telegram bar */
.telegram-bar {
    padding: 56px 0 72px;
}

.telegram-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
}

.telegram-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.telegram-card-icon svg {
    width: 26px;
    height: 26px;
}

.telegram-card-body {
    flex: 1;
    text-align: left;
}

.channel-text {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 2px;
}

.channel-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-subscribe {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 100px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-subscribe svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-subscribe:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* Footer */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 14px 0;
    background: var(--bg-alt);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.footer-nav a:hover {
    color: var(--accent);
    background: var(--accent-light);
}

@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

main {
    flex: 1;
}

/* Captcha modal */
.captcha-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.captcha-modal[hidden] {
    display: none;
}

.captcha-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.captcha-dialog {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px 24px;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.3s ease both;
    text-align: center;
}

.captcha-dialog h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.captcha-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.captcha-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 14px;
}

.captcha-display {
    width: 100%;
}

.captcha-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 64px;
    padding: 12px 48px 12px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    user-select: none;
    overflow: hidden;
    position: relative;
}

.captcha-code::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(42, 171, 238, 0.03) 10px,
        rgba(42, 171, 238, 0.03) 11px
    );
    pointer-events: none;
}

.captcha-code span {
    position: relative;
    display: inline-block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1;
}

.captcha-refresh {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    z-index: 1;
}

.captcha-refresh svg {
    width: 18px;
    height: 18px;
}

.captcha-refresh:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

.captcha-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1.15rem;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 4px;
    text-align: center;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.captcha-input::placeholder {
    letter-spacing: normal;
    text-transform: none;
    font-size: 0.9rem;
    font-family: var(--font);
    color: #aab4be;
}

.captcha-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.captcha-error {
    margin-top: 10px;
    font-size: 0.82rem;
    color: #e53935;
    text-align: center;
}

.captcha-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.captcha-submit {
    width: 100%;
}

.captcha-cancel {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.captcha-cancel:hover {
    color: var(--text);
}

/* FAQ page */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-light);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 16px;
}

.hero-compact {
    position: relative;
    padding: 64px 0 48px;
    text-align: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.hero-compact .container {
    position: relative;
    z-index: 1;
}

.hero-compact .section-tag {
    animation: fadeUp 0.5s ease both;
}

.hero-compact h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 12px;
    animation: fadeUp 0.5s 0.08s ease both;
}

.hero-compact .subtitle {
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.6;
    animation: fadeUp 0.5s 0.16s ease both;
}

.section {
    padding: 48px 0 64px;
}

.section-tight {
    padding-top: 32px;
}

.faq-list {
    display: grid;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
}

.faq-item {
    --delay: 0s;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    opacity: 0;
    transform: translateY(14px);
    animation: fadeUp 0.45s ease both;
    animation-delay: calc(0.2s + var(--delay));
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.faq-item:hover {
    border-color: rgba(42, 171, 238, 0.35);
}

.faq-item[open] {
    border-color: rgba(42, 171, 238, 0.4);
    box-shadow: var(--shadow);
}

.faq-item summary {
    padding: 20px 22px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary:hover {
    color: var(--accent);
}

.faq-question {
    flex: 1;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.4;
}

.faq-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--accent-light);
    border-radius: 8px;
    position: relative;
    transition: background 0.25s, transform 0.3s;
}

.faq-toggle::before,
.faq-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--accent);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.faq-toggle::before {
    width: 12px;
    height: 2px;
    transform: translate(-50%, -50%);
}

.faq-toggle::after {
    width: 2px;
    height: 12px;
    transform: translate(-50%, -50%);
}

.faq-item[open] .faq-toggle {
    background: var(--accent);
    transform: rotate(180deg);
}

.faq-item[open] .faq-toggle::before,
.faq-item[open] .faq-toggle::after {
    background: #fff;
}

.faq-item[open] .faq-toggle::after {
    transform: translate(-50%, -50%) scaleY(0);
    opacity: 0;
}

.faq-item .answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

.faq-item[open] .answer {
    grid-template-rows: 1fr;
}

.answer-inner {
    overflow: hidden;
    padding: 0 22px;
}

.faq-item[open] .answer-inner {
    padding-bottom: 20px;
}

.btn-connect.inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: auto;
    padding: 14px 36px;
}

.cta-banner {
    text-align: center;
    margin-top: 40px;
    opacity: 0;
    animation: fadeUp 0.5s 0.7s ease both;
}

@media (prefers-reduced-motion: reduce) {
    .hero-compact .section-tag,
    .hero-compact h1,
    .hero-compact .subtitle,
    .faq-item,
    .cta-banner {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .faq-item .answer {
        transition: none;
    }

    .faq-toggle,
    .faq-toggle::before,
    .faq-toggle::after {
        transition: none;
    }
}

/* Connect page */
.connect-page {
    flex: 1;
}

.connect-hero {
    padding: 56px 0 72px;
    background: var(--bg-hero);
}

.connect-card {
    max-width: 440px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow);
    text-align: center;
}

.connect-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 8px 14px;
    background: #eaf8ee;
    color: var(--success);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 500;
}

.connect-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.connect-card h1 {
    font-size: 1.65rem;
    margin-bottom: 10px;
}

.connect-desc {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.connect-server {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-alt);
    border-radius: var(--radius);
}

.connect-server-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.connect-server strong {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.connect-hint {
    margin-top: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.connect-back {
    display: inline-block;
    margin-top: 22px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.connect-back:hover {
    color: var(--accent);
}

.connect-form {
    text-align: left;
}

.connect-form .captcha-error {
    display: block;
    margin-top: 8px;
}

.connect-submit {
    margin-top: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .reasons-grid {
        grid-template-columns: 1fr;
    }

    .telegram-card {
        flex-direction: column;
        text-align: center;
    }

    .telegram-card-body {
        text-align: center;
    }

    .btn-subscribe {
        width: 100%;
        justify-content: center;
    }

}

@media (max-width: 480px) {
    .hero {
        padding: 40px 0 36px;
    }

    .hero-box {
        padding: 24px 20px;
    }

    .nav-links a {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}
