/* ============ БАЗА И ТЕМЫ ============ */
:root {
    --bg: #fff8f0;
    --bg-soft: #ffe7d1;
    --text: #3a2418;
    --text-soft: #6b4a3a;
    --accent: #d62828;
    --accent-2: #ff7b54;
    --accent-3: #ffb347;
    --card: #ffffff;
    --shadow: rgba(214, 40, 40, 0.25);
    --menu-bg: rgba(255, 248, 240, 0.95);
}

html[data-theme="dark"] {
    --bg: #1b1410;
    --bg-soft: #2a1e18;
    --text: #f5e6d8;
    --text-soft: #c9a893;
    --accent: #ff8a65;
    --accent-2: #ffab40;
    --accent-3: #ffd166;
    --card: #241a15;
    --shadow: rgba(0, 0, 0, 0.6);
    --menu-bg: rgba(27, 20, 16, 0.95);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
}

/* ============ HERO ============ */
.hero {
    position: relative;
    background: linear-gradient(135deg, #ffb347 0%, #ff7b54 50%, #d62828 100%);
    color: #fff;
    text-align: center;
    padding: 70px 20px 55px;
    box-shadow: 0 6px 20px var(--shadow);
    transition: box-shadow 0.4s ease;
}
.hero h1 {
    font-family: 'Pacifico', cursive;
    font-size: clamp(2rem, 6vw, 3.5rem);
    text-shadow: 2px 4px 0 rgba(0,0,0,0.15);
    margin-bottom: 12px;
}
.hero p { font-size: clamp(1rem, 2.5vw, 1.3rem); opacity: 0.95; }

.hero-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.hero-btn {
    padding: 12px 26px;
    border-radius: 50px;
    border: 2px solid rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.hero-btn:hover {
    background: #fff;
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* ============ ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ============ */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(6px);
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
    background: rgba(255,255,255,0.35);
}

/* ============ МЕНЮ ============ */
.menu {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background: var(--menu-bg);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transition: background 0.4s ease;
}
.menu-link {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    color: var(--accent);
    padding: 10px 18px;
    border-radius: 50px;
    background: var(--bg-soft);
    transition: all 0.3s ease;
    font-size: 0.95rem;
}
.menu-link:hover,
.menu-link.active {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--shadow);
}

/* ============ КАРУСЕЛЬ ============ */
.carousel-wrap {
    position: relative;
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 70px;
    overflow: hidden;
}

.carousel {
    position: relative;
    min-height: 620px;
}

.slide {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    animation: fadeSlide 0.5s ease;
}
.slide.active { display: grid; }

@keyframes fadeSlide {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============ КАРТИНКА / SVG ============ */
.slide-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 18px 40px var(--shadow);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}
.slide-img img,
.slide-img svg {
    width: 100%;
    max-width: 420px;
    height: auto;
    display: block;
    border-radius: 16px;
}
.pie-svg {
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
    transition: transform 0.4s ease;
}
.slide-img:hover .pie-svg {
    transform: scale(1.04) rotate(-1deg);
}

/* ============ КОНТЕНТ СЛАЙДА ============ */
.slide-content h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--accent);
    margin-bottom: 8px;
}
.slide-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.desc {
    font-size: 1.05rem;
    margin-bottom: 18px;
    color: var(--text-soft);
    font-style: italic;
}
.slide-content h3 {
    margin: 18px 0 8px;
    color: var(--accent-2);
    font-size: 1.1rem;
}
.slide-content h3 small {
    font-weight: 400;
    font-size: 0.8em;
    color: var(--text-soft);
}
.slide-content ol { padding-left: 22px; }
.slide-content ol li { margin-bottom: 6px; }
.slide-content ol li::marker { color: var(--accent); font-weight: 900; }

/* ============ КНОПКИ ПЕЧАТИ / PDF ============ */
.print-btn,
.pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    background: transparent;
}
.print-btn {
    border: 2px solid var(--accent);
    color: var(--accent);
}
.print-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--shadow);
}
.pdf-btn {
    border: 2px solid var(--accent-2);
    color: var(--accent-2);
}
.pdf-btn:hover {
    background: var(--accent-2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--shadow);
}
.pdf-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.print-btn:active,
.pdf-btn:active { transform: translateY(0); }

/* ============ ЧЕК-ЛИСТ ============ */
.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.checklist li { margin-bottom: 6px; }
.checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    transition: background 0.2s ease;
}
.checklist label:hover { background: var(--bg-soft); }
.checklist input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
.checklist input[type="checkbox"]:checked { background: var(--accent); }
.checklist input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    inset: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}
.checklist label:has(input:checked) {
    opacity: 0.55;
    text-decoration: line-through;
}

.reset-btn {
    margin-top: 8px;
    border: none;
    background: transparent;
    color: var(--accent-2);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
.reset-btn:hover { opacity: 1; }

/* ============ СТРЕЛКИ ============ */
.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 20px var(--shadow);
    transition: all 0.3s ease;
    z-index: 10;
}
.arrow:hover {
    background: var(--accent-2);
    transform: translateY(-50%) scale(1.1);
}
.arrow-left { left: 10px; }
.arrow-right { right: 10px; }

/* ============ ТОЧКИ ============ */
.dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-soft);
    cursor: pointer;
    transition: all 0.3s ease;
}
.dot.active {
    background: var(--accent);
    transform: scale(1.4);
}

/* ============ FOOTER ============ */
footer {
    text-align: center;
    padding: 30px 20px;
    background: #3a2418;
    color: #ffd9b3;
    margin-top: 60px;
}
html[data-theme="dark"] footer {
    background: #0f0a07;
    color: var(--accent-3);
}

/* ============ ПЕЧАТНАЯ ВЕРСИЯ ============ */
.print-header { display: none; }

@media print {
    .hero,
    .menu,
    .arrow,
    .dots,
    .theme-toggle,
    .print-btn,
    .pdf-btn,
    .reset-btn,
    .hero-actions,
    footer,
    .slide:not(.printing) {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }

    .carousel-wrap {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        overflow: visible !important;
    }
    .carousel { min-height: auto !important; }

    .print-header {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        gap: 20pt;
        border-bottom: 2pt solid #000;
        padding-bottom: 8pt;
        margin-bottom: 12pt;
    }
    .print-header .brand {
        display: flex;
        align-items: center;
        gap: 8pt;
        font-size: 14pt;
        font-weight: 900;
    }
    .print-header .brand .logo { font-size: 24pt; line-height: 1; }
    .print-header .qr {
        text-align: center;
        font-size: 9pt;
        color: #555;
    }
    .print-header .qr img,
    .print-header .qr canvas {
        width: 90pt;
        height: 90pt;
        display: block;
        margin-bottom: 2pt;
        background: #fff;
    }

    .slide.printing {
        display: block !important;
        animation: none !important;
        page-break-after: always;
        page-break-inside: avoid;
    }
    .slide.printing:last-of-type { page-break-after: auto; }

    .slide.printing .slide-img {
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .slide.printing .slide-img svg,
    .slide.printing .slide-img img {
        max-width: 60%;
        margin: 0 auto 16pt;
        display: block;
        filter: none !important;
        transform: none !important;
    }

    .slide-content h2 {
        color: #000 !important;
        font-size: 20pt;
        margin-bottom: 6pt;
        padding-bottom: 4pt;
    }
    .desc {
        color: #333 !important;
        font-style: italic;
        margin-bottom: 12pt;
    }
    .slide-content h3 {
        color: #000 !important;
        font-size: 14pt;
        margin: 12pt 0 6pt;
        border-bottom: 1pt solid #999;
        padding-bottom: 2pt;
    }

    .checklist { list-style: none; padding: 0; }
    .checklist li {
        padding: 2pt 0;
        border-bottom: 1pt dotted #ccc;
    }
    .checklist label { padding: 0; opacity: 1 !important; text-decoration: none !important; }
    .checklist input[type="checkbox"] {
        display: inline-block !important;
        -webkit-appearance: none;
        appearance: none;
        width: 12pt !important;
        height: 12pt !important;
        min-width: 12pt !important;
        border: 1.5pt solid #000 !important;
        border-radius: 2pt !important;
        background: #fff !important;
        position: relative;
        vertical-align: middle;
        margin-right: 6pt;
    }
    .checklist input[type="checkbox"]:checked::after {
        content: "✓" !important;
        color: #000 !important;
        font-size: 10pt !important;
        font-weight: 900;
    }
    .checklist label:has(input:checked) {
        opacity: 1 !important;
        text-decoration: line-through;
        color: #666 !important;
    }

    .slide-content ol { padding-left: 20pt; }
    .slide-content ol li {
        margin-bottom: 4pt;
        page-break-inside: avoid;
    }
    .slide-content ol li::marker { color: #000 !important; font-weight: 900; }

    @page { margin: 15mm; }
}

/* ============ АДАПТИВ ============ */
@media (max-width: 900px) {
    .carousel-wrap { padding: 0 20px; }
    .slide { grid-template-columns: 1fr; gap: 22px; }
    .arrow {
        width: 42px;
        height: 42px;
        font-size: 1.6rem;
    }
    .arrow-left { left: 4px; }
    .arrow-right { right: 4px; }
    .menu-link { padding: 8px 14px; font-size: 0.85rem; }
    .carousel { min-height: auto; }
    .hero-actions { flex-direction: column; align-items: center; }
}