/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0d0f14;
    --bg2: #13161d;
    --bg3: #1a1e28;
    --card: #1e2330;
    --border: #2a2f3e;
    --accent: #6c63ff;
    --accent2: #4f46e5;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
    --text: #e2e8f0;
    --text2: #94a3b8;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

body { background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, sans-serif; min-height: 100vh; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .85; }

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar { background: var(--bg2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text2); font-size: .95rem; }
.nav-links a:hover { color: var(--text); }
/* Регистрация с акцентом */
.nav-register { border-color: var(--accent) !important; color: var(--accent) !important; }
.nav-register:hover { background: var(--accent) !important; color: #fff !important; }
/* Текстовые ссылки Кабинет/Поддержка — скрыты везде, кнопка-переключатель только на мобиле */
.nav-text-link { display: none !important; }
.nav-mobile-btn { display: none; }
@media (max-width: 768px) {
    .nav-mobile-btn { display: inline-flex; }
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; border: none; transition: all .2s; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-full { width: 100%; }

/* ── Container & Layout ───────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.main-content { min-height: calc(100vh - 120px); }
.page { padding: 48px 24px; max-width: 1200px; margin: 0 auto; }
.page-sm { max-width: 480px; }
.page-md { max-width: 720px; }

/* ── Cards ────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card-header { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 80px 24px 60px; }
.hero h1 { font-size: 3rem; font-weight: 800; background: linear-gradient(135deg, #a78bfa, #6c63ff, #38bdf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 16px; }
.hero p { font-size: 1.2rem; color: var(--text2); max-width: 560px; margin: 0 auto 32px; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Features ─────────────────────────────────────────────────── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; padding: 0 24px 64px; max-width: 1200px; margin: 0 auto; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.feature-icon { font-size: 2.5rem; margin-bottom: 12px; }
.feature h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.feature p { font-size: .875rem; color: var(--text2); }

/* ── Tariffs grid ─────────────────────────────────────────────── */
.tariffs-section { padding: 0 24px 80px; max-width: 1200px; margin: 0 auto; }
.section-title { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: var(--text2); margin-bottom: 40px; }
.tariffs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.tariff-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 16px; transition: border-color .2s, transform .2s; }
.tariff-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.tariff-card.featured { border-color: var(--accent); background: linear-gradient(135deg, #1e2330, #1a1e38); }
.tariff-name { font-size: 1.1rem; font-weight: 700; }
.tariff-price { font-size: 2rem; font-weight: 800; color: var(--accent); }
.tariff-price span { font-size: 1rem; font-weight: 400; color: var(--text2); }
.tariff-desc { font-size: .875rem; color: var(--text2); flex: 1; }
.tariff-stars { font-size: .85rem; color: var(--text2); }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .875rem; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.form-input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; color: var(--text); font-size: .95rem; outline: none; transition: border-color .2s; }
.form-input:focus { border-color: var(--accent); }
.form-hint { font-size: .8rem; color: var(--text2); margin-top: 4px; }
.error-msg { background: rgba(239,68,68,.1); border: 1px solid var(--red); color: #fca5a5; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.success-msg { background: rgba(34,197,94,.1); border: 1px solid var(--green); color: #86efac; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }

/* ── Auth pages ───────────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 120px); padding: 24px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { color: var(--text2); font-size: .9rem; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text2); }

/* ── Cabinet ──────────────────────────────────────────────────── */
.cabinet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .cabinet-grid { grid-template-columns: 1fr; } }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600; }
.status-active { background: rgba(34,197,94,.15); color: var(--green); }
.status-expired { background: rgba(239,68,68,.15); color: var(--red); }
.status-disabled { background: rgba(245,158,11,.15); color: var(--yellow); }
.vpn-url { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; font-size: .85rem; color: var(--text2); word-break: break-all; margin: 12px 0; }
.connect-btn { background: linear-gradient(135deg, var(--accent), #38bdf8); color: #fff; padding: 14px 32px; border-radius: 10px; font-size: 1rem; font-weight: 700; display: inline-block; text-align: center; margin-top: 8px; transition: opacity .2s; }
.connect-btn:hover { opacity: .9; color: #fff; }
.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text2); }

/* ── Support / Tickets ────────────────────────────────────────── */
.ticket-list { display: flex; flex-direction: column; gap: 12px; }
.ticket-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ticket-item:hover { border-color: var(--accent); }
.ticket-subject { font-weight: 600; }
.ticket-meta { font-size: .8rem; color: var(--text2); margin-top: 4px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-open { background: rgba(34,197,94,.15); color: var(--green); }
.badge-closed { background: rgba(100,116,139,.15); color: var(--text2); }
.badge-answered { background: rgba(108,99,255,.15); color: var(--accent); }
.messages { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.message-item { padding: 14px 18px; border-radius: 10px; max-width: 80%; }
.message-user { background: var(--bg3); border: 1px solid var(--border); align-self: flex-start; }
.message-admin { background: rgba(108,99,255,.15); border: 1px solid rgba(108,99,255,.3); align-self: flex-end; }
.message-author { font-size: .75rem; font-weight: 600; margin-bottom: 4px; color: var(--text2); }
.message-text { font-size: .9rem; }
.message-time { font-size: .7rem; color: var(--text2); margin-top: 6px; }

/* ── Admin ────────────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
.admin-sidebar { background: var(--bg2); border-right: 1px solid var(--border); padding: 24px 0; }
.admin-sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--text2); font-size: .9rem; transition: all .2s; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(108,99,255,.1); color: var(--text); border-right: 2px solid var(--accent); }
.admin-main { padding: 32px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: .85rem; color: var(--text2); margin-top: 4px; }

/* ── Table ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: 12px 16px; background: var(--bg3); border-bottom: 1px solid var(--border); color: var(--text2); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Footer ───────────────────────────────────────────────────── */
.footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 24px; text-align: center; color: var(--text2); font-size: .85rem; }

/* ── Utilities ────────────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-16 { margin-top: 16px; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--text2); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

/* ── Google Auth Button ───────────────────────────────────────── */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow .2s, background .2s;
    text-decoration: none;
}
.google-btn:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
    background: #f8f9fa;
    color: #3c4043;
    text-decoration: none;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .nav-links a:not(.btn) { display: none; }
    .nav-links { gap: 8px; }
    .btn-sm { padding: 7px 12px; font-size: .8rem; }
}

/* ── Logo subtitle ────────────────────────────────────────────── */
.logo-sub { font-size: 0.6em; font-weight: 400; opacity: 0.6; display: inline; }
@media (max-width: 768px) { .logo-sub { display: none; } }

/* ── Alert messages ───────────────────────────────────────────── */
.alert-success {
    background: rgba(0,200,100,.15);
    border: 1px solid #00c864;
    color: #00e070;
    border-radius: var(--radius);
    padding: 10px 16px;
    font-size: .9rem;
}
.alert-error {
    background: rgba(239,68,68,.12);
    border: 1px solid #ef4444;
    color: #f87171;
    border-radius: var(--radius);
    padding: 10px 16px;
    font-size: .9rem;
}

/* ── Notification badge (nav) ─────────────────────────────────── */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    margin-left: 4px;
    line-height: 1;
    vertical-align: middle;
}

/* ── Ticket unread indicator ──────────────────────────────────── */
.ticket-unread {
    border-left: 3px solid var(--accent) !important;
    background: rgba(99,102,241,.06) !important;
}
.dot-unread {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── Language dropdown (desktop) ─────────────────────────────── */
.lang-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    /* Расширяем зону hover вниз — перекрывает зазор до меню */
    padding-bottom: 10px;
    margin-bottom: -10px;
}
.lang-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: 8px;
    padding: 6px 14px;   /* совпадает с .btn-sm */
    font-size: .85rem;   /* совпадает с .btn-sm */
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
    white-space: nowrap;
    line-height: 1;
}
.lang-current:hover {
    border-color: var(--accent);
    color: var(--text);
    background: rgba(99,102,241,.08);
}
.lang-flag-img {
    display: inline-block;
    border-radius: 2px;
    vertical-align: middle;
    width: 20px;
    height: 15px;
    object-fit: cover;
    flex-shrink: 0;
}
.lang-code { font-weight: 600; letter-spacing: .04em; }
.lang-caret { font-size: .65em; opacity: .6; margin-left: 1px; transition: transform .2s; }
.lang-dropdown:hover .lang-caret { transform: rotate(180deg); }

/* Dropdown menu */
.lang-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%; /* начинается прямо в зоне padding-bottom — зазора нет */
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    z-index: 200;
    flex-direction: column;
}
.lang-dropdown:hover .lang-dropdown-menu { display: flex; }
.lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    color: var(--text2);
    font-size: .85rem;
    text-decoration: none;
    transition: background .12s, color .12s;
}
.lang-item:hover { background: rgba(99,102,241,.12); color: var(--text); }
.lang-item.active {
    color: var(--accent);
    font-weight: 600;
    background: rgba(99,102,241,.1);
}
/* hide on mobile — mobile bar takes over */
@media (max-width: 768px) { .lang-dropdown { display: none !important; } }

/* ── Language bar (mobile only) ───────────────────────────────── */
.lang-bar {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 6px 16px;
}
.lang-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text2);
    font-size: .78rem;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: border-color .15s, color .15s, background .15s;
}
.lang-bar-item:hover { color: var(--text); background: rgba(99,102,241,.08); }
.lang-bar-item.active {
    color: var(--accent);
    background: rgba(99,102,241,.13);
    border-color: rgba(99,102,241,.3);
    font-weight: 700;
}
@media (max-width: 768px) { .lang-bar { display: flex; } }

/* ── Tariff image ─────────────────────────────────────────────── */
.tariff-img-wrap {
    width: 100%;
    height: 130px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 12px;
}
.tariff-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


