/* ==========================================================================
   The Old Fox’s Chest — базовые стили
   Палитра: тёмное дерево, латунь, пергамент, уголёк.
   ========================================================================== */

:root {
    --ink-900: #120d09;
    --ink-800: #17110c;
    --ink-700: #1d1610;
    --wood-800: #241810;
    --wood-700: #2f2015;
    --wood-600: #3a2819;

    --parchment: #f4e6cf;
    --parchment-dim: #cdb894;
    --muted: #9c8870;

    --gold: #d9a441;
    --gold-soft: #f0c877;
    --ember: #cf6a2e;
    --moss: #93a86f;
    --danger: #d2644a;

    --line: rgba(217, 164, 65, .18);
    --line-strong: rgba(217, 164, 65, .38);

    --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, .85);
    --shadow-md: 0 18px 36px -20px rgba(0, 0, 0, .8);

    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 10px;

    --font-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
    --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Cascadia Mono", Consolas, "Courier New", monospace;

    --container: 1140px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--parchment);
    background-color: var(--ink-800);
    background-image:
        radial-gradient(1100px 620px at 82% -12%, rgba(207, 106, 46, .20), transparent 62%),
        radial-gradient(900px 520px at 6% -4%, rgba(217, 164, 65, .13), transparent 58%),
        radial-gradient(700px 500px at 50% 108%, rgba(122, 139, 90, .08), transparent 60%),
        repeating-linear-gradient(118deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 7px);
    background-attachment: fixed;
}

img,
svg {
    max-width: 100%;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.01em;
    margin: 0 0 .5em;
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--gold-soft);
    text-decoration: none;
    transition: color .18s ease;
}

a:hover {
    color: #fff;
}

button {
    font-family: inherit;
}

::selection {
    background: rgba(207, 106, 46, .4);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--gold-soft);
    outline-offset: 3px;
    border-radius: 4px;
}

[hidden] {
    display: none !important;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(217, 164, 65, .35) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(217, 164, 65, .28);
    border-radius: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------- Раскладка ---------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 24px;
}

.narrow {
    max-width: 680px;
}

.muted {
    color: var(--muted);
}

.ta-right {
    text-align: right;
}

.eyebrow {
    margin: 0 0 .9rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: .7rem 1.1rem;
    border-radius: 0 0 10px 0;
    background: var(--gold);
    color: #1a120b;
    font-weight: 600;
}

.skip-link:focus {
    left: 0;
    color: #1a120b;
}

/* ---------- Появление при скролле ---------- */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ---------- Шапка ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(18, 13, 9, .86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 74px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--parchment);
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    display: grid;
    place-items: center;
    filter: drop-shadow(0 4px 10px rgba(207, 106, 46, .35));
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.12rem;
    letter-spacing: .01em;
}

.brand-sub {
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.primary-nav > a:not(.btn) {
    position: relative;
    padding: 6px 0;
    color: var(--parchment-dim);
    font-size: .95rem;
}

.primary-nav > a:not(.btn)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold), var(--ember));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
}

.primary-nav > a:not(.btn):hover,
.primary-nav > a:not(.btn).is-active {
    color: var(--parchment);
}

.primary-nav > a:not(.btn):hover::after,
.primary-nav > a:not(.btn).is-active::after {
    transform: scaleX(1);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(217, 164, 65, .06);
    font-size: .86rem;
}

.user-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--moss);
    box-shadow: 0 0 0 3px rgba(147, 168, 111, .16);
}

.user-role {
    padding-left: 8px;
    border-left: 1px solid var(--line);
    font-size: .62rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
}

.logout-form {
    margin: 0;
}

.linklike {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--muted);
    cursor: pointer;
    transition: color .18s ease;
}

.linklike:hover {
    color: var(--gold-soft);
}

.nav-toggle {
    display: none;
}

/* ---------- Кнопки ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-soft), var(--gold) 55%, var(--ember));
    color: #22140c;
    box-shadow: 0 12px 26px -14px rgba(217, 164, 65, .85);
}

.btn-primary:hover {
    color: #1a0f08;
    box-shadow: 0 16px 32px -14px rgba(240, 200, 119, .9);
}

.btn-ghost {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, .02);
    color: var(--parchment);
}

.btn-ghost:hover {
    border-color: var(--gold);
    background: rgba(217, 164, 65, .08);
    color: #fff;
}

.btn-ok {
    border-color: rgba(147, 168, 111, .45);
    background: rgba(147, 168, 111, .08);
    color: #cfe0b4;
}

.btn-ok:hover {
    border-color: var(--moss);
    color: #e6f0d6;
}

.btn-danger {
    border-color: rgba(210, 100, 74, .45);
    background: rgba(210, 100, 74, .06);
    color: #f0a58f;
}

.btn-danger:hover {
    border-color: var(--danger);
    background: rgba(210, 100, 74, .14);
    color: #ffd0c4;
}

.btn-sm {
    padding: 8px 16px;
    font-size: .85rem;
}

.btn-xs {
    padding: 5px 11px;
    border-radius: 8px;
    font-size: .76rem;
}

.btn-block {
    width: 100%;
}

/* ---------- Чипы фильтра ---------- */

.chip {
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .02);
    color: var(--parchment-dim);
    font: inherit;
    font-size: .86rem;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.chip span {
    margin-left: 4px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.chip:hover {
    border-color: var(--line-strong);
    color: var(--parchment);
    transform: translateY(-1px);
}

.chip.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, rgba(240, 200, 119, .95), rgba(207, 106, 46, .9));
    color: #241509;
    font-weight: 600;
}

.chip.is-active span {
    color: rgba(36, 21, 9, .7);
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 84px 0 40px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(620px 320px at 78% 30%, rgba(207, 106, 46, .16), transparent 70%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
    gap: 56px;
    align-items: center;
}

.hero-copy h1 {
    margin: 0 0 .35em;
    font-size: clamp(2.9rem, 6.4vw, 5rem);
    line-height: .94;
}

.hero-copy h1 em {
    font-style: italic;
    background: linear-gradient(120deg, var(--gold-soft), var(--ember));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-tagline {
    margin-bottom: .9em;
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--parchment-dim);
}

.lead {
    max-width: 34rem;
    margin-bottom: 0;
    font-size: 1.02rem;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 28px 0 6px;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    font-size: .9rem;
    color: var(--muted);
}

.hero-points li {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.hero-points strong {
    margin-right: 2px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold-soft);
}

.hero-art {
    position: relative;
}

.hero-art::before {
    content: "";
    position: absolute;
    inset: 8% 4% 14%;
    background: radial-gradient(circle at 50% 45%, rgba(240, 200, 119, .16), transparent 65%);
    filter: blur(18px);
    pointer-events: none;
}

.chest-svg {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 30px 45px rgba(0, 0, 0, .5));
}

.hero-art-caption {
    margin: 10px 0 0;
    text-align: center;
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Парящие «программы» над сундуком */

.float-tile {
    animation: tile-bob 7s ease-in-out infinite;
}

.float-tile--slow {
    animation-duration: 9s;
    animation-delay: -2.2s;
}

.float-tile--fast {
    animation-duration: 5.5s;
    animation-delay: -1.1s;
}

@keyframes tile-bob {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-9px);
    }
}

/* ---------- Секции ---------- */

.section {
    position: relative;
    padding: 78px 0;
}

.section-alt {
    border-top: 1px solid rgba(255, 255, 255, .04);
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .015), transparent 40%),
        rgba(0, 0, 0, .18);
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 34px;
}

.section-head h1,
.section-head h2 {
    margin: 0;
    font-size: clamp(1.9rem, 3.4vw, 2.7rem);
}

.section-note {
    max-width: 30rem;
    margin: 0;
    font-size: .95rem;
    color: var(--muted);
}

/* ---------- Фильтр ---------- */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.filter-status {
    min-height: 1.4em;
    margin: 10px 0 18px;
    font-size: .82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Каталог ---------- */

.prog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.prog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, rgba(49, 33, 22, .92), rgba(30, 21, 14, .96));
    box-shadow: var(--shadow-md);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.prog-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(340px 160px at 12% 0%, rgba(240, 200, 119, .12), transparent 70%);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}

.prog-card:hover {
    transform: translateY(-5px);
    border-color: var(--line-strong);
    box-shadow: 0 26px 44px -26px rgba(0, 0, 0, .95);
}

.prog-card:hover::before {
    opacity: 1;
}

.prog-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.prog-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(217, 164, 65, .28);
    border-radius: 12px;
    background: radial-gradient(circle at 35% 25%, rgba(240, 200, 119, .22), rgba(207, 106, 46, .06) 70%);
    color: var(--gold-soft);
}

.prog-title {
    flex: 1;
    min-width: 0;
}

.prog-title h3 {
    margin: 0 0 2px;
    font-size: 1.16rem;
    line-height: 1.2;
}

.prog-cat {
    margin: 0;
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.prog-ver {
    flex: 0 0 auto;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--gold);
    white-space: nowrap;
}

.prog-desc {
    flex: 1;
    margin: 0;
    font-size: .9rem;
    color: var(--parchment-dim);
}

.prog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.prog-tags li {
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 5px;
    background: rgba(255, 255, 255, .04);
    font-family: var(--font-mono);
    font-size: .68rem;
    color: var(--muted);
}

.prog-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(217, 164, 65, .1);
}

.prog-platform {
    font-size: .72rem;
    color: var(--muted);
}

.prog-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: .8rem;
    font-weight: 600;
    color: var(--gold);
    cursor: pointer;
    transition: color .18s ease;
}

.prog-open span {
    transition: transform .2s ease;
}

.prog-open:hover {
    color: var(--gold-soft);
}

.prog-open:hover span {
    transform: translateX(3px);
}

.empty-state {
    margin: 28px 0 0;
    padding: 22px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--muted);
}

/* ---------- Модальное окно ---------- */

.modal {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: linear-gradient(165deg, #322116, #1d140e);
    color: var(--parchment);
    box-shadow: 0 40px 90px -30px #000;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal::backdrop {
    background: rgba(8, 6, 4, .72);
    backdrop-filter: blur(4px);
}

.modal-inner {
    position: relative;
    margin: 0;
    padding: 30px 30px 26px;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, .03);
    color: var(--parchment-dim);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: color .18s ease, border-color .18s ease;
}

.modal-close:hover {
    border-color: var(--gold);
    color: #fff;
}

.modal h2 {
    margin-bottom: .4em;
    font-size: 1.9rem;
}

.modal-desc {
    color: var(--parchment-dim);
}

.modal-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
    margin: 22px 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
}

.modal-meta dt {
    margin-bottom: 2px;
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}

.modal-meta dd {
    margin: 0;
    font-size: .95rem;
}

.modal-meta-wide {
    grid-column: 1 / -1;
}

.modal-meta .hash {
    font-family: var(--font-mono);
    font-size: .72rem;
    line-height: 1.5;
    color: var(--parchment-dim);
    overflow-wrap: anywhere;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.modal-actions .btn {
    flex: 1 1 190px;
}

.modal-note {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(217, 164, 65, .07);
    font-size: .85rem;
    color: var(--parchment-dim);
}

.modal-sm {
    width: min(460px, calc(100vw - 32px));
}

/* ---------- Шаги ---------- */

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.step {
    position: relative;
    padding: 26px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .02);
}

.step-num {
    font-family: var(--font-mono);
    font-size: .8rem;
    letter-spacing: .14em;
    color: var(--gold);
}

.step h3 {
    margin: 10px 0 .4em;
    font-size: 1.25rem;
}

.step p {
    margin: 0;
    font-size: .93rem;
    color: var(--muted);
}

.steps-stacked {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
}

.steps-stacked .step {
    padding: 18px 20px;
}

.steps-stacked .step h3 {
    font-size: 1.08rem;
}

/* ---------- Хранитель ---------- */

.keeper {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 54px;
    align-items: center;
}

.keeper-portrait {
    text-align: center;
}

.portrait-ring {
    display: inline-grid;
    place-items: center;
    padding: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 164, 65, .12), transparent 70%);
}

.portrait-ring svg {
    filter: drop-shadow(0 10px 24px rgba(207, 106, 46, .35));
}

.portrait-ring picture {
    display: block;
    border-radius: 50%;
    overflow: hidden;
    line-height: 0;
}

.portrait-ring img {
    display: block;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    object-fit: cover;
    filter: drop-shadow(0 10px 24px rgba(207, 106, 46, .35));
}

.portrait-note {
    margin: 16px 0 0;
    font-size: .75rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.keeper-copy h2 {
    font-size: clamp(1.9rem, 3.4vw, 2.7rem);
}

.keeper-copy p {
    color: var(--parchment-dim);
}

.keeper-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 26px 0;
}

.keeper-stat {
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .02);
    text-align: center;
}

.stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 1.7rem;
    line-height: 1.1;
    color: var(--gold-soft);
}

.stat-label {
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.keeper-sign {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--gold);
}

/* ---------- Подвал ---------- */

.site-footer {
    margin-top: 20px;
    padding: 34px 0;
    border-top: 1px solid var(--line);
    background: rgba(10, 7, 5, .5);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-name {
    margin: 0 0 2px;
    font-family: var(--font-display);
}

.footer-note {
    margin: 0;
    font-size: .82rem;
    color: var(--muted);
}

.footer-meta {
    text-align: right;
    font-size: .82rem;
    color: var(--muted);
}

.footer-meta p {
    margin: 0;
}

.footer-small {
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(156, 136, 112, .7);
}

/* ---------- Страница входа ---------- */

.auth-body {
    display: flex;
    flex-direction: column;
}

.auth-body .topbar {
    position: static;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
}

.auth-body .topbar-inner {
    justify-content: center;
    min-height: 96px;
}

.auth-body #main {
    display: flex;
    flex: 1 0 auto;
}

.auth-wrap {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 10px 24px 70px;
}

.auth-card {
    position: relative;
    width: min(430px, 100%);
    padding: 52px 34px 30px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: linear-gradient(165deg, rgba(52, 35, 23, .97), rgba(26, 18, 12, .98));
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-card::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(217, 164, 65, .12);
    border-radius: 15px;
    pointer-events: none;
}

.auth-lid {
    position: absolute;
    top: -34px;
    left: 50%;
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #4a3120, #1c120c 70%);
    color: var(--gold);
    box-shadow: 0 14px 30px -12px #000, inset 0 0 0 5px rgba(217, 164, 65, .06);
    transform: translateX(-50%);
}

.auth-card h1 {
    margin-bottom: .3em;
    font-size: 2.2rem;
}

.auth-sub {
    margin-bottom: 22px;
    font-size: .92rem;
    color: var(--muted);
}

.auth-form {
    position: relative;
    z-index: 1;
    text-align: left;
}

.auth-foot {
    margin: 20px 0 0;
    font-size: .8rem;
    color: var(--muted);
}

.auth-more {
    position: relative;
    z-index: 1;
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: .84rem;
}

.auth-more .linklike {
    color: var(--gold);
    font-weight: 600;
}

.auth-more .linklike:hover {
    color: var(--gold-soft);
}

/* ---------- Поля формы ---------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    text-align: left;
}

.field label {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(217, 164, 65, .22);
    border-radius: 10px;
    background: rgba(10, 7, 5, .55);
    color: var(--parchment);
    font: inherit;
    font-size: .95rem;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input::placeholder {
    color: rgba(156, 136, 112, .55);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(10, 7, 5, .75);
    box-shadow: 0 0 0 3px rgba(217, 164, 65, .14);
}

select {
    appearance: none;
    padding-right: 36px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--gold) 50%),
        linear-gradient(135deg, var(--gold) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.pw-wrap {
    position: relative;
    display: flex;
}

.pw-wrap input {
    padding-right: 96px;
}

.pw-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--gold);
    font: inherit;
    font-size: .78rem;
    cursor: pointer;
    transform: translateY(-50%);
}

.pw-toggle:hover {
    background: rgba(217, 164, 65, .1);
}

.field-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.password-actions {
    justify-content: space-between;
}

.password-actions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.password-length {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.password-length input {
    width: 74px;
    padding: 8px 10px;
    font-family: var(--font-mono);
    font-size: .85rem;
    font-weight: 400;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
}

/* ---------- Уведомления и панели ---------- */

.alert {
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid;
    border-radius: 10px;
    font-size: .9rem;
    text-align: left;
}

.alert-ok {
    border-color: rgba(147, 168, 111, .4);
    background: rgba(147, 168, 111, .12);
    color: #d8e6c2;
}

.alert-error {
    border-color: rgba(210, 100, 74, .45);
    background: rgba(210, 100, 74, .12);
    color: #f3beae;
}

.page-section {
    padding: 54px 0 80px;
}

.panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, rgba(45, 30, 20, .9), rgba(26, 18, 12, .96));
    box-shadow: var(--shadow-md);
}

.panel-center {
    max-width: 520px;
    margin: 60px auto;
    text-align: center;
}

.panel h2 {
    font-size: 1.4rem;
    margin-bottom: .4em;
}

.panel-note {
    font-size: .82rem;
    color: var(--muted);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head h2 {
    margin: 0;
}

.panel-count {
    min-width: 34px;
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--gold-soft);
}

/* ---------- Адаптивность ---------- */

@media (max-width: 1080px) {
    .prog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-inner {
        gap: 36px;
    }

    .keeper {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 36px;
    }
}

@media (max-width: 900px) {
    .hero {
        padding: 58px 0 24px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-art {
        width: min(520px, 100%);
        margin: 0 auto;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .keeper {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .keeper-portrait {
        order: -1;
    }

    .portrait-ring {
        width: 190px;
        height: 190px;
    }

    .portrait-ring svg {
        width: 104px;
        height: 104px;
    }

    .portrait-ring img {
        width: 104px;
        height: 104px;
    }
}

@media (max-width: 860px) {
    .topbar-inner {
        gap: 12px;
    }

    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 42px;
        height: 42px;
        margin-left: auto;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: transparent;
        cursor: pointer;
    }

    .nav-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background: var(--gold-soft);
        transition: transform .2s ease, opacity .2s ease;
    }

    .primary-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin-left: 0;
        padding: 14px 24px 20px;
        border-bottom: 1px solid var(--line);
        background: rgba(18, 13, 9, .98);
        box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .9);
    }

    .primary-nav.is-open {
        display: flex;
    }

    .primary-nav > a:not(.btn) {
        padding: 10px 0;
    }

    .primary-nav .btn {
        align-self: flex-start;
        margin-top: 8px;
    }

    .user-chip {
        align-self: flex-start;
        margin: 6px 0;
    }

    .logout-form {
        padding-top: 4px;
    }
}

@media (max-width: 760px) {
    .steps {
        grid-template-columns: 1fr;
    }

    .keeper-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-meta {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .footer-meta {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .container {
        padding-inline: 18px;
    }

    .section {
        padding: 56px 0;
    }

    .prog-grid {
        grid-template-columns: 1fr;
    }

    .hero-copy h1 {
        font-size: clamp(2.5rem, 11vw, 3.4rem);
    }

    .hero-actions {
        gap: 10px;
    }

    .hero-actions .btn {
        flex: 1 1 100%;
    }

    .brand-name {
        font-size: 1rem;
    }

    .brand-sub {
        font-size: .6rem;
    }

    .filters {
        gap: 8px;
    }

    .chip {
        padding: 8px 13px;
        font-size: .8rem;
    }

    .modal-inner {
        padding: 26px 20px 22px;
    }

    .auth-card {
        padding: 48px 22px 26px;
    }

    .auth-card h1 {
        font-size: 1.9rem;
    }

    .auth-wrap {
        padding: 6px 16px 54px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}






