/* ======================================================== */
/* v3.0 MEDICAL MODERNISM - CORE STYLES */
/* ======================================================== */

:root {
    /* Основные цвета */
    --color-primary: #0066FF; /* Более современный, глубокий синий */
    --color-primary-hover: #0052CC;
    --color-accent: #10B981; /* Свежий мятно-зеленый вместо старого травяного */
    --color-accent-dark: #059669;
    --color-danger: #EF4444;
    
    /* Тексты и фоны */
    --color-text-main: #111827; /* Почти черный для контраста */
    --color-text-secondary: #4B5563; /* Серый для описаний */
    --color-bg-body: #F3F4F6; /* Очень легкий серый фон страницы */
    --color-bg-surface: #FFFFFF;
    
    /* UI Элементы */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 50px;
    
    /* Тени (Soft Shadows) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    --shadow-float: 0 20px 50px -10px rgba(0, 0, 0, 0.15);
    
    /* Анимации */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Сброс и база */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Типографика */
h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-text-main);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-primary-hover); }

/* ======================================================== */
/* КОМПОНЕНТЫ ИНТЕРФЕЙСА */
/* ======================================================== */

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}
/* Эффект блика на кнопке покупки */
.btn-success::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s infinite;
}
@keyframes shimmer { 100% { left: 100%; } }

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

/* ======================================================== */
/* HEADER & HERO SECTION */
/* ======================================================== */

.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 0;
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.5rem; color: var(--color-primary); }
.nav-links { display: flex; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--color-text-main); font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--color-primary); }

.hero-section {
    background: radial-gradient(circle at top right, #E0F2FE, #F3F4F6);
    padding: 4rem 0 6rem 0; /* Большой отступ снизу для наезда карточек */
    text-align: center;
}
.hero-breadcrumbs { font-size: 0.9rem; color: var(--color-text-secondary); margin-bottom: 1.5rem; }
.hero-breadcrumbs a { color: var(--color-text-secondary); border-bottom: 1px dotted #ccc; }
.hero-meta {
    display: inline-flex;
    gap: 1rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1rem;
    color: var(--color-text-secondary);
}

/* ======================================================== */
/* PURCHASE GRID (REVOLUTIONARY PART) */
/* ======================================================== */

.purchase-wrapper {
    margin-top: -4rem; /* Наезд на Hero */
    margin-bottom: 3rem;
    position: relative;
    z-index: 10;
}

.purchase-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr; /* Акцент на платную карточку */
    gap: 2rem;
    align-items: start;
}

/* Общий стиль карточек */
.card-glass {
    background: var(--color-bg-surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0,0,0,0.03);
    transition: var(--transition);
    position: relative;
}

/* Карточка PRO (149р) */
.card-pro {
    border: 2px solid var(--color-accent);
    background: linear-gradient(to bottom, #FFFFFF, #F0FDF4);
}
.card-pro:hover { box-shadow: var(--shadow-float); transform: translateY(-5px); }

.badge-hit {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    background: var(--color-danger); color: white;
    padding: 0.5rem 0.5rem; border-radius: var(--radius-pill);
    font-weight: 1000; font-size: 0.7rem; text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    display: flex; align-items: center; gap: 0.1rem;
}

.price-block { margin: 1.5rem 0; display: flex; align-items: baseline; gap: 1rem; }
.price-old { text-decoration: line-through; color: #9CA3AF; font-size: 1.2rem; }
.price-new { font-size: 2.35rem; font-weight: 900; color: var(--color-text-main); line-height: 1; }
.price-tag { font-size: 1rem; color: var(--color-accent); font-weight: 700; background: #D1FAE5; padding: 0.2rem 0.8rem; border-radius: var(--radius-sm); }

.features-list { list-style: none; padding: 0; margin: 2rem 0; }
.features-list li {
    display: flex; align-items: flex-start; gap: 0.8rem;
    margin-bottom: 0.5rem; color: var(--color-text-secondary); font-size: 1.05rem;
}
.features-list li i { color: var(--color-accent); font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }

/* Карточка FREE (PDF) */
.card-free {
    background: #FAFAFA;
    opacity: 0.9;
}
.card-free .price-new { font-size: 2rem; color: var(--color-text-secondary); }
.card-free .features-list li i { color: #9CA3AF; }

/* ======================================================== */
/* APP PROMO (DARK MODE) */
/* ======================================================== */
.app-section {
    background: #1F2937;
    border-radius: var(--radius-lg);
    color: white;
    padding: 3rem;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
/* Декоративный круг сзади */
.app-section::before {
    content: ''; position: absolute; top: -50%; right: -10%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--color-primary), transparent 70%);
    opacity: 0.2; pointer-events: none;
}
.app-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; align-items: center; position: relative; z-index: 2; }
.app-badge { background: rgba(255,255,255,0.1); padding: 0.3rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.85rem; color: #60A5FA; font-weight: 700; margin-bottom: 1rem; display: inline-block; }
.app-features { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0; }
.app-features div { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; color: #D1D5DB; }
.btn-app { background: white; color: black; border: 1px solid white; width: 100%; }
.btn-app:hover { background: #E5E7EB; color: black; }

/* ======================================================== */
/* CONTENT & SEO */
/* ======================================================== */
.content-wrapper {
    background: white;
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 3rem;
}

/* Стили для Содержания (Table of Contents) */
.toc-box {
    background: #F9FAFB;
    border-left: 4px solid var(--color-primary);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.toc-title { font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.toc-list { list-style: none; padding: 0; columns: 2; }
.toc-list li { margin-bottom: 0.5rem; }
.toc-list a { color: var(--color-text-secondary); font-size: 0.95rem; border-bottom: 1px solid transparent; }
.toc-list a:hover { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.content-body { font-size: 1.1rem; color: #374151; }
.content-body h2 { margin-top: 2.5rem; color: var(--color-primary-hover); font-size: 1.8rem; }
.content-body ul { padding-left: 1.5rem; margin-bottom: 1.5rem; }
.content-body li { margin-bottom: 0.5rem; }

/* ======================================================== */
/* PREVIEW & FAQ */
/* ======================================================== */
.preview-iframe {
    width: 100%; height: 400px;
    border: none; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    background: #fff;
}

.faq-item { margin-bottom: 1rem; }
.faq-item details {
    background: white; border: 1px solid #E5E7EB;
    border-radius: var(--radius-sm); padding: 1rem;
    transition: var(--transition);
}
.faq-item details[open] { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.faq-item summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::after { content: '+'; font-size: 1.5rem; color: var(--color-primary); }
.faq-item details[open] summary::after { content: '-'; }

/* ======================================================== */
/* STICKY WIDGET (GLASS) */
/* ======================================================== */
.promo-widget {
    position: fixed; bottom: 20px; left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: 90%; max-width: 500px;
    background: rgba(17, 24, 39, 0.9); /* Почти черный */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    padding: 10px 14px 10px 10px; /* Отступы для иконки */
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: floatUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.5s forwards;
}
@keyframes floatUp { to { transform: translateX(-50%) translateY(0); } }
.promo-widget.is-hidden { display: none !important; }

.pw-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.2rem; flex-shrink: 0;
}
.pw-icon i { margin-right: 0 !important; }

.pw-content { display: flex; flex-direction: column; flex-grow: 1; }
.pw-title { color: white; font-weight: 700; font-size: 0.9rem; line-height: 1.1; }
.pw-sub { color: #9CA3AF; font-size: 0.75rem; }

.pw-btn {
    background: white; color: #111827;
    font-weight: 700; font-size: 0.85rem;
    padding: 8px 16px; border-radius: var(--radius-pill);
    text-decoration: none; white-space: nowrap;
    box-shadow: 0 2px 5px rgba(255,255,255,0.2);
}
.pw-close { color: #6B7280; cursor: pointer; padding: 5px; font-size: 1.2rem; }

/* ======================================================== */
/* MODALS (FIXED) */
/* ======================================================== */
.payment-modal-overlay {
    display: none; position: fixed; z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px);
}
.payment-modal-content {
    background: white; margin: 5vh auto;
    border-radius: var(--radius-lg);
    width: 92%; max-width: 480px; padding: 2rem;
    position: relative; box-shadow: var(--shadow-float);
}

/* ======================================================== */
/* MOBILE ADAPTIVE */
/* ======================================================== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-section { padding: 2rem 0 4rem 0; text-align: left; }
    h1 { font-size: 1.8rem; }
    
    .purchase-grid {
        display: flex;
        flex-direction: column-reverse; /* Сначала дешевое, потом бесплатное */
        gap: 1.5rem;
    }
    
    .purchase-wrapper { margin-top: -2rem; }
    .card-glass { padding: 1.5rem; }
    
    .app-grid { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .app-features { text-align: left; }
    .app-section::before { display: none; } /* Убираем тяжелый градиент на мобиле */
    
    .toc-list { columns: 1; }
    
    .payment-modal-content { padding: 1.5rem 1rem; margin: 20px auto; }
}
* Затемнение фона */
.login-modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Темный фон */
    backdrop-filter: blur(5px); /* Размытие */
    z-index: 9999;
    display: none; /* Скрыто по умолчанию */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Класс, который добавляет JS при открытии */
.login-modal-backdrop.is-visible {
    display: flex;
    opacity: 1;
}

/* Само белое окно */
#login-modal, .login-modal {
    background-color: #ffffff !important; /* !important гарантирует, что фон будет белым */
    background: #ffffff !important;      /* Дублируем для надежности */
    
    padding: 2.5rem;
    border-radius: 16px; /* Можно прописать жестко, если переменные не подхватились */
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.15); /* Тень */
    position: relative;
    text-align: center;
    
    /* Убедимся, что текст внутри темный, а не наследуется */
    color: #111827; 
}

/* Крестик закрытия */
.login-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    font-size: 1.5rem;
    color: #9CA3AF;
    transition: 0.2s;
    line-height: 1;
}
.login-modal-close:hover {
    color: var(--color-danger);
}
/* ======================================================== */
/* МОБИЛЬНЫЕ ФИКСЫ ШАПКИ (Узкие экраны) */
/* ======================================================== */
@media (max-width: 480px) {
    .content-body {
        font-size: 0.8rem;
    }
    .promo-widget {
        width: 98%;
        gap: 3px;
        border-radius: 20px;


    }
     .app-grid {
        gap: 0rem;
     }
    .app-section {
        padding: 0.8rem;

    }
    .content-wrapper {
        padding: 1rem;
    }
    .hero-meta {
        border-radius: 20px;
    }
    /* Уменьшаем логотип */
    .logo {
        font-size: 1.1rem; /* Было 1.5rem */
    }
    
    /* Уменьшаем кнопку в шапке */
    .navbar .btn {
        padding: 0.5rem 0.8rem; /* Уменьшаем отступы внутри кнопки */
        font-size: 0.85rem;     /* Уменьшаем шрифт кнопки */
        gap: 0.3rem;            /* Расстояние до иконки */
    }
    
    /* Уменьшаем отступы контейнера, чтобы влезло */
    .navbar .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}