/* Meowgli59 · базовое оформление (этап 1). Живые эффекты будут расширены на этапе 9. */

:root {
    --bg: #0b0f14;
    --bg-2: #111823;
    --panel: rgba(20, 28, 39, .78);
    --panel-2: rgba(27, 37, 51, .72);
    --line: rgba(120, 160, 200, .16);
    --text: #e8eef6;
    --muted: #93a4b8;
    --brand: #56d1a4;
    --brand-2: #6aa8ff;
    --danger: #ff6b6b;
    --warn: #ffc861;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .45);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 var(--font);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: rgba(120, 160, 200, .12); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.ok { color: var(--brand); }
.bad { color: var(--danger); }
.nowrap { white-space: nowrap; }

/* ---------------- фон ---------------- */

.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(1100px 600px at 12% -10%, rgba(86, 209, 164, .18), transparent 60%),
        radial-gradient(900px 520px at 88% 8%, rgba(106, 168, 255, .16), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    animation: bgshift 26s ease-in-out infinite alternate;
}

.bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(120, 160, 200, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 160, 200, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
}

@keyframes bgshift {
    from { background-position: 0 0, 100% 0, 0 0; }
    to   { background-position: 40px 30px, calc(100% - 40px) 20px, 0 0; }
}

/* ---------------- шапка ---------------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(11, 15, 20, .72);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark { font-size: 22px; filter: drop-shadow(0 0 12px rgba(86, 209, 164, .5)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text b { letter-spacing: .3px; }
.brand__text small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }

.nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; }
.nav__item {
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.nav__item:hover { color: var(--text); text-decoration: none; border-color: var(--line); background: rgba(120, 160, 200, .07); }
.nav__item.is-active { color: #08131a; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; font-weight: 600; }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { display: flex; flex-direction: column; line-height: 1.2; font-size: 14px; text-align: right; }
.who small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.inline { display: inline; }

/* ---------------- контент ---------------- */

.content { flex: 1; padding: 26px 22px 40px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page__head { margin-bottom: 18px; }
.page__head h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: .2px; }
.page__head p { margin: 0; }

.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card, .tile {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.card__h2 { margin: 0 0 12px; font-size: 17px; }
.card__title { margin: 0 0 8px; font-size: 22px; }
.card__sub { margin: 0 0 16px; color: var(--muted); }
.card__glow {
    position: absolute;
    inset: -1px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(86, 209, 164, .35), rgba(106, 168, 255, .25));
    filter: blur(22px);
    opacity: .5;
    z-index: -1;
}

.tile { display: flex; flex-direction: column; gap: 4px; }
.tile__label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.tile__value { font-size: 22px; font-weight: 600; }
.tile__note { color: var(--muted); font-size: 12px; word-break: break-all; }

/* ---------------- формы ---------------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; color: var(--muted); }
.field__wrap { position: relative; display: flex; gap: 8px; align-items: center; }

.input {
    width: 100%;
    padding: 11px 13px;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(86, 209, 164, .18); }
select.input { cursor: pointer; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: transform .12s ease, border-color .16s ease, filter .16s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(120, 160, 200, .4); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #08131a; font-weight: 600; }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 10px; font-size: 13px; }
.btn--block { width: 100%; }

.hint { color: var(--muted); font-size: 12.5px; margin: 12px 0 0; }

/* ---------------- вход ---------------- */

.login { display: flex; justify-content: center; padding: 40px 16px; }
.card--login { width: 100%; max-width: 420px; }
.card--login .btn--block { margin-top: 4px; }

/* ---------------- сообщения ---------------- */

.flashes {
    position: fixed;
    top: 74px;
    right: 22px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
}
.flash {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    animation: flashin .22s ease;
}
.flash--info { border-color: rgba(106, 168, 255, .45); }
.flash--error { border-color: rgba(255, 107, 107, .5); color: #ffd7d7; }
.flash--success { border-color: rgba(86, 209, 164, .5); }
.flash.is-hiding { opacity: 0; transform: translateY(-6px); transition: opacity .3s ease, transform .3s ease; }

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

/* ---------------- таблицы ---------------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.table tr:hover td { background: rgba(120, 160, 200, .05); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(120, 160, 200, .08);
    font-size: 12px;
    white-space: nowrap;
}
.badge--ok { border-color: rgba(86, 209, 164, .5); color: var(--brand); }
.badge--off { border-color: rgba(255, 107, 107, .45); color: var(--danger); }
.badge--soft { color: var(--muted); }

/* ---------------- списки ---------------- */

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps__item { display: flex; gap: 12px; align-items: flex-start; }
.notes { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.notes--big { font-size: 15px; color: var(--text); display: flex; flex-direction: column; gap: 8px; }

/* ---------------- подвал ---------------- */

.footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12.5px;
}

/* ---------------- цели ---------------- */

.form--row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
.form--row .input { width: auto; min-width: 240px; }
.input--sm { padding: 6px 8px; font-size: 13px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs__item { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.tabs__item:hover { text-decoration: none; color: var(--text); border-color: rgba(120, 160, 200, .4); }
.tabs__item.is-active { color: #08131a; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; font-weight: 600; }

.details { margin-top: 14px; }
.details > summary { cursor: pointer; color: var(--brand-2); }
.details[open] > summary { margin-bottom: 12px; }

textarea.input { resize: vertical; font-family: inherit; }

.table--targets td { vertical-align: middle; }
.table--targets .badge { margin-left: 4px; }
.table--targets .table__check { width: 34px; }

/* ---------------- авторы и заготовки ---------------- */

.field--check { flex-direction: row; align-items: center; gap: 8px; }
.field--check input { width: 16px; height: 16px; }

.preview {
    margin: 8px 0 0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--panel-2);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 14px;
}

.table td .btn + .btn { margin-left: 4px; }

/* ---------------- выбор типа ключа ---------------- */

.card--choice { display: flex; flex-direction: column; }
.card--choice .form { margin-top: 12px; }
.card--choice .btn--block { margin-top: 4px; }

/* ---------------- композер ---------------- */

.composer { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.composer__main, .composer__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.input--post { min-height: 220px; font-family: inherit; line-height: 1.6; resize: vertical; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.stats > div { padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.stats dt { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 3px 0 0; font-size: 18px; font-weight: 600; }
.limits { display: flex; flex-direction: column; gap: 6px; }
.limits .flash { box-shadow: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(120, 160, 200, .08);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .16s ease, transform .12s ease;
}
.chip:hover { border-color: var(--brand); transform: translateY(-1px); }
.snippet__head { margin: 14px 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    margin-bottom: 12px;
    padding: 14px;
    text-align: center;
    border: 1.5px dashed rgba(120, 160, 200, .4);
    border-radius: var(--radius);
    background: rgba(120, 160, 200, .05);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: rgba(86, 209, 164, .09); transform: translateY(-1px); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo--main { border-color: rgba(86, 209, 164, .6); }
.photo__badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #08131a;
    font-size: 11px;
    font-weight: 600;
}
.photo__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; font-size: 12px; }
.photo__bar .btn { padding: 3px 7px; }
.photo__move { display: inline-flex; gap: 2px; margin-left: auto; }

.drafts { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.drafts__item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.drafts__item.is-active { border-color: var(--brand); background: rgba(86, 209, 164, .07); }
.drafts__item a { font-weight: 600; }
.drafts__item .muted { margin-left: auto; font-size: 12px; }

@media (max-width: 1000px) {
    .composer { grid-template-columns: minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------- адаптив ---------------- */

@media (max-width: 980px) {
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .topbar { flex-wrap: wrap; }
    .topbar__right { margin-left: 0; width: 100%; justify-content: space-between; }
    .grid--2, .grid--4 { grid-template-columns: minmax(0, 1fr); }
    .content { padding: 18px 14px 32px; }
    .flashes { left: 14px; right: 14px; top: auto; bottom: 14px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
