/* ───────────────────────────────────────────────────────
   Adhunt Cabinet — Liquid Glass
   Чёрный кинематографичный стиль, стекло с градиентной
   обводкой, Instrument Serif italic + Barlow.
   Анимации — чистый CSS (transform/opacity/filter).
   ─────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

:root {
    --r: 1.25rem;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
    background: #000;
    color: #fff;
    margin: 0;
    padding: 0;
    font-family: 'Barlow', sans-serif;
    font-weight: 400;
    min-height: 100vh;
}

/* Лёгкое амбиентное свечение, чтобы стекло было что размывать */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(60% 45% at 15% -5%, rgba(255,255,255,0.07), transparent 70%),
        radial-gradient(55% 45% at 95% 105%, rgba(255,255,255,0.05), transparent 70%);
}

/* ── Liquid glass база ──────────────────────────────── */
.liquid-glass,
.card,
.sidebar,
a.btn, button.btn,
.url-box,
.input, .textarea {
    position: relative;
    background: rgba(255, 255, 255, 0.01);
    background-blend-mode: luminosity;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.1);
    overflow: hidden;
}
.liquid-glass::before,
.card::before,
.sidebar::before,
a.btn::before, button.btn::before,
.url-box::before,
.input::before, .textarea::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.45) 0%,
        rgba(255,255,255,0.15) 20%,
        rgba(255,255,255,0)   40%,
        rgba(255,255,255,0)   60%,
        rgba(255,255,255,0.15) 80%,
        rgba(255,255,255,0.45) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ── Layout: сайдбар + контент ─────────────────────── */
.layout {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 240px;
    flex-shrink: 0;
    border-radius: var(--r);
    margin: 16px 0 16px 16px;
    padding: 20px 12px;
    position: sticky;
    top: 16px;
    height: calc(100vh - 32px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: reveal 0.8s var(--ease) backwards;
}
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    padding: 4px 10px 18px;
}
.brand-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 22px;
    line-height: 1;
    background: rgba(255,255,255,0.03);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.15);
}
.brand-name {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 21px;
    letter-spacing: -0.5px;
    line-height: 1;
}
.nav-link {
    display: block;
    padding: 11px 14px;
    margin-bottom: 4px;
    border-radius: 999px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.nav-link.active {
    background: rgba(255,255,255,0.09);
    color: #fff;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.12);
}
.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.content {
    flex: 1;
    min-width: 0;
}
.wrap {
    max-width: 620px;
    margin: 0;
    padding: 36px 28px 80px;
}

/* ── Заголовок страницы ────────────────────────────── */
.page-title {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2.1rem, 5vw, 3rem);
    letter-spacing: -1.5px;
    line-height: 0.9;
    margin: 0 0 22px;
}

/* ── Появление контента (каскад, blur-in) ──────────── */
@keyframes reveal {
    from { opacity: 0; filter: blur(10px); transform: translateY(18px); }
    to   { opacity: 1; filter: blur(0);    transform: translateY(0); }
}
.wrap > * { animation: reveal 0.7s var(--ease) backwards; }
.wrap > *:nth-child(1) { animation-delay: 0.05s; }
.wrap > *:nth-child(2) { animation-delay: 0.13s; }
.wrap > *:nth-child(3) { animation-delay: 0.21s; }
.wrap > *:nth-child(4) { animation-delay: 0.29s; }
.wrap > *:nth-child(5) { animation-delay: 0.37s; }
.wrap > *:nth-child(6) { animation-delay: 0.45s; }
.wrap > *:nth-child(7) { animation-delay: 0.52s; }
.wrap > *:nth-child(n+8) { animation-delay: 0.58s; }

/* ── Карточки ───────────────────────────────────────── */
.card {
    border-radius: var(--r);
    padding: 18px 20px;
    margin-bottom: 12px;
}
a.card { transition: background 0.25s var(--ease); }
a.card:hover { background: rgba(255,255,255,0.045); }

/* ── Кнопки: стеклянные пилюли ──────────────────────── */
a.btn, button.btn {
    display: block;
    width: 100%;
    text-align: center;
    border-radius: 999px;
    padding: 13px 20px;
    margin-bottom: 10px;
    text-decoration: none;
    color: rgba(255,255,255,0.92);
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
a.btn:hover, button.btn:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-1px);
}
a.btn:active, button.btn:active { transform: translateY(0); }
a.btn:focus-visible, button.btn:focus-visible {
    outline: 1.5px solid rgba(255,255,255,0.7);
    outline-offset: 2px;
}

/* Primary — белая пилюля, как CTA в референсе */
.btn.primary {
    background: #fff;
    color: #000;
    font-weight: 600;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 4px 24px rgba(255,255,255,0.12);
}
.btn.primary::before { display: none; }
.btn.primary:hover { background: rgba(255,255,255,0.88); }

/* Danger — стекло с красным свечением */
.btn.danger {
    color: #ff9daf;
    box-shadow: inset 0 1px 1px rgba(255,120,140,0.25);
}
.btn.danger::before {
    background: linear-gradient(180deg,
        rgba(255,120,140,0.55) 0%,
        rgba(255,120,140,0.18) 20%,
        rgba(255,120,140,0)    40%,
        rgba(255,120,140,0)    60%,
        rgba(255,120,140,0.18) 80%,
        rgba(255,120,140,0.55) 100%);
}
.btn.danger:hover { background: rgba(255,120,140,0.08); }

/* ── Текстовые элементы ─────────────────────────────── */
.count {
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    margin-left: 6px;
    font-weight: 400;
}
.summary-line {
    font-size: 14px;
    font-weight: 300;
    color: rgba(255,255,255,0.8);
    line-height: 1.55;
    margin: 4px 0;
}
.summary-line b { color: #fff; font-weight: 600; }
.summary-line code {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12.5px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 1px 6px;
    color: rgba(255,255,255,0.92);
}
.label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
}
.url-box {
    border-radius: 14px;
    padding: 12px 14px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 11.5px;
    word-break: break-all;
    color: #a8e6b0;
    margin: 10px 0;
    background: rgba(0,0,0,0.35);
}
.badge-ok { color: #8ceaa6; font-weight: 700; }
.msg {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    font-weight: 300;
    text-align: center;
    margin-top: 48px;
}
hr.sep {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 12px 0;
}

/* ── Формы ──────────────────────────────────────────── */
form { margin: 0; }

.input, .textarea,
input[type="password"] {
    width: 100%;
    padding: 13px 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.02);
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.1);
    border: none;
    outline: none;
    position: relative;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.textarea {
    border-radius: 18px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12.5px;
    resize: vertical;
    min-height: 90px;
}
.input::placeholder, .textarea::placeholder,
input[type="password"]::placeholder { color: rgba(255,255,255,0.35); }
.input:focus, .textarea:focus,
input[type="password"]:focus {
    background: rgba(255,255,255,0.05);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.18), 0 0 0 1.4px rgba(255,255,255,0.35);
}
/* inputs/textarea не могут нести ::before-обводку (replaced-подобные) — компенсируем box-shadow */
.input::before, .textarea::before { display: none; }

input[type="password"] { text-align: center; }

label { font-size: 14px; font-weight: 300; color: rgba(255,255,255,0.8); }
input[type="radio"] { accent-color: #fff; }

.error {
    color: #ff9daf;
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 10px;
}

/* ── Логин ──────────────────────────────────────────── */
.login-wrap {
    position: relative;
    z-index: 1;
    max-width: 360px;
    margin: 22vh auto 0;
    padding: 0 16px;
    text-align: center;
    animation: reveal 0.9s var(--ease) backwards;
}
.login-brand {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 30px;
}
.login-wrap h1 {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 2.4rem;
    letter-spacing: -1.5px;
    line-height: 0.9;
    margin: 0 0 8px;
}
.login-sub {
    font-size: 13px;
    font-weight: 300;
    color: rgba(255,255,255,0.5);
    margin-bottom: 26px;
}

/* ── Мобилка ────────────────────────────────────────── */
@media (max-width: 700px) {
    .layout { flex-direction: column; }
    .sidebar {
        width: auto;
        margin: 12px;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 2px;
        padding: 12px;
    }
    .sidebar .brand { padding: 4px 8px 10px; width: 100%; }
    .nav-link { padding: 9px 12px; font-size: 13px; }
    .sidebar-footer { margin-top: 0; padding-top: 0; border-top: none; }
    .wrap { max-width: 520px; margin: 0 auto; padding: 20px 16px 60px; }
    .page-title { margin-bottom: 16px; }
}

/* ── Доступность ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .wrap > *, .sidebar, .login-wrap { animation: none; }
    a.btn, button.btn, a.card, .nav-link { transition: none; }
}
