/* ============================================
   ROOT COLORS — ED Medical Premium Palette
============================================ */
:root {
    --med-bg: #F7F6F4;              /* тёплый медицинский беж */
    --med-white: #FFFFFF;
    --med-border: #E4E1DC;         /* мягкий серо‑бежевый */

    --med-blue: #2E4A78;           /* глубокий navy */
    --med-blue-light: #EEF2FA;     /* мягкий клинический голубой */
    --med-blue-light-2: #E7ECF7;

    --med-graphite: #1D1F23;

    /* Accent — ED‑friendly navy */
    --med-accent-light: #4A6BB1;
    --med-accent-dark: #3A5692;
    --med-accent-shadow: #2E467A;
    --med-accent-shadow-hover: #243A66;

    /* Skin‑tone neutrals */
    --med-skin-light: #F3E8DA;
    --med-skin-dark: #C9A98A;
}

/* ============================================
   GLOBAL
============================================ */
body {
    background: var(--med-bg);
    color: var(--med-graphite);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1, h2, h3 {
    color: var(--med-blue);
}

.hero {
    background: var(--med-white);
    padding: 80px 20px;
    border-bottom: 1px solid var(--med-border);
}

.card {
    border: 1px solid var(--med-border);
    border-radius: 12px;
    background: var(--med-white);
}

#toc a {
    text-decoration: none;
    color: var(--med-blue);
}

#toc a:hover {
    text-decoration: underline;
}

/* ============================================
   ICONS
============================================ */
.benefit-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 12px;
    fill: var(--med-skin-dark);
    opacity: 0.9;
}

/* ============================================
   BADGES — ED Neutral Set
============================================ */
.badge {
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
    margin: 6px;
}

.badge-green {
    background: #E6F4EC;
    color: #1F4D2C;
}

.badge-blue {
    background: #E6EDFA;
    color: #2E4A78;
}

.badge-purple {
    background: #F2E9FF;
    color: #4A2A7A;
}

.badge-orange {
    background: #FCE9D8;
    color: #7A3A00;
}

/* ============================================
   CTA BUTTON — ED Navy Premium
============================================ */
.cta-btn {
    background: linear-gradient(to bottom, var(--med-accent-light) 0%, var(--med-accent-dark) 100%);
    color: var(--med-white);
    padding: 20px 48px;
    border-radius: 14px;
    font-weight: 900;
    font-size: 1.35rem;
    text-decoration: none;
    display: inline-block;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 4px 0 var(--med-accent-shadow);
    transition: 0.2s ease;
}

.cta-btn:hover {
    background: linear-gradient(to bottom, var(--med-accent-dark) 0%, var(--med-accent-shadow) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 3px 0 var(--med-accent-shadow-hover);
    transform: translateY(1px);
}

/* CTA animations */
@keyframes ctaPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(74, 107, 177, 0);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 18px rgba(74, 107, 177, 0.45);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(74, 107, 177, 0);
    }
}

.cta-pulse {
    animation: ctaPulse 6s ease-in-out infinite;
}

@keyframes ctaShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

.cta-btn-hover:hover {
    animation: ctaShake 0.25s ease;
}

.cta-animated {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.cta-animated.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   CTA BOX — Navy Premium Block
============================================ */
.cta-box {
    background: linear-gradient(to bottom, #3A5692 0%, #2E467A 100%);
    border-radius: 18px;
    padding: 48px 36px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    color: #fff;
    margin-top: 20px;
}

.cta-box-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
}

.cta-box-text {
    font-size: 1.15rem;
    color: #F0F4F8;
    margin: 28px 0;
    line-height: 1.6;
}

/* ============================================
   FAQ — Apple‑Style Accordion (ED palette)
============================================ */
.faq-section {
    background: var(--med-bg);
}

.faq-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--med-blue);
    margin-bottom: 32px;
}

.faq-item {
    border: 1px solid var(--med-border);
    border-radius: 14px;
    background: var(--med-white);
    margin-bottom: 22px;
    overflow: hidden;
    transition: box-shadow 0.35s ease;
}

.faq-item.open {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.faq-question {
    width: 100%;
    background: var(--med-blue-light);
    color: var(--med-blue);
    font-weight: 600;
    font-size: 1.15rem;
    padding: 22px 26px;
    border: none;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.25s ease, padding 0.25s ease;
}

.faq-item.open .faq-question {
    background: var(--med-blue-light-2);
    padding: 24px 26px;
}

.faq-icon {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--med-accent-light);
    transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1.4);
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    background: var(--med-white);
    color: var(--med-graphite);
    font-size: 1rem;
    line-height: 1.55;
    padding: 0 26px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.55s cubic-bezier(0.25, 0.1, 0.25, 1.4),
    padding 0.35s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 20px 26px 26px;
}

.faq-answer p {
    margin: 0;
}

/* ============================================
   Sticky CTA
============================================ */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f2f0eddd;
    backdrop-filter: blur(6px);
    border-top: 1px solid #d8d5d1;
    padding: 16px 20px;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.sticky-cta.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

@media (max-width: 420px) {
    .sticky-cta {
        padding: 12px;
    }

    .sticky-cta .cta-btn {
        padding: 16px 28px;
        font-size: 1.1rem;
    }
}

/* ============================
   TOC — Medical Premium
============================ */
.toc-card {
    border: 1px solid var(--med-border);
    border-radius: 14px;
}

.toc-toggle {
    cursor: pointer;
    color: var(--med-blue);
    user-select: none;
}

.toc-content {
    display: none;
}

.toc-content ul li a {
    color: var(--med-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.toc-content ul li a:hover {
    text-decoration: underline;
}

/* ============================================
   RELATED PAGES — Medical Premium Tile Grid
============================================ */
.related-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--med-blue);
    margin-bottom: 32px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.related-tile {
    background: var(--med-white);
    border: 1px solid var(--med-border);
    border-radius: 14px;
    padding: 24px 22px;
    text-decoration: none;
    display: block;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.related-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.related-tile-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--med-blue);
    margin-bottom: 8px;
}

.related-tile-text {
    font-size: 0.95rem;
    color: var(--med-graphite);
    line-height: 1.45;
}

/* ============================================
   TRUST FOOTER BADGES
============================================ */
.trust-footer-badge {
    background: #eef2fa;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    display: inline-block;
}

.trust-footer-badge:nth-child(2) { background: #f3f6fc; }
.trust-footer-badge:nth-child(3) { background: #f7f9fc; }
.trust-footer-badge:nth-child(4) { background: #eef4ff; }
.trust-footer-badge:nth-child(5) { background: #f5f8ff; }
.trust-footer-badge:nth-child(6) { background: #eaf1ff; }
.trust-footer-badge:nth-child(7) { background: #f2f5ff; }

.trust-footer-badge a {
    color: #2c3e50;
    font-weight: 500;
}

/* Desktop: картинка справа */
.page-img {
    max-width: 360px;
}

/* Mobile: картинка сверху */
@media (max-width: 768px) {
    .page-img {
        float: none !important;
        display: block !important;
        margin: 0 auto 24px auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}
