/* ── Базовые переменные ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #1a1a1a;
    --surface:   #2c2c2c;
    --border:    #3a3a3a;
    --text:      #e0e0e0;
    --text-muted:#888;
    --highlight: #5b9bd5;
    --error:     #e05555;
    --radius:    6px;
    --font:      'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
}

/* ── Фон ──────────────────────────────────────────────── */
.background-wrapper {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(91,155,213,.07) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(91,155,213,.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Логотип ──────────────────────────────────────────── */
.logo-header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2.5rem 1rem 1rem;
}

.site-title {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 300;
    letter-spacing: .15em;
    color: var(--text);
}

.highlight { color: var(--highlight); font-weight: 600; }

/* ── Страница входа ───────────────────────────────────── */
.login-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 360px;
    padding: 1rem 1.5rem 2rem;
    margin-top: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.login-field input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: .625rem .875rem;
    font-size: .95rem;
    font-family: var(--font);
    outline: none;
    transition: border-color .15s;
}

.login-field input:focus {
    border-color: var(--highlight);
}

.login-field input::placeholder { color: var(--text-muted); }

.login-btn {
    background: var(--highlight);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: .625rem;
    font-size: .95rem;
    font-family: var(--font);
    cursor: pointer;
    transition: opacity .15s;
    margin-top: .25rem;
}

.login-btn:hover { opacity: .85; }

.login-error {
    background: rgba(224,85,85,.12);
    border: 1px solid rgba(224,85,85,.3);
    border-radius: var(--radius);
    color: var(--error);
    padding: .5rem .75rem;
    font-size: .875rem;
    margin-bottom: .75rem;
    text-align: center;
}

.login-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: .8rem;
    margin: 1rem 0 .75rem;
    position: relative;
}

.login-divider::before,
.login-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}
.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }

.login-public-link {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: .875rem;
    text-decoration: none;
    transition: color .15s;
    padding: .25rem;
}

.login-public-link:hover { color: var(--highlight); }

/* ── Навигация (статика) ──────────────────────────────── */
.lang-switch {
    position: relative;
    z-index: 1;
    text-align: right;
    padding: .5rem 1.5rem;
    font-size: .9rem;
}

.lang-switch a { color: var(--text-muted); text-decoration: none; }
.lang-switch a.active { color: var(--highlight); font-weight: 600; }
.lang-switch a:hover  { color: var(--text); }

.main-nav {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    padding: .75rem 1rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: .9rem;
    transition: color .15s;
    padding: .25rem 0;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active-nav {
    color: var(--highlight);
    border-bottom-color: var(--highlight);
}

/* ── Контент (статика) ────────────────────────────────── */
.content-wrapper {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 1.5rem auto;
    padding: 0 1.5rem 3rem;
}

.tab-content {
    display: none;
    animation: fadeIn .3s ease;
}

.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tab-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--highlight);
    margin-bottom: 1rem;
}

.tab-content p {
    color: var(--text-muted);
    font-size: .925rem;
    margin-bottom: .75rem;
}

.tab-content a { color: var(--highlight); }

/* ── Блог ─────────────────────────────────────────────── */
.blog-entry {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .75rem;
    background: var(--surface);
    overflow: hidden;
}

.blog-entry summary {
    padding: .875rem 1rem;
    cursor: pointer;
    font-size: .925rem;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    user-select: none;
    transition: background .15s;
}

.blog-entry summary:hover { background: rgba(255,255,255,.04); }

.blog-entry summary::before {
    content: '▶';
    font-size: .7rem;
    color: var(--highlight);
    transition: transform .2s;
    flex-shrink: 0;
}

.blog-entry[open] summary::before { transform: rotate(90deg); }

.note-body {
    padding: 1rem;
    border-top: 1px solid var(--border);
    font-size: .9rem;
    color: var(--text-muted);
}

/* ── Preloader ─────────────────────────────────────────── */
.preloader, .preloader-ru {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
    animation: preloaderOut .4s .4s forwards;
}

@keyframes preloaderOut {
    to { opacity: 0; visibility: hidden; }
}

.progress-bar {
    height: 2px;
    background: var(--highlight);
    width: 0;
    animation: progressFill .6s ease forwards;
}

@keyframes progressFill { to { width: 100%; } }

/* ── Выбор языка (index) ──────────────────────────────── */
.hello {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text);
    margin-top: 2rem;
}

.language-selection {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.lang-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    padding: .5rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .15s, color .15s;
}

.lang-link:hover {
    border-color: var(--highlight);
    color: var(--highlight);
}

/* ── Мобильная адаптация ──────────────────────────────── */
@media (max-width: 600px) {
    .main-nav { gap: .75rem; font-size: .85rem; }
    .content-wrapper { padding: 0 1rem 2rem; }
    .login-container { padding: 1rem 1rem 2rem; }
}
