/* ========================================
   УЛУЧШЕНИЯ ДЛЯ ITMAGIC.SPB
   Файл с дополнительными стилями
   ======================================== */

/* ==========================================
   1. TELEGRAM ВИДЖЕТ (плавающая кнопка)
   ========================================== */
.telegram-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    animation: pulse 2s ease-in-out infinite;
}

.telegram-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 136, 204, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
}

.telegram-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 136, 204, 0.5);
}

.telegram-button svg {
    width: 24px;
    height: 24px;
}

.telegram-button-text {
    display: inline;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* На маленьких экранах - только иконка */
@media (max-width: 768px) {
    .telegram-widget {
        bottom: 20px;
        right: 20px;
    }

    .telegram-button {
        padding: 16px;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        justify-content: center;
    }

    .telegram-button-text {
        display: none;
    }
}

/* ==========================================
   2. ЗНАЧКИ ДОВЕРИЯ
   ========================================== */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(6, 182, 212, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(6, 182, 212, 0.1);
}

.trust-badge-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.trust-badge-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.trust-badge-text strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 2px;
}

/* ==========================================
   3. ЯКОРНЫЙ ТАРИФ "ПРЕМИУМ"
   ========================================== */
.pricing-card.premium {
    position: relative;
    border: 2px solid rgba(6, 182, 212, 0.3);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.pricing-card.premium::before {
    content: '🏆 Для крупных проектов';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 20px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    white-space: nowrap;
}

.pricing-price.premium {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   4. МОБИЛЬНАЯ КНОПКА "НАПИСАТЬ В БОТ"
   ========================================== */
.mobile-cta-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    z-index: 1000;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}

.mobile-cta-button {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--gradient-accent);
    color: #000;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-cta-button:hover {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .mobile-cta-bar {
        display: block;
    }

    /* Скрыть обычный Telegram виджет на мобилке, если есть нижняя панель */
    body.has-mobile-cta .telegram-widget {
        display: none;
    }
}

/* ==========================================
   5. КАЛЬКУЛЯТОР СТОИМОСТИ
   ========================================== */
.calculator-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px;
    margin: 80px 0;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.calculator-options {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.calculator-option {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calculator-option-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.calculator-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.calculator-chip {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--text-secondary);
}

.calculator-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.calculator-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 600;
}

.calculator-result {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.calculator-result-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.calculator-result-price {
    font-size: 56px;
    font-weight: 900;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.calculator-result-details {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 16px;
    line-height: 1.6;
}

.calculator-cta {
    margin-top: 24px;
    padding: 16px 32px;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.calculator-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.3);
}

@media (max-width: 768px) {
    .calculator-section {
        padding: 32px 20px;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .calculator-result-price {
        font-size: 42px;
    }
}

/* ==========================================
   6. ВСТРОЕННЫЙ ЧАТ-БОТ
   ========================================== */
.chatbot-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-widget.open {
    display: flex;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, #00ccff 100%);
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-title {
    font-weight: 700;
    font-size: 18px;
}

.chatbot-close {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #000;
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.chatbot-message.bot {
    align-self: flex-start;
}

.chatbot-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chatbot-message.user .chatbot-message-avatar {
    background: var(--text-secondary);
}

.chatbot-message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
}

.chatbot-message.user .chatbot-message-bubble {
    background: var(--accent);
    color: #000;
}

.chatbot-input-area {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.chatbot-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-send:hover {
    transform: scale(1.1);
}

.chatbot-send svg {
    width: 20px;
    height: 20px;
    color: #000;
}

@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 70vh;
        border-radius: 24px 24px 0 0;
    }
}

/* ==========================================
   7. ПРОГРЕСС-БАР ДЛЯ ФОРМЫ
   ========================================== */
.form-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.form-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.form-progress-bar {
    position: absolute;
    top: 20px;
    left: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
    z-index: 1;
}

.form-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.form-progress-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.form-progress-step.active .form-progress-circle {
    border-color: var(--accent);
    background: var(--accent);
    color: #000;
}

.form-progress-step.completed .form-progress-circle {
    border-color: var(--accent);
    background: var(--accent);
    color: #000;
}

.form-progress-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.form-progress-step.active .form-progress-label {
    color: var(--accent);
    font-weight: 600;
}

/* ==========================================
   8. ПЕРСОНАЛИЗАЦИЯ UTM
   ========================================== */
.personalized-hero {
    display: none;
}

.personalized-hero.active {
    display: block;
}

.personalized-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid var(--accent);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

/* ==========================================
   9. КНОПКА ДЕМО-БОТА
   ========================================== */
.demo-bot-link {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-weight: 600;
    font-size: 15px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.demo-bot-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.demo-bot-link:active {
    transform: translateY(0);
}

/* Демо-бот в навигации */
.nav-link.demo-link {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link.demo-link:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    transform: translateY(-2px);
}

/* ==========================================
   9.1 КАЛЬКУЛЯТОР В ФОРМЕ
   ========================================== */
.form-calculator {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 2px solid rgba(6, 182, 212, 0.2);
    border-radius: 20px;
    padding: 32px;
    margin: 32px 0;
}

.calculator-form-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
}

.calculator-form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
}

/* ==========================================
   9.2 БОНУСНЫЙ ЧЕКБОКС
   ========================================== */
.consent-bonus {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 2px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.consent-bonus:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: rgba(34, 197, 94, 0.4);
}

.bonus-badge {
    display: inline-block;
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bonus-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #10b981;
    font-weight: 600;
}

/* ==========================================
   10. АДАПТИВНОСТЬ
   ========================================== */
@media (max-width: 480px) {
    .trust-badges {
        grid-template-columns: 1fr;
    }

    .calculator-chips {
        flex-direction: column;
    }

    .calculator-chip {
        text-align: center;
    }

    .demo-bot-link {
        display: block;
        width: 100%;
        text-align: center;
    }
}

/* ==========================================
   11. КРАТКИЙ ПРОЦЕСС ДЛЯ МОБИЛЬНЫХ
   ========================================== */
.mobile-process-brief {
    display: none;
}

@media (max-width: 768px) {
    .mobile-process-brief {
        display: block;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
        border: 2px solid rgba(6, 182, 212, 0.3);
        border-radius: 16px;
        padding: 20px;
        margin: 24px 0;
        text-align: center;
    }

    .mobile-process-text {
        font-size: 15px;
        font-weight: 600;
        color: var(--text-primary);
        line-height: 1.6;
        margin: 0;
    }
}

/* ==========================================
   12. ОПТИМИЗАЦИЯ ДЛЯ МОБИЛЬНЫХ
   Скрытие избыточных секций для ускорения загрузки
   ========================================== */
@media (max-width: 768px) {
    /* Скрыть секцию "Кому не подойду" */
    .anti-section {
        display: none;
    }

    /* Скрыть полный блок "Процесс работы" */
    section:has(.process-timeline) {
        display: none;
    }

    /* Оставить только 3 карточки возможностей (скрыть 4-6) */
    #features .feature-grid .feature-card:nth-child(n+4) {
        display: none;
    }

    /* Оставить только 2 центральных тарифа (скрыть 1 и 4) */
    .pricing-grid .pricing-card:nth-child(1),
    .pricing-grid .pricing-card:nth-child(4) {
        display: none;
    }

    /* Сделать тарифы в одну колонку */
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}
