/*
* Осенняя тема «Вектор-А» — светлая «золотая осень»
* Подключается после style.css. Все правила ограничены body:not(.contrast),
* поэтому версия для слабовидящих (accessibility.css) остаётся нетронутой.
* Чтобы выключить тему — уберите подключение autumn.css и partials/_autumn.html
* из base.html и base2.html.
*/
body:not(.contrast) {
    --au-bg: #fffaf2;
    --au-card: #ffffff;
    --au-ink: #2d2622;
    --au-ink-soft: #6b6058;
    --au-persimmon: #e2572b;
    --au-persimmon-deep: #c2441c;
    --au-gold: #f5b83d;
    --au-gold-soft: #fdecc4;
    --au-teal: #2f8f8a;
    --au-teal-soft: #d7efec;
    --au-line: #f0e2cc;
    --au-off: var(--au-gold);

    --bs-primary: var(--au-persimmon);
    --bs-primary-rgb: 226, 87, 43;
    --bs-link-color: var(--au-persimmon-deep);
    --bs-link-color-rgb: 194, 68, 28;
    --bs-link-hover-color: var(--au-teal);
    --bs-link-hover-color-rgb: 47, 143, 138;
    --bs-body-color: var(--au-ink);
    --bs-secondary-color: var(--au-ink-soft);
    --bs-border-color: var(--au-line);

    font-family: 'Manrope', 'Montserrat', sans-serif;
    color: var(--au-ink);
    background-color: var(--au-bg) !important;
    /* Мягкий солнечный свет по углам страницы */
    background-image:
        radial-gradient(circle at 100% 0%, rgba(245, 184, 61, .22), transparent 32rem),
        radial-gradient(circle at 0% 100%, rgba(47, 143, 138, .10), transparent 30rem) !important;
    background-attachment: fixed;
}

/* ---------- Типографика ---------- */
body:not(.contrast) h1,
body:not(.contrast) h2,
body:not(.contrast) .navbar-brand {
    font-family: 'Unbounded', 'Manrope', sans-serif;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--au-ink);
}

body:not(.contrast) h3,
body:not(.contrast) h5,
body:not(.contrast) .card-title {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    color: var(--au-ink);
}

body:not(.contrast) main h2 {
    font-size: clamp(1.5rem, 3.2vw, 2.1rem);
}

/* Мазок «золотого маркера» под заголовками разделов */
body:not(.contrast) main h2.text-center::after,
body:not(.contrast) main .text-center > h2::after,
body:not(.contrast) .services-title h1::after {
    content: '';
    display: block;
    width: 110px;
    height: 12px;
    margin: .5rem auto 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 110 12'%3E%3Cpath d='M3 8 C25 3 50 9 72 5 S100 4 107 6' stroke='%23f5b83d' stroke-width='6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

body:not(.contrast) .services-title h1 {
    color: var(--au-ink) !important;
    font-weight: 600;
}

body:not(.contrast) .lead,
body:not(.contrast) .intro-text {
    color: var(--au-ink-soft) !important;
}

body:not(.contrast) .text-primary { color: var(--au-persimmon) !important; }
body:not(.contrast) .text-muted   { color: var(--au-ink-soft) !important; }
body:not(.contrast) .text-dark    { color: var(--au-ink) !important; }

body:not(.contrast) a { color: var(--au-persimmon-deep); }
body:not(.contrast) a:hover { color: var(--au-teal); }

/* ---------- Верхняя полоса ---------- */
body:not(.contrast) header > .bg-light {
    background: transparent !important;
}

body:not(.contrast) .header-top-bar a,
body:not(.contrast) .header-top-bar .text-dark {
    color: var(--au-ink) !important;
    transition: color .2s ease;
}

body:not(.contrast) .header-top-bar a:hover {
    color: var(--au-persimmon) !important;
}

body:not(.contrast) .header-top-bar .btn-outline-dark {
    border-radius: 999px;
    border-color: var(--au-line);
    background: var(--au-card);
}

body:not(.contrast) .header-top-bar .btn-outline-dark:hover {
    background: var(--au-gold);
    border-color: var(--au-gold);
    color: var(--au-ink);
}

/* ---------- Навигация: «плавающая» панель ---------- */
body:not(.contrast) .navbar {
    background: var(--au-card);
    border: 1px solid var(--au-line);
    border-radius: 999px;
    margin: .25rem clamp(.5rem, 2vw, 1.5rem) .75rem;
    padding: .35rem .75rem;
    box-shadow: 0 6px 20px -14px rgba(45, 38, 34, .35);
}

@media (max-width: 1399.98px) {
    body:not(.contrast) .navbar { border-radius: 22px; }
}

body:not(.contrast) .navbar-brand {
    font-size: 1.15rem;
    color: var(--au-ink) !important;
}

/* Логотип: кленовый лист в кружке */
body:not(.contrast) .navbar-brand::before {
    content: '';
    display: inline-block;
    width: 1.6em;
    height: 1.6em;
    margin-right: .45em;
    vertical-align: -.45em;
    border-radius: 50%;
    background: var(--au-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2 5 4-2-1 5 5 1-4 3 2 3-5-1v5h-2v-5l-5 1 2-3-4-3 5-1-1-5 4 2z' fill='%23e2572b'/%3E%3C/svg%3E") no-repeat center / 62%;
}

body:not(.contrast) .nav-link {
    color: var(--au-ink) !important;
    border-radius: 999px;
    padding-inline: .7rem !important;
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease;
}

body:not(.contrast) .nav-link:not(.navbar-brand):hover {
    background: var(--au-gold-soft);
    color: var(--au-ink) !important;
}

body:not(.contrast) .nav-link.active:not(.navbar-brand) {
    background: var(--au-persimmon);
    color: #fff !important;
}

body:not(.contrast) .navbar-brand.nav-link:hover {
    background: transparent;
}

/* ---------- Баннер: светлый, текст слева ---------- */
body:not(.contrast) header > .position-relative {
    height: auto !important;
    min-height: 340px;
    margin: 0 clamp(.5rem, 2vw, 1.5rem);
    border-radius: 32px;
    overflow: hidden;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 2.5rem clamp(1.25rem, 6vw, 5rem) !important;
}

body:not(.contrast) header > .position-relative > img {
    object-position: 70% center;
    filter: saturate(1.1) brightness(1.05);
}

body:not(.contrast) .banner-overlay {
    background: linear-gradient(90deg, rgba(255, 250, 242, .97) 0%, rgba(255, 250, 242, .9) 38%, rgba(255, 250, 242, .1) 72%) !important;
    opacity: 1 !important;
}

body:not(.contrast) .banner-text-container {
    max-width: 32rem;
}

/* Плашка-«сезон» над названием */
body:not(.contrast) .banner-text-container::before {
    content: 'Осень · время позаботиться о себе';
    display: inline-block;
    margin-bottom: 1rem;
    padding: .3rem .85rem;
    border-radius: 999px;
    background: var(--au-teal-soft);
    color: var(--au-teal);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
}

body:not(.contrast) .banner-text-container h2 {
    color: var(--au-ink);
    font-size: clamp(2.2rem, 5.5vw, 3.6rem);
    line-height: 1.05;
    margin-bottom: .75rem;
}

body:not(.contrast) .banner-text-container p {
    color: var(--au-ink-soft);
    font-size: 1.05rem;
    margin-bottom: 1.5rem !important;
}

@media (max-width: 767.98px) {
    body:not(.contrast) .banner-overlay {
        background: rgba(255, 250, 242, .88) !important;
    }
}

/* ---------- Кнопки ---------- */
body:not(.contrast) .btn-primary {
    --bs-btn-bg: var(--au-persimmon);
    --bs-btn-border-color: var(--au-persimmon);
    --bs-btn-hover-bg: var(--au-persimmon-deep);
    --bs-btn-hover-border-color: var(--au-persimmon-deep);
    --bs-btn-active-bg: var(--au-persimmon-deep);
    background: var(--au-persimmon);
    border-color: var(--au-persimmon);
    color: #fff;
    font-weight: 700;
    border-radius: 999px;
    padding: .6rem 1.5rem;
    transition: transform .2s ease, background-color .2s ease;
}

body:not(.contrast) .btn-primary:hover {
    background: var(--au-persimmon-deep);
    border-color: var(--au-persimmon-deep);
    transform: translateY(-2px);
}

body:not(.contrast) .btn-outline-primary {
    --bs-btn-color: var(--au-persimmon-deep);
    --bs-btn-border-color: var(--au-persimmon);
    --bs-btn-hover-bg: var(--au-persimmon);
    --bs-btn-hover-border-color: var(--au-persimmon);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--au-persimmon-deep);
    border-radius: 999px;
    font-weight: 700;
}

body:not(.contrast) .btn-yellow {
    background: var(--au-gold);
    border-color: var(--au-gold);
    color: var(--au-ink);
    border-radius: 999px;
    font-weight: 700;
}

/* ---------- Карточки: контур + цветная сдвинутая тень ---------- */
body:not(.contrast) .card {
    background-color: var(--au-card) !important;
    border: 1.5px solid var(--au-ink) !important;
    border-radius: 20px !important;
    box-shadow: 6px 6px 0 var(--au-off) !important;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

body:not(.contrast) .card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 9px 9px 0 var(--au-off) !important;
}

/* Цвет тени чередуется: золото → хурма → бирюза */
body:not(.contrast) .row > :nth-child(3n+2) > .card { --au-off: var(--au-persimmon); }
body:not(.contrast) .row > :nth-child(3n)   > .card { --au-off: var(--au-teal); }

body:not(.contrast) .card-title.text-primary,
body:not(.contrast) .info-card h3,
body:not(.contrast) .symptoms-card h3,
body:not(.contrast) .equipment-card h3 {
    color: var(--au-ink) !important;
}

body:not(.contrast) .card-footer.bg-light {
    background: var(--au-gold-soft) !important;
    border-top: 1.5px solid var(--au-ink);
}

body:not(.contrast) .specialist-img-container {
    background: var(--au-teal-soft) !important;
}

body:not(.contrast) .symptoms-list li::before,
body:not(.contrast) .perks-list li::before {
    color: var(--au-teal) !important;
}

body:not(.contrast) .list-group-item {
    background: transparent;
    border-color: var(--au-line);
    color: var(--au-ink);
}

/* Отзывы — «облачка» сообщений */
body:not(.contrast) .reviews-list .list-group-item {
    background: var(--au-gold-soft);
    border: 0;
    border-radius: 16px 16px 16px 4px;
    margin-bottom: .6rem;
    padding: .7rem 1rem;
}

/* ---------- Таблицы цен ---------- */
body:not(.contrast) .table {
    --bs-table-bg: var(--au-card);
    --bs-table-color: var(--au-ink);
    --bs-table-hover-bg: var(--au-gold-soft);
    --bs-table-hover-color: var(--au-ink);
    --bs-table-border-color: var(--au-line);
}

body:not(.contrast) .table-primary,
body:not(.contrast) .table-primary > * {
    --bs-table-bg: var(--au-gold);
    --bs-table-color: var(--au-ink);
    --bs-table-border-color: var(--au-gold);
    background-color: var(--au-gold) !important;
    color: var(--au-ink) !important;
}

body:not(.contrast) .price-table {
    border: 1.5px solid var(--au-ink);
    border-radius: 18px !important;
    box-shadow: 6px 6px 0 var(--au-teal-soft) !important;
}

@media (max-width: 768px) {
    body:not(.contrast) .price-table table tr {
        border-bottom-color: var(--au-gold) !important;
    }
}

/* ---------- Вкладки ---------- */
body:not(.contrast) .nav-tabs {
    border-bottom-color: var(--au-line);
}

body:not(.contrast) .nav-tabs .nav-link {
    border-radius: 999px !important;
    border: 0 !important;
}

body:not(.contrast) .nav-tabs .nav-link.active {
    background: var(--au-persimmon) !important;
    color: #fff !important;
}

/* ---------- Подвал ---------- */
body:not(.contrast) footer.bg-dark {
    margin: 3rem clamp(.5rem, 2vw, 1.5rem) 1rem;
    padding: 1.5rem 1rem !important;
    border-radius: 24px;
    background: var(--au-gold-soft) !important;
    color: var(--au-ink) !important;
}

body:not(.contrast) footer.bg-dark p {
    margin: 0;
}

/* ---------- Лайтбокс ---------- */
body:not(.contrast) .lightbox {
    background-color: rgba(45, 38, 34, .92);
}

/* ---------- Падающие листья ---------- */
.autumn-leaves {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1040;
}

.autumn-leaves span {
    position: absolute;
    top: -40px;
    width: 22px;
    height: 22px;
    opacity: 0;
    background: no-repeat center / contain;
    animation: au-fall 16s linear 3 both, au-sway 4s ease-in-out infinite alternate;
}

.autumn-leaves span:nth-child(3n+1) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2 5 4-2-1 5 5 1-4 3 2 3-5-1v5h-2v-5l-5 1 2-3-4-3 5-1-1-5 4 2z' fill='%23e2572b'/%3E%3C/svg%3E");
}

.autumn-leaves span:nth-child(3n+2) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C18 6 19 14 12 22C5 14 6 6 12 2Z' fill='%23f5b83d'/%3E%3Cpath d='M12 4V22' stroke='%23c2441c' stroke-width='.8'/%3E%3C/svg%3E");
}

.autumn-leaves span:nth-child(3n) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C18 6 19 14 12 22C5 14 6 6 12 2Z' fill='%23f08a3c'/%3E%3C/svg%3E");
}

.autumn-leaves span:nth-child(1) { left: 6%;  animation-delay: 0s, 0s;    animation-duration: 17s, 4s; }
.autumn-leaves span:nth-child(2) { left: 18%; animation-delay: 5s, 1s;    animation-duration: 21s, 5s; width: 16px; height: 16px; }
.autumn-leaves span:nth-child(3) { left: 31%; animation-delay: 9s, .5s;   animation-duration: 15s, 3.5s; }
.autumn-leaves span:nth-child(4) { left: 47%; animation-delay: 2s, 2s;    animation-duration: 23s, 4.5s; width: 18px; height: 18px; }
.autumn-leaves span:nth-child(5) { left: 62%; animation-delay: 12s, 1.5s; animation-duration: 18s, 5s; }
.autumn-leaves span:nth-child(6) { left: 74%; animation-delay: 7s, 0s;    animation-duration: 20s, 3.8s; width: 15px; height: 15px; }
.autumn-leaves span:nth-child(7) { left: 86%; animation-delay: 3s, 1s;    animation-duration: 16s, 4.2s; }
.autumn-leaves span:nth-child(8) { left: 94%; animation-delay: 14s, .7s;  animation-duration: 22s, 4.8s; width: 17px; height: 17px; }

@keyframes au-fall {
    0%   { opacity: 0;   transform: translateY(0) rotate(0deg); }
    8%   { opacity: .85; }
    90%  { opacity: .7; }
    100% { opacity: 0;   transform: translateY(105vh) rotate(540deg); }
}

@keyframes au-sway {
    from { margin-left: -24px; }
    to   { margin-left: 24px; }
}

/* На телефонах — меньше листьев */
@media (max-width: 767.98px) {
    .autumn-leaves span:nth-child(even) { display: none; }
}

/* Без анимации для тех, кто её отключил, и в версии для слабовидящих */
@media (prefers-reduced-motion: reduce) {
    .autumn-leaves { display: none; }
    body:not(.contrast) .card,
    body:not(.contrast) .btn-primary { transition: none; }
    body:not(.contrast) .card:hover,
    body:not(.contrast) .btn-primary:hover { transform: none; }
}

body.contrast .autumn-leaves {
    display: none;
}
