:root {
    --brand: #00bd6e;
    --bg: #0f1115;
    --fg: #e8eaed;
    --muted: #9aa0a6;
}

* { box-sizing: border-box; }

[v-cloak] { display: none; }

.user-menu { position: fixed; top: 14px; right: 16px; z-index: 1000; }
/* В верхней панели кнопка — в потоке, а не фиксирована в углу.
   relative (не static) — чтобы попап с меню якорился к самой кнопке. */
.user-menu--inline { position: relative; top: auto; right: auto; }

.user-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--brand);
    color: #06231a;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-menu-pop {
    position: absolute;
    top: 48px;
    right: 0;
    min-width: 180px;
    background: #ffffff;
    color: #16241d;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(20, 60, 45, 0.18);
    overflow: hidden;
}

.user-menu-pop[hidden] { display: none; }

.user-menu-head { padding: 0.6rem 0.85rem; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.user-menu-name { font-weight: 700; }
.user-menu-role { font-size: 0.8rem; color: #6b7a72; }

.user-menu-item {
    display: block;
    padding: 0.6rem 0.85rem;
    color: #16241d;
    text-decoration: none;
}

.user-menu-item:hover { background: rgba(0, 189, 110, 0.1); }

/* /survey — раскладка: слева сайдбар во всю высоту, справа колонка
   (верхняя полоса + рабочая область). */
.pf-layout { display: flex; min-height: 100vh; }

/* Правая колонка: вертикальный стек — полоса сверху, контент под ней. */
.pf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Верхняя полоса над контентом (НЕ над сайдбаром): блок информации об
   опроснике. Аватар пользователя — фиксированная иконка справа (usermenu.js). */
.pf-topbar {
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0 1rem 0 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #eef4f1 100%);
    border-bottom: 1px solid rgba(20, 60, 45, 0.16);
    box-shadow: 0 1px 4px rgba(20, 60, 45, 0.06);
}

/* Когда сайдбар свёрнут — освобождаем слева место под кнопку-разворот (☰). */
.pf-layout.collapsed .pf-topbar { padding-left: 56px; }

/* Иконки строки (кнопка пользователя и т.п.) — прижаты к правому краю. */
.pf-topbar-actions { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }

.pf-info { flex: 1; display: flex; align-items: center; gap: 1.25rem; min-width: 0; }
.pf-info--empty { color: #8a978f; font-size: 0.92rem; }

.pf-info-title {
    font-weight: 700;
    color: #16241d;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40vw;
}

.pf-info-field {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-shrink: 0;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 189, 110, 0.12);
}

.pf-info-label { font-size: 0.78rem; color: #6b7a72; text-transform: uppercase; letter-spacing: 0.03em; }
.pf-info-value { font-weight: 700; color: #0c5a38; font-size: 0.98rem; }

.pf-sidebar {
    width: 290px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8f6 100%);
    border-right: 1px solid rgba(20, 60, 45, 0.10);
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.2s ease;
}

/* Внутренний контент фиксированной ширины — не переформатируется при сворачивании,
   анимируется только ширина внешнего сайдбара, который его клиппит. */
.pf-sidebar-inner {
    width: 290px;
    box-sizing: border-box;
    padding: 1rem 0.85rem;
}

.pf-layout.collapsed .pf-sidebar {
    width: 0;
    min-width: 0;
    border: none;
}

.pf-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding: 0 0.35rem;
}

.pf-sidebar-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: #16241d; }

.pf-collapse, .pf-expand {
    border: 1px solid rgba(20, 60, 45, 0.14);
    background: #ffffff;
    color: #16241d;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pf-collapse:hover, .pf-expand:hover { background: rgba(0, 189, 110, 0.1); }

.pf-expand {
    position: fixed;
    top: 11px;
    left: 12px;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(20, 60, 45, 0.18);
}

.pf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }

.pf-li { display: flex; align-items: center; gap: 0.25rem; position: relative; }

.pf-item {
    flex: 1;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.55rem 0.7rem;
    border-radius: 9px;
    cursor: pointer;
    color: #16241d;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: background 0.12s ease;
}

.pf-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pf-item:hover { background: rgba(0, 189, 110, 0.08); }

.pf-li.active .pf-item { background: rgba(0, 189, 110, 0.14); font-weight: 600; }
.pf-li.active::before {
    content: "";
    position: absolute;
    left: -0.85rem;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
}

.pf-badge {
    flex-shrink: 0;
    font-size: 0.68rem;
    color: #06231a;
    background: var(--brand);
    border-radius: 999px;
    padding: 0.08rem 0.5rem;
}

.pf-edit { text-decoration: none; color: #6b7a72; padding: 0.3rem 0.4rem; border-radius: 6px; font-size: 0.95rem; }
.pf-edit:hover { background: rgba(0, 0, 0, 0.06); }

.pf-muted { color: #8a978f; font-size: 0.9rem; padding: 0.5rem 0.7rem; }

.pf-host { flex: 1; overflow-y: auto; background: #f3f3f3; padding: 1rem; }
.pf-empty { color: #8a978f; text-align: center; margin-top: 4rem; font-size: 1.1rem; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
}

.db-banner {
    background: #5a1a1a;
    color: #ffd7d7;
    border-bottom: 1px solid #7a2a2a;
    padding: 0.65rem 1.5rem;
    text-align: center;
    font-size: 0.95rem;
}

.db-banner[hidden] { display: none; }

#bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.login-wrap {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
}

.login-lang {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    display: flex;
    gap: 0.25rem;
}

.login-lang-btn {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #3a4a44;
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.login-lang-btn.active {
    color: #06231a;
    border-color: var(--brand);
    background: #ffffff;
}

.login-box {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-logo {
    width: 72px;
    height: auto;
    display: block;
    margin-bottom: -0.5rem;
}

.login-app-name {
    margin: 0;
    max-width: 100%;
    text-align: center;
    font-size: clamp(1.5rem, 3.3vw, 3.3rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
    line-height: 1.05;
    background: linear-gradient(
        100deg,
        #0a7a48 0%, #00bd6e 35%, #2fe39a 50%, #00bd6e 65%, #0a7a48 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 1px 8px rgba(0, 120, 70, 0.25));
    animation: title-shimmer 6s linear infinite;
}

@keyframes title-shimmer {
    to { background-position: 200% center; }
}

@media (prefers-reduced-motion: reduce) {
    .login-app-name { animation: none; }
}

.login-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(20, 60, 45, 0.08);
    border-radius: 18px;
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 18px 50px rgba(20, 60, 45, 0.22), 0 2px 6px rgba(20, 60, 45, 0.08);
}

.login-title { margin: 0; font-size: 1.4rem; text-align: center; color: #16241d; }

.login-sub { margin: 0 0 0.25rem; font-size: 0.95rem; }

.login-label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.login-input {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: #ffffff;
    color: #16241d;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input::placeholder { color: #8a978f; }

.login-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 189, 110, 0.18);
}

.login-btn {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    background: var(--brand);
    color: #06231a;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 189, 110, 0.35);
    transition: filter 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.login-btn:hover { filter: brightness(1.08); }

.login-btn:active { transform: translateY(1px); }

.login-error {
    background: #5a1a1a;
    color: #ffd7d7;
    border: 1px solid #7a2a2a;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
}

.login-error[hidden] { display: none; }

.nf {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.nf-code {
    font-size: clamp(5rem, 22vw, 12rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    background: linear-gradient(
        100deg,
        #0a7a48 0%, #00bd6e 35%, #2fe39a 50%, #00bd6e 65%, #0a7a48 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 12px rgba(0, 120, 70, 0.25));
    animation: title-shimmer 6s linear infinite;
}

.nf-text { margin: 0; color: #2a3a32; font-size: 1.1rem; }

.nf-btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border-radius: 10px;
    background: var(--brand);
    color: #06231a;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(0, 189, 110, 0.35);
    transition: filter 0.15s ease;
}

.nf-btn:hover { filter: brightness(1.08); }

.site-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand { font-weight: 700; color: var(--brand); }

.container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }

.hero h1 { margin: 0 0 0.5rem; }

.muted { color: var(--muted); font-size: 0.9rem; }

code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}
