/* ===================================================================
   СНТ «Холмогоры» — общие стили
   Структура файла:
   1. Токены (цвета, шрифты, отступы)
   2. Базовый сброс
   3. Утилита (SVG-разделитель)
   4. Шапка / верхняя плашка с контактами
   5. Главное меню 
   6. Hero-блок
   7. Контентная сетка
   8. Карточки
   9. Футер
   10. Адаптив
   =================================================================== */

@import url("https://fonts.googleapis.com/css2?family=PT+Serif:wght@400;700&family=PT+Sans:wght@400;600;700&family=PT+Mono&display=swap");

:root {
    /* 1. Токены ------------------------------------------------------ */
    --paper: #efece3;
    --paper-deep: #e5e0d2;
    --card: #f8f6ef;
    --ink: #221f19;
    --ink-soft: #55503f;
    --forest: #2f3f2a;
    --forest-deep: #212e1d;
    --honey: #a97a2c;
    --honey-deep: #8a6222;
    --bark: #29241d;
    --bark-light: #42392e;
    --line: rgba(34, 31, 25, 0.14);
    --line-strong: rgba(34, 31, 25, 0.28);

    --font-display: "PT Serif", Georgia, serif;
    --font-body: "PT Sans", "Segoe UI", sans-serif;
    --font-mono: "PT Mono", "Courier New", monospace;

    --radius: 3px;
    --shadow-card:
        0 1px 2px rgba(34, 31, 25, 0.06),
        0 6px 20px -12px rgba(34, 31, 25, 0.25);
}

/* 2. Базовый сброс -------------------------------------------------- */
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img {
    max-width: 100%;
    display: block;
}
a {
    color: var(--honey-deep);
    text-decoration-color: transparent;
    transition:
        text-decoration-color 0.15s ease,
        color 0.15s ease;
}
a:hover {
    color: var(--honey);
    text-decoration-color: currentColor;
    text-decoration-line: underline;
}
/* a:focus-visible, */
/* button:focus-visible, */
/* input:focus-visible { */
/*     border-color: var(--forest-deep); */
/* } */
h1,
h2,
h3 {
    font-family: var(--font-display);
    color: var(--forest-deep);
    line-height: 1.2;
    margin: 0 0 0.5em;
}
.wrap {
    max-width: 1600px;
    margin: 0 auto;
    width: 90%;
}

/* 3. Берёзовый штрих (разделитель) ---------------------------------- */
.birch-divider {
    display: block;
    width: 100%;
    height: 14px;
    margin: 0;
}
.birch-divider rect {
    fill: var(--bark);
}

/* 4. Верхняя утиль-плашка -------------------------------------------- */
.utility-bar {
    background: var(--paper-deep);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-soft);
}
.utility-bar .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.utility-bar a {
    color: var(--ink-soft);
}
.utility-bar a:hover {
    color: var(--forest-deep);
}

/* Шапка с логотипом --------------------------------------------------- */
.site-header {
    background: var(--paper);
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0px;
    padding-bottom: 2px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--forest-deep);
}
.logo:hover {
    color: var(--forest-deep);
    text-decoration: none;
}
.logo-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    color: var(--forest);
    position: relative;
}
.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.01em;
}
.logo-sub {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-soft);
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* 5. Главное меню ------------------------------------------------------ */
.nav-toggle {
    display: none;
}
.nav-toggle-label {
    display: none;
    cursor: pointer;
    padding: 8px;
}
.main-nav {
    background: var(--forest);
}
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}
.nav-list > li {
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-list > li:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-list > li > a {
    display: block;
    padding: 14px 18px;
    color: #f2efe4;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.nav-list > li > a:hover,
.nav-list > li:focus-within > a {
    background: var(--forest-deep);
    color: #ffffff;
}
.nav-list .sub {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--card);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-card);
    z-index: 20;
    display: none;
}
.nav-list > li:hover .sub,
.nav-list > li:focus-within .sub {
    display: block;
}
.nav-list .sub a {
    display: block;
    padding: 9px 16px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 400;
}
.nav-list .sub a:hover {
    background: var(--paper-deep);
    color: var(--forest-deep);
    text-decoration: none;
}
.nav-list .has-children > a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-left: 8px;
    opacity: 0.7;
}

.btn-edit a {
    color: #f2efe4;
    font-weight: bold;
}

/* 6. Hero ---------------------------------------------------------- */
.hero {
    padding: 15px 0 0px;
}
.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--honey-deep);
    margin: 0 0 14px;
}
.hero h1 {
    font-size: clamp(28px, 4vw, 40px);
}
.hero p.lead {
    font-size: 18px;
    color: var(--ink-soft);
    margin: 14px 0;
}

/* 7. Контентная сетка ------------------------------------------------ */
.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    padding: 0 0 30px;
    align-items: start;
}
.content article > * + * {
    margin-top: 1em;
}
.content h2 {
    font-size: 22px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}
.content section:first-of-type h2 {
    margin-top: 1em;
}
.content ul {
    padding-left: 1.2em;
}
.content li + li {
    margin-top: 0.35em;
}
.content .note {
    background: var(--card);
    border-left: 3px solid var(--honey-deep);
    padding: 14px 18px;
    font-size: 15px;
    color: var(--ink-soft);
}

/* 8. Карточки -------------------------------------------------------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 24px;
}
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
}
.card h3 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--forest);
    margin-bottom: 14px;
}
.contact-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.contact-row:first-of-type {
    border-top: none;
    padding-top: 0;
}
.contact-row .role {
    font-size: 13px;
    color: var(--ink-soft);
}
.contact-row .value {
    font-family: var(--font-mono);
    font-size: 15px;
}
.contact-row .value a {
    color: var(--ink);
}

.doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.doc-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}
.doc-list li:first-child {
    border-top: none;
    padding-top: 0;
}
.doc-list a {
    font-weight: 600;
}
.doc-list .doc-date {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-soft);
    white-space: nowrap;
}

/* 9. Футер ------------------------------------------------------------ */
.site-footer {
    background: var(--paper-deep);
    border-top: 1px solid var(--line-strong);
}
.site-footer .wrap {
    padding: 28px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    color: var(--ink-soft);
}
.site-footer a {
    color: var(--ink-soft);
}

/* 10. Адаптив ----------------------------------------------------------- */
@media (max-width: 860px) {
    .page-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .wrap {
        width: calc(100% - 32px);
    }
    .utility-bar .wrap {
        font-size: 12px;
    }
    .nav-toggle-label {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #f2efe4;
        font-family: var(--font-body);
        font-weight: 600;
        font-size: 15px;
    }
    .nav-toggle-label .bars {
        display: inline-flex;
        flex-direction: column;
        gap: 4px;
    }
    .nav-toggle-label .bars span {
        width: 20px;
        height: 2px;
        background: #f2efe4;
        display: block;
    }
    .nav-toggle-label {
        padding: 12px 0;
    }
    .nav-list {
        display: none;
        flex-direction: column;
        padding-bottom: 8px;
    }
    .nav-toggle:checked ~ .wrap .nav-list,
    .nav-toggle:checked + .nav-toggle-label + .wrap .nav-list {
        display: flex;
    }
    .nav-list > li {
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .nav-list .sub {
        display: none;
        position: static;
        box-shadow: none;
        border: none;
        background: var(--forest-deep);
        min-width: 0;
    }
    .nav-list > li:focus-within .sub,
    .nav-list > li.open .sub {
        display: block;
    }
    .nav-list .sub a {
        color: #e8e4d6;
    }
    .nav-list .sub a:hover {
        background: rgba(255, 255, 255, 0.06);
        color: #fff;
    }
}

/* Авторизация и Профиль */
.auth-block {
    font-size: 15px;
    display: flex;
    align-items: center;
}
.auth-link {
    color: var(--forest-deep);
    font-weight: 600;
    text-decoration: none;
    text-decoration-skip-ink: none;
}
.auth-link:hover {
    color: var(--honey);
}
.auth-divider {
    font-size: 20px;
    margin: 0 10px;
    color: var(--forest-deep);
    cursor: default;
}

.profile-menu {
    position: relative;
}
.profile-btn {
    cursor: pointer;
    font-weight: 600;
    color: var(--forest-deep);
    padding: 10px 0;
}
.profile-btn:hover {
    color: var(--honey);
}
.profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-card);
    min-width: 140px;
    z-index: 20;
    padding: 6px 0;
}
.profile-menu:hover .profile-dropdown {
    display: block;
}
.profile-dropdown a {
    display: block;
    padding: 8px 16px;
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
}
.profile-dropdown a:hover {
    background: var(--paper-deep);
    color: var(--forest-deep);
}

#editor {
    font-weight: 400;
}

.fa {
    font-size: 13px;
    margin-top: 0.1rem;
}

/* Поддержка списков Quill */
article li[data-list="bullet"] {
    list-style-type: disc !important;
}

article li[data-list="ordered"] {
    list-style-type: decimal !important;
}

/* Убираем лишний сдвиг, если Quill генерирует пустые span внутри li */
article li > span:first-child:empty {
    display: none;
}

/* Авторизация */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
    min-height: 55vh;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-card);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    border-radius: 6px;
}

.auth-card h2 {
    margin: 0 0 2rem 0;
    color: var(--forest-deep);
    font-family: var(--font-heading);
    text-align: center;
}

.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 15px;
    box-sizing: border-box;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: var(--forest-deep);
    box-shadow: 0 0 0 2px rgba(47, 63, 42, 0.15);
}

.btn-submit {
    padding: 0.75rem;
    background: var(--forest-deep);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.login {
    width: 100%;
    margin-top: 1.5rem;
}

.btn-submit:hover {
    background: var(--honey);
}

.caps-warning {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.caps-warning {
    position: absolute;
    top: 100%; /* Прижимаем к нижнему краю поля ввода */
    left: 0;
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.back-to-main-block {
    text-align: center;
    margin-top: 1rem;
}
.back-to-main-link {
    font-size: 15px;
    color: var(--ink-soft);
    text-decoration: none;
}
.fa-long-arrow-left {
    font-size: 10px;
}

.auth-error {
    background-color: #fce8e6;
    color: #c5221f;
    border: 1px solid #f8c4c2;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.form-group input:focus {
    border-color: var(--honey-deep);
    box-shadow: 0 0 0 2px rgba(169, 122, 44, 0.15);
}

/* Шапка голосований и вкладки */
.voting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.voting-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--paper);
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--line-strong);
}

.btn-new {
    padding: 0.75rem;
    background: var(--card);
    color: var(--forest-deep);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-new:hover {
    color: #fff;
    background: var(--honey);
}

.tab-link {
    padding: 0.5rem 1.25rem;
    text-decoration: none;
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s;
}

.tab-link.active {
    background: var(--card);
    color: var(--forest-deep);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Карточки голосований */
.poll-card {
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}

.poll-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.poll-title {
    margin: 0;
    font-size: 1.15rem;
    color: var(--forest-deep);
    font-family: var(--font-heading);
}

.poll-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    font-weight: 600;
}

.badge-active {
    background: #e6f4ea;
    color: #137333;
}

.badge-finished {
    background: #f1f3f4;
    color: #5f6368;
}

/* Опции и Радио-кнопки */
.poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.poll-option-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.2s;
}

.poll-option-radio:hover {
    border-color: var(--forest-deep);
    background: var(--paper);
}

.poll-option-radio input[type="radio"] {
    accent-color: var(--forest-deep);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.vote-btn {
    max-width: 200px;
    width: 55%;
}

/* Результаты (Progress bars) */
.result-item {
    margin-bottom: 1rem;
}

.result-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--ink);
}

.progress-bar {
    height: 10px;
    background: var(--paper);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
}

.progress-fill {
    height: 100%;
    background: var(--bark-light);
    border-radius: 5px;
    transition: width 0.4s ease;
}

/* .progress-fill.finished-fill { */
/*     background: var(--honey-deep); */
/* } */

/* Цвет для лидирующего варианта */
.progress-fill.finished-fill.winner-fill {
    background: #43a847;
}
.poll-info-note {
    font-size: 13px;
    color: #137333;
    margin-top: 0;
    margin-bottom: 1rem;
}

.poll-card-footer {
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line-strong);
    font-size: 13px;
    color: var(--ink-soft);
}

.polls-empty {
    text-align: center;
    padding: 3rem;
    color: var(--ink-soft);
    background: var(--card);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
}

.poll-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    gap: 1rem;
}

.poll-actions .vote-btn {
    margin: 0; /* Убираем отступы, если они были наследованы */
}

.btn-danger {
    background-color: #fce8e6;
    color: #c5221f;
    border: 1px solid #f8c4c2;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    color: #fff;
    background: #c82333;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line-strong);
}

.page-link {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background: var(--paper);
    color: var(--ink-soft);
    text-decoration: none;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
}

.page-link:hover {
    border-color: var(--forest-deep);
    color: var(--forest-deep);
}

.page-link.active {
    background: var(--forest-deep);
    color: #fff;
    border-color: var(--forest-deep);
    pointer-events: none;
}
