:root {
    --color-green: #4db373;
    --color-blue: #93bffe;
    --color-orange: #fb9154;
    --color-pink: #eea9e8;
    --color-beige: #f4f0e5;

    --color-text: #383632;
    --color-text-light: #595755;
    --color-border: #dcd6c8;
    --color-white: #FFFFFF;

    --shadow-sm: 0 2px 4px rgba(56, 54, 50, 0.05);
    --shadow-md: 0 4px 12px rgba(56, 54, 50, 0.1);
    --radius: 12px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-beige);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: transparent;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--color-text);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-light);
}

/* Steps General */
/* Steps General */
.step-container {
    display: none;
    animation: fadeIn 0.4s ease;
}

.step-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.step-container h2 {
    font-size: 1.8rem;
    color: var(--color-text);
}

/* Categories Grid */
/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.category-card {
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: 15px 12px;
    /* Меньше поля */
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
}

.category-card:hover {
    border-color: var(--color-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-card.selected {
    border-color: var(--color-green);
    background: #fff;
    box-shadow: 0 0 0 1px var(--color-green);
}

.category-card.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    color: var(--color-green);
    font-weight: bold;
    font-size: 1.1rem;
}

.category-icon {
    margin-bottom: 8px;
    /* Было 10 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.category-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
    /* Было 5, делаем минимальный отступ */
    line-height: 1.2;
}

.category-card p {
    font-size: 0.85rem;
    color: var(--color-text-light);
    line-height: 1.25;
    margin-top: 0;
}

.category-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.category-card:has(.category-checkbox:focus-visible) {
    outline: 3px solid #2f7d4d;
    outline-offset: 2px;
}

/* Triggers Layout */
.trigger-category {
    margin-bottom: 26px;
    border: 1px solid #d8d3c7;
    border-radius: 16px;
    background: #f8f6ef;
    box-shadow: 0 8px 18px rgba(56, 54, 50, 0.06);
    overflow: hidden;
}

.category-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #fcfbf7 0%, #f4f1e7 100%);
    border-bottom: 1px solid #ddd7ca;
}

.category-header:focus-visible {
    outline: 3px solid #2f7d4d;
    outline-offset: -3px;
}

.category-title-row {
    display: flex;
    align-items: center;
    min-width: 0;
}

.category-title-row h3 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.2;
    color: #2f3130;
}

.category-toggle-icon {
    color: #4b4a47;
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.25s ease;
}

.category-content {
    padding: 14px;
}

.trigger-category-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 5px solid var(--color-green);
    /* Default color, overridden by JS inline style */
}

/* Карточка группы (как в Test) */
.trigger-group {
    background: #fff;
    border: 1px solid #ddd8cb;
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 16px;
    transition: var(--transition);
}

.trigger-group:hover {
    border-color: #c7d8cd;
    box-shadow: 0 6px 14px rgba(56, 54, 50, 0.08);
}

/* Заголовок группы с чекбоксом */
.trigger-group-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    padding-bottom: 12px;
    border-bottom: 1px solid #ebe6dc;
}

.group-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    accent-color: var(--color-green);
    cursor: pointer;
}

.trigger-group-title-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Список триггеров */
.triggers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trigger-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    background: #f3eee3;
    border: 1px solid #e5decc;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.93rem;
    line-height: 1.35;
    transition: var(--transition);
    user-select: none;
}

.trigger-item:hover {
    background: #ebe5d8;
    border-color: #d9cfb8;
}

.trigger-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.trigger-item:has(.trigger-checkbox:focus-visible) {
    outline: 3px solid #2f7d4d;
    outline-offset: 2px;
}

/* Стилизация выбранного триггера */
.trigger-item:has(.trigger-checkbox:checked) {
    background: #4db373;
    color: var(--color-white);
    border-color: #4db373;
    box-shadow: 0 3px 8px rgba(77, 179, 115, 0.28);
}

/* Custom Input */
.custom-trigger-input {
    display: flex;
    margin-top: 14px;
    width: 100%;
}

.custom-trigger-input input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #cec6b6;
    border-radius: 10px 0 0 10px;
    font-family: inherit;
    font-size: 0.94rem;
    border-right: none;
    background: #fffdfa;
}

.custom-trigger-input input:focus {
    outline: none;
    border-color: #93bffe;
}

.custom-trigger-input button {
    padding: 0 22px;
    background: #3f3c37;
    color: var(--color-white);
    border: none;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}

.custom-trigger-input button:hover {
    background: var(--color-green);
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: var(--color-green);
    color: var(--color-white);
    padding: 15px 40px;
    border-radius: 30px;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(77, 179, 115, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #3da062;
    box-shadow: 0 6px 15px rgba(77, 179, 115, 0.4);
}

.btn-primary:disabled {
    background: var(--color-border);
    cursor: not-allowed;
    box-shadow: none;
}

.step h2 {
    font-size: 1.6rem;
    /* Оптимальный размер заголовка */
    color: var(--color-text);
    margin-bottom: 5px;
    /* Чуть меньше отступ снизу */
}

/* ... btn-back update ... */
.btn-back {
    background: transparent;
    border: 1px solid var(--color-border);
    padding: 10px 22px;
    /* Увеличили размер */
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    /* Читаемый шрифт */
    color: var(--color-text-light);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-back:hover {
    border-color: var(--color-green);
    color: var(--color-green);
    background: rgba(77, 179, 115, 0.05);
}

/* Results */
.results-category {
    margin-bottom: 30px;
    background: var(--color-white);
    padding: 30px;
    border-radius: var(--radius);
    border: 2px solid var(--color-border);
}

.results-category h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: var(--color-text);
}

.results-group h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--color-text-light);
    font-weight: 700;
    border-bottom: 1px solid var(--color-beige);
    padding-bottom: 5px;
}

.results-group ul li {
    list-style: none;
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
}

.results-group ul li::before {
    content: '•';
    color: var(--color-green);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Workshop Promo Block */
.workshop-promo {
    margin-top: 50px;
    background: linear-gradient(135deg, rgba(77, 179, 115, 0.1) 0%, rgba(147, 191, 254, 0.1) 100%);
    border: 2px solid var(--color-green);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
}

.workshop-promo h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--color-text);
}

.workshop-promo p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: var(--color-text);
}

.btn-promo {
    display: inline-block;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 18px 45px;
}

.step-description {
    margin-bottom: 30px;
    color: var(--color-text-light);
    font-size: 1.05rem;
}

/* Footer Design Update */
.footer {
    border-top: 1px solid var(--color-border);
    padding: 50px 0 30px;
    margin-top: 60px;
    background: linear-gradient(to bottom, transparent, rgba(77, 179, 115, 0.05));
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.footer-primary {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.footer-secondary {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.footer-tag {
    display: inline-block;
    padding: 8px 18px;
    background-color: rgba(77, 179, 115, 0.1);
    color: var(--color-green);
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.footer-tag:hover {
    background-color: rgba(77, 179, 115, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 179, 115, 0.15);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 880px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;
    max-height: 90vh;
    overflow: auto;
}

.close-modal {
    color: #777;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    line-height: 1;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--color-green);
    background: rgba(77, 179, 115, 0.08);
}

#mm-preview-placeholder img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 0;
    border-radius: 12px;
    border: 1px solid #ddd7cc;
    box-shadow: 0 10px 24px rgba(66, 57, 45, 0.12);
}

#mm-preview-placeholder {
    border: 1px solid #dfd8cb !important;
    border-radius: 12px;
    background: #f8f5ee !important;
    padding: 14px;
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

/* Action Buttons Style Update */
.results-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    /* Чтобы не ломалось на мобильных */
    margin-bottom: 30px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-action svg {
    flex-shrink: 0;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--color-green);
}

.btn-action:active {
    transform: translateY(0);
}

/* Search Bar Styles */
.search-wrapper {
    position: sticky;
    top: 12px;
    z-index: 100;
    margin-bottom: 25px;
    background: #fffdf9;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(56, 54, 50, 0.08);
    display: flex;
    align-items: center;
    border: 1px solid #d8d1c2;
    transition: all 0.3s ease;
}

.search-wrapper:focus-within {
    border-color: #4db373;
    box-shadow: 0 10px 24px rgba(77, 179, 115, 0.17);
}

.search-icon {
    padding: 12px 0 12px 15px;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
}

#trigger-search {
    width: 100%;
    border: none;
    outline: none;
    padding: 12px 15px;
    font-size: 1.02rem;
    color: var(--color-text);
    background: transparent;
    border-radius: 0 14px 14px 0;
}

#trigger-search::placeholder {
    color: #999;
}

/* Highlight for search results */
.highlight-text {
    background-color: rgba(255, 235, 59, 0.4);
    border-radius: 2px;
}

/* Controls Layout */
.step-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    width: 100%;
    gap: 15px;
    flex-wrap: wrap;
    /* Safety for mobile */
}

/* Secondary Button Style */
.btn-secondary {
    background-color: #fff;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
    border-color: #aaa;
    transform: translateY(-1px);
}

/* Text Button Style (Reset) */
.btn-text {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 15px;
    transition: color 0.2s ease;
}

.btn-text:hover {
    color: #e74c3c;
    /* Red for destructive action */
    text-decoration: underline;
}

/* Adjust primary button in controls */
.step-controls .btn-primary {
    margin-top: 0;
    /* Remove top margin if it had one */
    width: auto;
    /* Allow it to size naturally, or keep flex-grow if needed */
    flex: 0 0 auto;
}

/* Accessible focus ring */
:where(a, button, input, select, textarea, .category-card, .trigger-item):focus-visible {
    outline: 3px solid #2f7d4d;
    outline-offset: 2px;
}

/* Mind map source is rendered off-screen for html2canvas */
#mindmap-source {
    position: fixed;
    left: -99999px;
    top: 0;
    pointer-events: none;
    z-index: -1;
}

/* ===== Cookie Consent Banner ===== */
.cookie-banner {
    position: fixed;
    bottom: -100px;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.cookie-banner.show {
    bottom: 0;
}

.cookie-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    font-family: 'Inter', sans-serif;
}

.cookie-btn {
    background-color: var(--color-green);
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.cookie-btn:hover {
    background-color: var(--color-blue);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 12px 15px;
        bottom: -150px;
        /* Adjust for mobile height */
    }

    .cookie-content p {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .cookie-btn {
        width: 100%;
        max-width: 200px;
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}
