/* ==========================================
   1. БАЗОВЫЕ ПЕРЕМЕННЫЕ И СБРОС (ТЕПЕРЬ С МАГИЕЙ)
   ========================================== */
:root {
    /* Цветовая палитра - делаем чуть глубже для контраста неонов */
    --bg-main: #050505;
    --bg-card: rgba(24, 24, 27, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);

    /* Текст */
    --text-main: #f8fafc;
    --text-muted: #a1a1aa;

    /* Акценты (Фирменные цвета) */
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-glow: rgba(99, 102, 241, 0.5);
    --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --accent-gradient-animated: linear-gradient(270deg, #6366f1, #a855f7, #ec4899, #6366f1);

    /* Статусы */
    --error-color: #ef4444;
    --success-color: #10b981;
}

/* КРАСИВЫЙ ПОЛЗУНОК (SCROLLBAR) */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 20px;
    border: 2px solid var(--bg-main);
    transition: all 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gradient);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ВЫДЕЛЕНИЕ ТЕКСТА */
::selection {
    background: var(--accent-secondary);
    color: #fff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth; /* Плавный скролл по всей странице */
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* Тонкий фоновый паттерн для объема */
    background-image: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
}

/* Утилиты */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}
.text-center { text-align: center; }
.hidden { display: none !important; }
.bg-darker {
    background: rgba(10, 10, 12, 0.6);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* АНИМИРОВАННЫЙ ГРАДИЕНТНЫЙ ТЕКСТ */
.gradient-text {
    background: var(--accent-gradient-animated);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================
   2. ТИПОГРАФИКА И КНОПКИ (СОЧНЫЕ ХОВЕРЫ)
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Эффект упругости */
    text-decoration: none;
    border: none;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn .spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-left-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

/* Бегущий блик на кнопке */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
    z-index: -1;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.5); /* Неоновое свечение */
}

.btn-primary:hover::after {
    left: 150%;
    transition: 0.7s ease-in-out;
}

.btn-primary:active { transform: translateY(1px) scale(0.96); box-shadow: 0 5px 15px rgba(168, 85, 247, 0.3); }

.btn-outline {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================
   3. НАВИГАЦИЯ (ЭФФЕКТ СТЕКЛА)
   ========================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(5, 5, 5, 0.7); /* Сильнее прозрачность */
    backdrop-filter: blur(20px); /* Больше блюра */
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    transition: transform 0.3s ease;
}
.logo:hover {
    transform: scale(1.05);
}
.logo svg {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-primary));
}

.nav-links a {
    position: relative;
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 32px;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s;
}

/* Анимированная линия под ссылками */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0; height: 2px;
    bottom: -4px; left: 0;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
    border-radius: 2px;
}
.nav-links a:hover { color: white; }
.nav-links a:hover::after { width: 100%; box-shadow: 0 0 10px var(--accent-primary); }

/* ==========================================
   4. ГЛАВНЫЙ ЭКРАН (HERO) - ПУЛЬСАЦИЯ
   ========================================== */
.hero {
    padding: 120px 0 100px;
    text-align: center;
    position: relative;
    animation: fadeInDown 1s ease-out forwards;
}

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

/* Фоновое свечение - теперь дышит */
.hero::before {
    content: '';
    position: absolute;
    top: -30%; left: 50%;
    transform: translateX(-50%);
    width: 80vw; height: 80vw;
    max-width: 800px; max-height: 800px;
    background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, rgba(168,85,247,0.1) 40%, rgba(9,9,11,0) 70%);
    z-index: -1;
    pointer-events: none;
    animation: pulseGlow 6s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    0% { transform: translateX(-50%) scale(0.9); opacity: 0.7; }
    100% { transform: translateX(-50%) scale(1.1); opacity: 1; filter: hue-rotate(20deg); }
}

.hero h1 {
    font-size: 64px;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 24px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.hero-subtitle {
    font-size: 20px;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* ==========================================
   5. ОБЩИЕ СЕКЦИИ И КАРТОЧКИ (3D И СТЕКЛО)
   ========================================== */
.section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 36px; font-weight: 800; margin-bottom: 16px; letter-spacing: -1px; }
.section-header p { color: var(--text-muted); font-size: 18px; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 40px 32px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Блик внутри карточки при наведении */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.1);
}
.feature-card:hover::before { opacity: 1; }

.feature-icon {
    font-size: 48px;
    margin-bottom: 24px;
    display: inline-block;
    transition: transform 0.4s ease;
}
.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 10px var(--accent-secondary));
}

.feature-card h3 { font-size: 22px; margin-bottom: 12px; font-weight: 700; }
.feature-card p { color: var(--text-muted); font-size: 16px; line-height: 1.6; }

/* ==========================================
   6. ИНСТРУКЦИЯ (ШАГИ С АНИМАЦИЕЙ ЦИФР)
   ========================================== */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.step-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 40px 30px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.2);
}

.step-number {
    position: absolute;
    top: -20px; right: -10px;
    font-size: 140px;
    font-weight: 900;
    /* Градиентные полупрозрачные цифры */
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    pointer-events: none;
    transition: transform 0.5s ease;
}

.step-card:hover .step-number {
    transform: scale(1.1) translate(-10px, 10px);
}

.step-card h4 { font-size: 20px; margin-bottom: 12px; font-weight: 700; color: white; }
.step-card p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }

/* ==========================================
   7. ТАРИФЫ (ГЛОУ ЭФФЕКТЫ)
   ========================================== */

/* Переменная для вращения неонового луча */
@property --glow-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0; /* Место для теней */
}

.pricing-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
}

.pricing-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px rgba(99, 102, 241, 0.15);
}

.pricing-card.popular {
    background: linear-gradient(180deg, rgba(99,102,241,0.08) 0%, rgba(24,24,27,0.8) 100%);
    border-color: rgba(168, 85, 247, 0.6);
    /* Убрали transform: scale(1.05), чтобы размер был одинаковым */
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
}

.pricing-card.popular:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 50px rgba(168, 85, 247, 0.3);
}

/* Анимированная светящаяся обводка по контуру */
.pricing-card.popular::after {
    content: '';
    position: absolute;
    inset: -1px; /* Покрываем стандартный бордер */
    border-radius: 29px; /* Слегка больше бордера самой карточки */
    padding: 2px; /* Толщина светящегося луча */
    background: conic-gradient(
        from var(--glow-angle),
        transparent 50%,
        var(--accent-primary) 80%,
        var(--accent-secondary) 100%
    );
    /* Маска, чтобы луч был виден только на краях (как border) */
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.pricing-card.popular:hover::after {
    opacity: 1;
    animation: traceGlow 2s linear infinite;
}

@keyframes traceGlow {
    0% { --glow-angle: 0deg; }
    100% { --glow-angle: 360deg; }
}

.badge {
    position: absolute;
    top: -14px; left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gradient);
    color: white;
    padding: 6px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    z-index: 10; /* ЭТО ПРАВКА. Чтобы быть поверх луча */
    animation: floatBadge 3s ease-in-out infinite;

}


@keyframes floatBadge {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

.pricing-card h3 { font-size: 24px; font-weight: 700; margin-bottom: 12px; color: white; }
.price { font-size: 48px; font-weight: 900; margin-bottom: 30px; color: white; letter-spacing: -1px; }
.price span { font-size: 16px; color: var(--text-muted); font-weight: 500; letter-spacing: 0; }
.plan-features { list-style: none; margin-bottom: 40px; flex-grow: 1; }
.plan-features li {
    color: #e4e4e7;
    font-size: 15px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.plan-features li::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}
.pricing-card .btn { width: 100%; height: 54px; }

/* ==========================================
   8. ПОДВАЛ
   ========================================== */
.footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 50px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    background: rgba(0,0,0,0.3);
}
.footer-links { margin-top: 16px; display: flex; justify-content: center; gap: 20px; }
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}
.footer-links a:hover { color: var(--accent-secondary); text-shadow: 0 0 8px rgba(168,85,247,0.4); }

/* ==========================================
   9. МОДАЛЬНЫЕ ОКНА (ВАУ-АНИМАЦИЯ ПОЯВЛЕНИЯ)
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    perspective: 1000px; /* Для 3D эффекта появления */
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: rgba(24, 24, 27, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 40px;
    width: 90%;
    max-width: 440px;
    /* Анимация: вылетает снизу с разворотом */
    transform: rotateX(-15deg) translateY(50px) scale(0.9);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05) inset;
}

.modal-overlay.active .modal-content {
    transform: rotateX(0) translateY(0) scale(1);
    opacity: 1;
}

.modal-title { font-size: 26px; font-weight: 800; margin-bottom: 12px; color: white; letter-spacing: -0.5px; }
.modal-desc { color: var(--text-muted); font-size: 15px; margin-bottom: 30px; line-height: 1.6; }

/* Кастомные инпуты (Apple style) */
.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 18px;
    border-radius: 16px;
    font-size: 16px;
    margin-bottom: 24px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    -webkit-appearance: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.input-field::placeholder { color: #52525b; }

.input-field:focus {
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--accent-primary);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 0 0 4px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal-actions .btn { width: 100%; padding: 16px; font-size: 16px; border-radius: 14px;}

/* Ошибки с тряской */
.message-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    text-align: left;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Экран успеха */
.spinner {
    width: 50px; height: 50px;
    border: 3px solid rgba(255,255,255,0.05);
    border-left-color: var(--accent-secondary);
    border-right-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto 30px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.5));
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.copy-box { display: flex; gap: 10px; margin-bottom: 24px; }
.copy-box .input-field { margin-bottom: 0; text-overflow: ellipsis; white-space: nowrap; }
.btn-icon { width: 56px; padding: 0; flex-shrink: 0; border-radius: 16px; }

.success-instructions {
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}
.success-instructions p { color: #d4d4d8; font-size: 14px; margin-bottom: 10px; }
.success-instructions b { color: white; font-weight: 600; }
.tg-link-box {
    margin-top: 20px; padding-top: 20px;
    border-top: 1px dashed rgba(255,255,255,0.1);
    color: var(--text-muted); font-size: 14px;
}
.tg-link-box code {
    background: rgba(99,102,241,0.15); padding: 4px 8px;
    border-radius: 6px; font-family: 'Fira Code', monospace; color: var(--accent-primary);
    font-weight: 600;
}

/* ==========================================
   10. АДАПТИВНОСТЬ (МОБИЛЬНЫЕ УСТРОЙСТВА)
   ========================================== */
@media (max-width: 768px) {
    html, body { overflow-x: hidden; position: relative; width: 100%; }

    .hero { padding: 60px 0 40px; }
    .hero h1 { font-size: 40px; letter-spacing: -1px; }
    .hero-subtitle { font-size: 16px; padding: 0 10px; }

    .hero::before { width: 100vw; height: 100vw; }

    .nav-links { display: none; }
    .section { padding: 60px 0; }
    .section-header { margin-bottom: 40px; }

    .step-number {
        right: 10px;
        top: -10px;
        font-size: 100px;
        opacity: 0.15;
    }

    .pricing-card.popular:hover {
        transform: translateY(-5px);
    }

    .modal-content {
        padding: 30px 24px;
        width: calc(100% - 32px);
        margin: 16px;
        border-radius: 24px;
    }

    .modal-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .modal-actions .btn-outline { order: 2; background: rgba(255,255,255,0.05); border: none; }
    .modal-actions .btn-primary { order: 1; }

    .copy-box { flex-direction: column; }
    .btn-icon { width: 100%; height: 54px; }
}
.modal-status-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 250px; /* Чтобы высота не прыгала при переключении состояний */
    width: 100%;
}

#loading-state, #success-state {
    width: 100%;
}
