﻿/* ===================================================================
   Notacross · Кнопка состояния админ-сессии в меню навигации
   (js/nca-session-btn.js). Видна только группе 1.
   Цвета вынесены в переменные — правятся здесь, не в JS.
=================================================================== */
:root {
    --nca-sess-ok:     #7a8b6f;   /* сессия жива */
    --nca-sess-dead:   #c0392b;   /* истекла / нужен код */
    --nca-sess-busy:   #9a9a9a;   /* идёт запрос */
    --nca-sess-bg:     #1f2328;
    --nca-sess-fg:     #e8e8e8;
}

/* ── кнопка в навбаре ───────────────────────────────────────────── */
#pun-navlinks .nca-sess { display: inline-block; }

.nca-sess-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    border-radius: 50%;
    text-decoration: none !important;
    color: var(--nca-sess-busy);
    transition: color .2s ease, transform .35s ease, background-color .2s ease;
}

.nca-sess-btn:hover { background: rgba(127, 127, 127, .18); }
.nca-sess-btn:active { transform: rotate(180deg); }

.nca-sess-btn.is-ok   { color: var(--nca-sess-ok); }
.nca-sess-btn.is-busy { color: var(--nca-sess-busy); opacity: .7; }

/* Истекла — красная и слегка пульсирует, чтобы заметили до того,
   как админка выдаст ошибку посреди действия. */
.nca-sess-btn.is-dead {
    color: var(--nca-sess-dead);
    animation: nca-sess-pulse 1.8s ease-in-out infinite;
}

@keyframes nca-sess-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
    .nca-sess-btn.is-dead { animation: none; }
    .nca-sess-btn:active  { transform: none; }
}

/* ── тост по центру экрана ──────────────────────────────────────── */
.nca-sess-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.94);
    z-index: 100000;
    max-width: 80vw;
    padding: 16px 26px;
    border-radius: 10px;
    background: var(--nca-sess-bg);
    color: var(--nca-sess-fg);
    font: 600 15px/1.4 inherit;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
    border-left: 4px solid var(--nca-sess-ok);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
}

.nca-sess-toast.is-shown { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.nca-sess-toast.is-warn  { border-left-color: var(--nca-sess-dead); }

/* ── модалка ввода кода ─────────────────────────────────────────── */
.nca-sess-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .6);
}

.nca-sess-modal {
    width: 300px;
    max-width: 90vw;
    padding: 22px;
    border-radius: 10px;
    background: var(--nca-sess-bg);
    color: var(--nca-sess-fg);
    font: 14px/1.45 sans-serif;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.nca-sess-modal h3 { margin: 0 0 10px; font-size: 16px; }

.nca-sess-status {
    margin: 0 0 12px;
    font-size: 13px;
    opacity: .8;
}

.nca-sess-code {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 6px;
    background: rgba(255, 255, 255, .06);
    color: var(--nca-sess-fg);
    font-size: 16px;
    letter-spacing: 3px;
    text-align: center;
}

.nca-sess-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.nca-sess-actions button {
    padding: 8px 14px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.nca-sess-cancel { background: rgba(255, 255, 255, .12); color: var(--nca-sess-fg); }
.nca-sess-ok     { background: var(--nca-sess-ok); color: #fff; }
.nca-sess-ok[disabled] { opacity: .6; cursor: default; }
