/* =============================================================
 * style.css — оформление витрины и личных кабинетов MediaLAN API
 * Тёмная тема в стиле диспетчерской панели.
 * ============================================================= */

:root {
    --bg:      #0b1220;
    --panel:   #14203a;
    --panel-2: #0d1626;
    --border:  #24344f;
    --text:    #e6edf7;
    --muted:   #8ba0bb;
    --accent:  #fbbf24;
    --accent-2: #22d3ee;
    --success: #34d399;
    --danger:  #f87171;
    --radius:  14px;
    --shadow:  0 10px 30px rgba(0, 0, 0, .35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Верхняя панель ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}
.topbar__brand:hover { text-decoration: none; }

.topbar__logo {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #f59e0b);
    color: #0b1220;
    font-size: 18px;
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13.5px;
}
.topbar__nav a { color: var(--muted); }
.topbar__nav a:hover { color: var(--text); text-decoration: none; }
.topbar__nav a.is-active { color: var(--accent); }
.topbar__muted { opacity: .75; font-size: 12px; }

/* ---------- Контейнер ---------- */
.page {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.footer {
    padding: 18px 28px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* ---------- Герой ---------- */
.hero {
    text-align: center;
    padding: 40px 24px;
    background:
        radial-gradient(1000px 300px at 50% -80px, rgba(251, 191, 36, .12), transparent),
        var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero h1 { font-size: 30px; margin-bottom: 12px; }
.hero p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
    max-width: 640px;
    margin: 0 auto 22px;
}
.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Сетки и карточки ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
}
.card--narrow { max-width: 430px; margin: 0 auto; width: 100%; }

.card__title {
    font-size: 17px;
    margin-bottom: 12px;
}
.card__lead {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.65;
    margin-bottom: 16px;
}
.card__foot {
    margin-top: 14px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, filter .2s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.06); }

.btn--primary {
    background: linear-gradient(135deg, var(--accent), #f59e0b);
    color: #1a1200;
    box-shadow: 0 8px 20px rgba(251, 191, 36, .28);
}
.btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
}
.btn--ghost:hover { color: var(--text); }
.btn--danger {
    background: transparent;
    border-color: rgba(248, 113, 113, .5);
    color: var(--danger);
}
.btn--sm  { padding: 7px 12px; font-size: 12px; border-radius: 9px; }
.btn--block { width: 100%; }
.inline { display: inline; }

/* ---------- Формы ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form--row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
}
.form--row .form__field { flex: 1; min-width: 180px; }

.form__field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }

.form input, .form select {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 13.5px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.form input:focus, .form select:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .18);
}

/* ---------- Уведомления ---------- */
.alert {
    padding: 12px 15px;
    border-radius: 11px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    background: var(--panel-2);
}
.alert--success { border-left: 3px solid var(--success); }
.alert--error   { border-left: 3px solid var(--danger); }
.alert--warn    { border-left: 3px solid var(--accent); }
.alert--info    { border-left: 3px solid var(--accent-2); }

/* ---------- Чипы ---------- */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
}
.chip--demo  { background: rgba(34, 211, 238, .12); color: var(--accent-2); border-color: rgba(34, 211, 238, .3); }
.chip--sub   { background: rgba(251, 191, 36, .12); color: var(--accent); border-color: rgba(251, 191, 36, .3); }
.chip--ok    { background: rgba(52, 211, 153, .12); color: var(--success); border-color: rgba(52, 211, 153, .3); }
.chip--off   { background: rgba(248, 113, 113, .12); color: var(--danger); border-color: rgba(248, 113, 113, .3); }
.chip--admin { background: rgba(251, 191, 36, .18); color: var(--accent); border-color: rgba(251, 191, 36, .35); }

/* ---------- Ключи ---------- */
.keybox {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 10px 12px;
    margin: 12px 0;
}
.keybox__key {
    flex: 1;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12.5px;
    color: var(--accent);
    word-break: break-all;
}

.keycard {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    background: var(--panel-2);
}
.keycard__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.keycard__meta { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ---------- Прогресс-бар квоты ---------- */
.meter { margin-top: 8px; }
.meter__head {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}
.meter__track {
    height: 8px;
    background: rgba(36, 52, 79, .8);
    border-radius: 999px;
    overflow: hidden;
}
.meter__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    border-radius: 999px;
    transition: width .3s;
}
.meter__fill--full { background: var(--danger); }
.meter__foot { margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table th {
    text-align: left;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(36, 52, 79, .5);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(34, 211, 238, .05); }

/* ---------- Статистика ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 6px;
}
.stat {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stat__label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .8px;
}
.stat strong {
    font-size: 24px;
    color: var(--accent-2);
    font-variant-numeric: tabular-nums;
}

/* ---------- Код ---------- */
.code {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 15px 17px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.65;
    overflow-x: auto;
    white-space: pre;
    margin: 10px 0;
    color: #c9e4f7;
}
.code--sm {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 3px 8px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 11.5px;
    color: var(--accent);
}
.tabs { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Адаптив ---------- */
@media (max-width: 720px) {
    .topbar { padding: 12px 16px; }
    .page { padding: 18px 12px 36px; }
    .hero h1 { font-size: 23px; }
}
