/**
 * Tabobat — светло-синяя палитра (медицина / чистота / воздух)
 * Подключается последним.
 */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #38bdf8;
    --dark: #1e293b;
    /* Тот же градиент, что у шапки — для hero и акцентов */
    --brand-gradient: linear-gradient(135deg, #1d4ed8 0%, #2563eb 42%, #3b82f6 100%);
    --gradient-primary: var(--brand-gradient);
    --gradient-hero: var(--brand-gradient);
    --wellness-sky: #bae6fd;
    --wellness-ice: #e0f2fe;
    --shadow-sm: 0 2px 14px rgba(37, 99, 235, 0.08);
    --shadow-md: 0 10px 32px rgba(37, 99, 235, 0.12);
    --shadow-lg: 0 18px 48px rgba(37, 99, 235, 0.14);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    color: var(--dark);
    background:
        linear-gradient(180deg, rgba(240, 249, 255, 0.94) 0%, rgba(224, 242, 254, 0.96) 50%, rgba(248, 250, 252, 0.97) 100%),
        url('/images/backgrounds/herbs-desktop.jpg') center / cover no-repeat,
        linear-gradient(160deg, #e0f2fe 0%, #f0f9ff 50%, #f8fafc 100%);
}

@media (max-width: 768px) {
    body {
        background:
            linear-gradient(180deg, rgba(240, 249, 255, 0.94) 0%, rgba(224, 242, 254, 0.96) 100%),
            url('/images/backgrounds/herbs-mobile.jpg') center / cover no-repeat,
            linear-gradient(160deg, #e0f2fe 0%, #f0f9ff 100%);
    }
}

.container.mt-4 {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 20px;
    box-shadow:
        0 4px 28px rgba(37, 99, 235, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.container.mt-4 h1,
.container.mt-4 .display-3,
.container.mt-4 .section-title {
    color: #172554;
    letter-spacing: -0.02em;
}

.container.mt-4 .lead,
.container.mt-4 .text-muted {
    color: #334155 !important;
}

.card {
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.14);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card:hover {
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: var(--shadow-md);
}

.hover-card {
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    position: relative;
}

.hover-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #7dd3fc, #bae6fd);
    opacity: 0.95;
    z-index: 1;
    pointer-events: none;
}

.hover-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.12) !important;
}

.icon-wrapper,
.icon-wrapper-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.12), rgba(125, 211, 252, 0.28));
    color: #2563eb !important;
}

.icon-wrapper-small {
    width: 60px;
    height: 60px;
    border-radius: 14px;
}

.btn-success {
    background: linear-gradient(165deg, #2563eb 0%, #3b82f6 100%) !important;
    border: none !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
    border-radius: 12px !important;
}

.btn-success:hover,
.btn-success:focus {
    background: linear-gradient(165deg, #1d4ed8 0%, #2563eb 100%) !important;
    box-shadow: 0 6px 22px rgba(29, 78, 216, 0.32);
    transform: translateY(-1px);
}

.btn-outline-success {
    border-width: 2px;
    border-color: #3b82f6 !important;
    color: #1e40af !important;
    font-weight: 600;
    border-radius: 12px !important;
}

.btn-outline-success:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #1e3a8a !important;
}

.btn-light.hero-btn {
    border-radius: 14px !important;
    font-weight: 600;
    color: #1e40af !important;
    border: none;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.15) !important;
}

footer,
.footer {
    background: linear-gradient(168deg, #1e40af 0%, #2563eb 38%, #3b82f6 72%, #3d6fd8 100%);
    margin-top: 4rem;
    padding-top: 2.75rem;
    padding-bottom: 1.5rem;
    box-shadow: 0 -12px 40px rgba(15, 45, 120, 0.28);
}

footer h5 {
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-bottom-color: rgba(255, 255, 255, 0.35) !important;
}

footer a,
footer .footer-link {
    color: rgba(255, 255, 255, 0.92);
}

footer a:hover,
footer .footer-link:hover {
    color: #f0f9ff !important;
}

footer .badge {
    font-weight: 600;
    border-radius: 999px;
    padding: 0.4em 0.75em;
}

footer .badge.bg-primary {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
}

footer .badge.bg-success {
    background: rgba(255, 255, 255, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

/* Footer in navbar-like style */
.site-footer {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 42%, #3b82f6 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 -12px 36px rgba(15, 45, 120, 0.30);
}

.site-footer .site-footer__inner {
    padding-top: 2rem;
    padding-bottom: 1.15rem;
}

.site-footer .site-footer__top {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    margin-left: 0;
    margin-right: 0;
    padding: 10px 6px;
}

.site-footer .site-footer__col {
    padding: 16px 18px;
}

.site-footer .site-footer__cta {
    height: 100%;
    background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 52%, #1e40af 100%);
    border: 1px solid rgba(147, 197, 253, 0.28);
    border-radius: 14px;
    padding: 18px 18px 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-footer .site-footer__title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff !important;
    border-bottom-color: rgba(255, 255, 255, 0.36) !important;
}

.site-footer .site-footer__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e0f2fe;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
    margin-left: 3px;
}

.site-footer .site-footer__text {
    color: rgba(255, 255, 255, 0.93);
    margin-bottom: 0.9rem;
}

.site-footer .footer-link {
    color: rgba(255, 255, 255, 0.94);
    border-radius: 8px;
    padding: 2px 4px;
}

.site-footer .footer-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15);
    transform: none;
}

.site-footer .site-footer__divider {
    border-color: rgba(255, 255, 255, 0.28);
    margin: 0.95rem 0 0.8rem;
}

.site-footer .site-footer__copyright {
    color: rgba(255, 255, 255, 0.92);
}

.site-footer .site-footer__disclaimer {
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.94rem;
}

.site-footer .site-footer__btn {
    border-radius: 999px !important;
    font-weight: 700;
    padding: 0.52rem 1rem !important;
    font-size: 0.95rem;
}

.site-footer .site-footer__stats .badge {
    border-radius: 999px;
}

.section-title {
    border-bottom: 3px solid #3b82f6;
    padding-bottom: 0.65rem;
}

/* Hero на всех страницах — фон как у navbar */
.hero-section {
    background: var(--brand-gradient);
    box-shadow: 0 8px 28px rgba(15, 45, 120, 0.28);
}

.hero-section .hero-overlay {
    background: linear-gradient(
        135deg,
        rgba(23, 37, 84, 0.72) 0%,
        rgba(30, 64, 175, 0.58) 45%,
        rgba(12, 74, 110, 0.52) 100%
    );
}

.hero-section .hero-icon {
    color: #e0f2fe;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.25));
}

/* Герой разделов (Ибн Сино, фитотерапия, онкология) */
.section-hero {
    background: var(--brand-gradient) !important;
    color: #fff !important;
    border-radius: 15px;
    padding: 2rem !important;
    box-shadow: 0 8px 28px rgba(15, 45, 120, 0.22);
}

.section-hero .lead,
.section-hero .opacity-75 {
    color: rgba(255, 255, 255, 0.92) !important;
}

/*
 * Текст под заголовком в hero — всегда белый (день и ночь).
 * Перебивает .container.mt-4 .lead / .text-muted с !important выше.
 */
.container.mt-4 .section-hero .lead,
.container.mt-4 .section-hero .opacity-75,
.container.mt-4 .hero-section .lead,
.container.mt-4 .hero-section .hero-subtitle,
.container.mt-4 .survey-hero .survey-hero__text,
.container.mt-4 .result-hero .result-hero__complaint,
.hero-section .lead,
.hero-section .hero-subtitle,
.survey-hero .survey-hero__text,
.result-hero .result-hero__complaint {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Мизож / опрос — фон hero-блоков */
body.dark-theme .container.mt-4 h1,
body.dark-theme .container.mt-4 .display-3,
body.dark-theme .container.mt-4 .section-title {
    color: var(--dark-text-primary);
}

body.dark-theme .container.mt-4 .lead {
    color: var(--dark-text-secondary) !important;
}

body.dark-theme .icon-wrapper,
body.dark-theme .icon-wrapper-small {
    background: linear-gradient(145deg, rgba(56, 189, 248, 0.18), rgba(88, 166, 255, 0.12));
    color: var(--dark-accent) !important;
}

body.dark-theme footer .badge.bg-primary {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
}

body.dark-theme .section-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 48%, #1e40af 100%) !important;
}

body.dark-theme .survey-hero,
body.dark-theme .result-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 48%, #1e40af 100%) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .hover-card,
    .btn-success,
    .btn-outline-success {
        transition: none !important;
    }

    .hover-card:hover,
    .btn-success:hover {
        transform: none;
    }
}
