/* ============================================================
   S.T.A.L.K.E.R. / METRO / CREATE — ПОСТАПОКАЛИПТИЧЕСКИЙ СТИЛЬ
   Супер-обновлённая версия для STH-PL Panel
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-card: #1a1a1a;
    --bg-hover: #242424;
    --border: #3a3a3a;
    --border-light: #4a4a4a;
    --text: #c8c0b0;
    --text-secondary: #8a8a7a;
    --text-muted: #5a5a4a;
    --accent: #d4a040;
    --accent-hover: #e8b850;
    --orange: #d4880f;
    --green: #6a8a5a;
    --red: #8a3a3a;
    --cyan: #4a9eff;
    --purple: #8B5CF6;
    --shadow: 0 8px 32px rgba(0,0,0,0.9);
    --radius: 8px;
    --font-main: 'Inter', sans-serif;
    --font-display: 'Russo One', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 20% 30%, rgba(90, 70, 40, 0.25), transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(60, 40, 20, 0.20), transparent 50%);
    background-color: #0a0a0a;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 10% 20%, rgba(120, 70, 30, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 80%, rgba(80, 50, 20, 0.10) 0%, transparent 30%),
        radial-gradient(ellipse at 40% 60%, rgba(100, 60, 30, 0.08) 0%, transparent 35%);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.04) 0px,
        rgba(0, 0, 0, 0.04) 2px,
        transparent 2px,
        transparent 6px
    );
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.98; }
    75% { opacity: 0.96; }
    85% { opacity: 1; }
}

.container {
    animation: flicker 12s infinite;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.radiation-symbol {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 80px;
    opacity: 0.04;
    color: var(--orange);
    pointer-events: none;
    z-index: 0;
    transform: rotate(-10deg) scale(1.2);
    user-select: none;
    text-shadow: 0 0 40px rgba(212, 136, 15, 0.2);
}

/* ===== ВЕРХНЯЯ НАВИГАЦИЯ ===== */
.top-navbar {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 3px solid var(--border);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}
.top-navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.nav-left { display: flex; align-items: center; gap: 12px; }
.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 10px rgba(212, 160, 64, 0.2);
}
.navbar-brand i { color: var(--orange); }
.nav-center { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: var(--radius);
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
}
.nav-link:hover {
    color: var(--text);
    background: var(--bg-hover);
    border-color: var(--border);
}
.nav-link.active {
    color: var(--accent);
    background: rgba(212, 160, 64, 0.08);
    border-color: var(--accent);
    box-shadow: inset 0 -2px 0 var(--accent);
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 4px 12px 4px 8px;
    border-radius: 30px;
    border: 1px solid var(--border);
}
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.user-name { font-size: 0.85rem; color: var(--text-secondary); }
.logout-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: var(--radius);
    transition: 0.2s;
    border: 1px solid transparent;
}
.logout-btn:hover { color: var(--red); border-color: var(--red); }

/* ===== СТРАНИЦА ВХОДА/РЕГИСТРАЦИИ ===== */
.auth-container {
    max-width: 420px;
    margin: 60px auto;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.auth-container::before {
    content: '☢';
    position: absolute;
    top: -20px;
    right: -10px;
    font-size: 120px;
    opacity: 0.03;
    color: var(--orange);
    pointer-events: none;
}
.auth-container h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: 2px;
}
.auth-container .form-group { margin-bottom: 16px; }
.auth-container .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.auth-container .form-group input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: 0.2s;
}
.auth-container .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 160, 64, 0.1);
}
.auth-container .btn {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    margin-top: 8px;
}
.auth-container .auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.auth-container .auth-footer a { color: var(--accent); text-decoration: none; }
.auth-container .auth-footer a:hover { text-decoration: underline; }
.error-message {
    color: var(--red);
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    font-family: var(--font-main);
    background: var(--bg-secondary);
    color: var(--text);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.btn-primary {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.btn-success {
    background: var(--green);
    color: #0a0a0a;
    border-color: var(--green);
}
.btn-success:hover { background: #7a9a6a; }
.btn-danger {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}
.btn-danger:hover { background: #9a4a4a; }
.btn-warning {
    background: var(--orange);
    color: #0a0a0a;
    border-color: var(--orange);
}
.btn-warning:hover { background: #e8a020; }
.btn-secondary {
    background: var(--bg-secondary);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); }
.btn-sm { padding: 4px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== КАРТОЧКИ ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,0.01) 0px, rgba(255,255,255,0.01) 2px, transparent 2px, transparent 8px);
    pointer-events: none;
}
.card:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title i { color: var(--accent); }

/* ===== КОНСОЛЬ ===== */
.console-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.console-box {
    background: #0d0d0d;
    border-radius: var(--radius);
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #b0c4de;
    min-height: 250px;
    max-height: 450px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid var(--border);
    line-height: 1.6;
}
.console-box .cmd-line { color: var(--accent); font-weight: 600; }
.console-box .output-line { color: #c8c8c8; }
.console-box .error-line { color: var(--red); }
.console-box .warning-line { color: var(--orange); }
.console-box .info-line { color: var(--text-secondary); font-style: italic; }

.console-input-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}
.console-input-row input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.95rem;
}
.console-input-row .prompt {
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 600;
}
.console-actions { margin-top: 8px; display: flex; gap: 8px; align-items: center; }

/* ===== ТОСТЫ ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease;
}
.toast.success { border-left: 4px solid var(--green); }
.toast.success i { color: var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.error i { color: var(--red); }
.toast.info { border-left: 4px solid var(--accent); }
.toast.info i { color: var(--accent); }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
.toast.hide {
    opacity: 0;
    transform: translateX(40px);
    transition: 0.4s;
}

/* ===== ФЛЕШ ===== */
.flash-container {
    margin-bottom: 20px;
}
.flash {
    padding: 10px 20px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.9rem;
    border-left: 4px solid;
}
.flash-success { border-color: var(--green); background: rgba(63,185,80,0.1); color: var(--green); }
.flash-error { border-color: var(--red); background: rgba(248,81,73,0.1); color: var(--red); }
.flash-info { border-color: var(--accent); background: rgba(88,166,255,0.1); color: var(--accent); }

/* ===== ДАШБОРД ===== */
.dashboard-page {
    padding: 20px;
}
.dashboard-page h1 {
    font-family: var(--font-display);
    color: var(--accent);
    font-size: 2rem;
    margin-bottom: 8px;
}
.dashboard-page h2 {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 20px;
}
.servers-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.servers-list li {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: 0.2s;
}
.servers-list li:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.servers-list .server-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.servers-list .server-name i { color: var(--accent); }
.servers-list .server-url {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
}
.servers-list .server-status {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
    margin-bottom: 8px;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}
.servers-list a {
    display: inline-block;
    margin-top: 8px;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--accent);
    padding: 4px 12px;
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.servers-list a:hover {
    background: var(--accent);
    color: #0a0a0a;
}

/* ===== МОДАЛЬНОЕ ОКНО (КОНСОЛЬ) ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
}
.modal h2 {
    color: var(--accent);
    margin-bottom: 15px;
    text-align: center;
    font-family: var(--font-display);
}
.modal .form-group { margin-bottom: 15px; }
.modal input[type="password"] {
    width: 100%;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
}
.modal .error-msg { color: var(--red); margin-top: 10px; font-size: 14px; text-align: center; }
.modal .lock-msg { color: var(--orange); margin-top: 10px; font-size: 13px; text-align: center; }

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .top-navbar .container { flex-direction: column; align-items: stretch; }
    .nav-center { justify-content: center; flex-wrap: wrap; }
    .nav-right { justify-content: center; }
    .auth-container { margin: 40px auto; padding: 24px; }
    .servers-list { grid-template-columns: 1fr; }
    .console-input-row { flex-direction: column; }
}

/* ===== СКРОЛЛБАР ===== */
::-webkit-scrollbar { width: 6px; background: transparent; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }