/* ======================================================== */
/* v3.0 MEDICAL MODERNISM - CORE STYLES (UPDATED) */
/* ======================================================== */

: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;
    
    /* Тени и Свечения */
    --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);
    --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.25); /* Свечение для PRO-карточки */
    
    /* Анимации */
    --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.1rem;
    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); color: white;
}
.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 */
/* ======================================================== */
.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) */
/* ======================================================== */
.purchase-wrapper { margin-top: -4rem; 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 (Усиленная) */
.card-pro {
    border: 2px solid var(--color-accent);
    background: linear-gradient(to bottom, #FFFFFF, #F0FDF4);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}
.card-pro:hover { box-shadow: var(--shadow-float), var(--shadow-glow); transform: translateY(-5px); }

.badge-hit {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    background: var(--color-danger); color: white; padding: 0.5rem 1rem;
    border-radius: var(--radius-pill); font-weight: 900; font-size: 0.8rem;
    text-transform: uppercase; box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    display: flex; align-items: center; gap: 0.3rem; white-space: nowrap;
}

.price-block { margin: 1.5rem 0; display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.price-old { text-decoration: line-through; color: #9CA3AF; font-size: 1.2rem; }
.price-new { font-size: clamp(2rem, 5vw, 2.5rem); 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.8rem; 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; }

/* Бесплатная карточка */
.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-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-wrapper { background: white; border-radius: var(--radius-lg); padding: 3rem; box-shadow: var(--shadow-sm); margin-bottom: 3rem; }
.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; gap: 2rem; }
.toc-list li { margin-bottom: 0.5rem; break-inside: avoid; }
.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 & WIDGETS */
/* ======================================================== */
.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: '-'; }

.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);
    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; }

/* Sticky кнопка покупки для мобилок (Скрыта на ПК) */
.sticky-mobile-buy {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
    border-top: 1px solid #E5E7EB; padding: 1rem; z-index: 9998;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05); text-align: center;
    transform: translateY(150%); transition: transform 0.3s ease;
}
.sticky-mobile-buy.is-visible { transform: translateY(0); }
.sticky-mobile-buy .btn { width: 100%; font-size: 1.1rem; padding: 0.8rem; }

/* ======================================================== */
/* MODALS */
/* ======================================================== */
/* Затемнение фона */
.login-modal-backdrop, .payment-modal-overlay {
    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;
}
.payment-modal-overlay { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.login-modal-backdrop.is-visible { display: flex; opacity: 1; }
.payment-modal-overlay.is-visible { display: flex; opacity: 1; }
#login-modal, .login-modal, .payment-modal-content {
    background-color: #ffffff !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;
}
.payment-modal-content { margin: 5vh auto; max-width: 480px; }
.login-modal-close, .pw-close[id="modal-close-button"] {
    position: absolute; top: 15px; right: 15px; cursor: pointer;
    font-size: 1.5rem; color: #9CA3AF; transition: 0.2s; line-height: 1;
}
.login-modal-close:hover, .pw-close[id="modal-close-button"]:hover { color: var(--color-danger); }

/* ======================================================== */
/* MOBILE ADAPTIVE (ОБЪЕДИНЕНО И ОЧИЩЕНО) */
/* ======================================================== */
@media (max-width: 900px) {
    .app-grid { grid-template-columns: 1fr; text-align: center; }
    .app-features { text-align: left; }
    .app-section::before { display: none; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-section { padding: 2rem 0 3rem 0; text-align: left; }
    
    /* Убрали реверс колонок. Карточка PRO теперь первая! */
    .purchase-grid { display: flex; flex-direction: column; gap: 2rem; }
    .purchase-wrapper { margin-top: -2rem; }
    .card-glass { padding: 1.5rem; }
    
    .toc-list { columns: 1; gap: 0; }
    
    /* Включаем показ липкой кнопки покупки на телефонах */
    .sticky-mobile-buy { display: block; }
}

@media (max-width: 480px) {
    /* Исправляем шапку */
    .logo { font-size: 1.2rem; }
    .navbar .btn { padding: 0.5rem 0.8rem; font-size: 0.9rem; gap: 0.3rem; }
    .navbar .container { padding-left: 1rem; padding-right: 1rem; }
    
    .hero-breadcrumbs { font-size: 0.8rem; }
    .hero-meta { border-radius: 12px; font-size: 0.8rem; flex-wrap: wrap; justify-content: center; }
    
    /* Вернули "воздух" блокам */
    .content-wrapper, .app-section { padding: 1.5rem; }
    .content-body { font-size: 1rem; }
    
    /* Адаптация виджетов */
    .promo-widget { width: 94%; border-radius: 16px; padding: 12px; gap: 8px;}
    .features-list li {font-size: 0.9rem; margin-bottom: 0rem;}
    .navbar{position: unset}
    
}

.payment-modal-overlay.is-visible {
  display: flex !important;
  opacity: 1 !important;
}
/* ===== YooKassa widget: fix inner shift / overflow on mobile ===== */
@media (max-width: 768px) {
  /* модалка должна занимать весь экран без боковых зазоров */
  .payment-modal-overlay { padding: 5px !important; }

  .payment-modal-content {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    border-radius: 10 !important;

    /* важно: никаких боковых паддингов, иначе iframe "съезжает" */
    padding-left: 0 !important;
    padding-right: 0 !important;

    overflow: hidden !important;
  }

  /* контейнер под виджет */
  #payment-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  /* сам iframe */
  #payment-widget-container iframe {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    border: 0 !important;
  }
}

/* на всякий случай — чтобы не появлялась горизонтальная прокрутка */
html, body { overflow-x: hidden; }