/* =========================================================
   firmabox-ui — konto.css
   Konto: logowanie, rejestracja, moduły, licencje, członkowie.
   Wymaga core.css (NIE łączyć z panel.css)
   ========================================================= */
body {
    min-height: 100vh;
    color: var(--ink);
    font: 16px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
            radial-gradient(ellipse 50% 40% at 12% 0%, rgba(0, 61, 165, .05), transparent 70%),
            radial-gradient(ellipse 45% 40% at 90% 100%, rgba(0, 61, 165, .045), transparent 70%),
            var(--g-50);
    background-attachment: fixed;
}
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
svg { display: block; flex-shrink: 0; }
:focus-visible { outline-offset: 3px; }

.muted { color: var(--g-500); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; color: var(--g-500); }
.center { display: grid; justify-items: center; gap: 14px; text-align: center; }
.container { width: min(1080px, 100% - 32px); margin-inline: auto; }
.small { font-size: 13px; }
.right { text-align: right; }

/* =========================================================
   Logo (jak na www)
   ========================================================= */
.logo { display: inline-flex; align-items: center; gap: .26em; color: var(--black); line-height: 1; text-decoration: none; }
.logo-icon { width: 1.28em; height: auto; overflow: visible; }
.logo-icon .flap { fill: currentColor; }
.logo-word { font-weight: 800; letter-spacing: -.04em; }
.logo-tld { margin-left: .06em; font-size: .42em; font-weight: 700; letter-spacing: 0; color: var(--accent); }
.logo--sm { font-size: 24px; }
.logo--md { font-size: 34px; }

/* =========================================================
   Przyciski
   ========================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; padding: 0 22px;
    font: 700 15px var(--font); text-decoration: none; white-space: nowrap;
    border: 1px solid transparent; border-radius: 999px; cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .25s, background .2s, border-color .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { box-shadow: 0 10px 24px rgba(11, 11, 12, .2); }
.btn-light { background: var(--white); color: var(--ink); border-color: var(--g-300); }
.btn-light:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn svg { transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(2px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-link {
    padding: 0; background: none; border: 0;
    font: 700 14px var(--font); color: var(--accent);
    text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
    transition: color .2s;
}
.btn-link:hover { color: var(--accent-600); }

.back {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px;
    font-size: 14px; font-weight: 700; color: var(--g-500); text-decoration: none;
    transition: color .2s;
}
.back:hover { color: var(--accent); }

/* =========================================================
   Alerty
   ========================================================= */
.alert {
    --c: var(--g-500);
    margin-bottom: 16px; padding: 12px 16px;
    font-size: 14px; font-weight: 600; color: var(--c);
    background: color-mix(in srgb, var(--c) 5%, var(--white));
    border: 1px solid color-mix(in srgb, var(--c) 26%, transparent); border-radius: 12px;
}
.alert-danger  { --c: var(--error); }
.alert-success { --c: var(--ok); }

.note {
    padding: 11px 14px; font-size: 13.5px; color: var(--g-700);
    background: var(--accent-50);
    border: 1px solid var(--accent-100); border-radius: 12px;
}

/* =========================================================
   Formularze (jak na www)
   ========================================================= */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form--single { grid-template-columns: 1fr; }
.field { display: grid; gap: 7px; align-content: start; min-width: 0; }
.field--full, .form > .btn, .form > ul { grid-column: 1 / -1; }
.field > label { font-size: 14px; font-weight: 700; }
label.required::after { content: " *"; color: var(--g-400); }

.input {
    width: 100%; height: 48px; padding: 0 14px;
    font: 16px var(--font); color: var(--ink);
    background: var(--white);
    border: 1px solid var(--g-300); border-radius: 12px;
    transition: border-color .2s, box-shadow .2s;
}
.input:hover { border-color: var(--g-400); }
.input::placeholder { color: var(--g-400); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
textarea.input { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
select.input, .input.mb-select {
    appearance: none; -webkit-appearance: none;
    padding-right: 44px; cursor: pointer;
    background: var(--white) var(--select-arrow-lg) no-repeat right 15px center / 15px;
}
.input.mb-select { width: 100%; }
.input.mb-select--sm { height: 40px; padding-top: 0; padding-bottom: 0; font-size: 14px; background-size: 13px; }
.has-error .input { border-color: var(--error); }
.has-error .input:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, .1); }
.field-errors { list-style: none; margin: 0; padding: 0; font-size: 13px; font-weight: 600; color: var(--error); }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--g-500); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.check a { color: var(--g-700); text-underline-offset: 3px; }
.check a:hover { color: var(--accent); }

.form-section {
    grid-column: 1 / -1;
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin: 0; padding: 0 0 22px;
    border: 0; border-bottom: 1px solid var(--g-200);
}
.form-section:last-of-type { border-bottom: 0; padding-bottom: 4px; }
.form-section legend { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 18px; font-weight: 800; }
.form-section legend span {
    width: 28px; height: 28px; display: grid; place-items: center;
    font-size: 13px; font-weight: 800; color: var(--white);
    background: var(--black); border-radius: 50%;
    box-shadow: 0 0 0 4px var(--g-100);
}

/* ---------- wybór modułów (rejestracja) ---------- */
.module-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.module-choice { position: relative; cursor: pointer; }
.module-choice input { position: absolute; opacity: 0; pointer-events: none; }
.module-choice-body {
    height: 100%; display: grid; gap: 4px; padding: 18px;
    background: var(--white);
    border: 1px solid var(--g-300); border-radius: var(--radius-lg);
    transition: border-color .2s, box-shadow .25s, background .2s, transform .25s var(--ease);
}
.module-choice-body small { font-size: 13px; line-height: 1.45; color: var(--g-500); }
.module-choice-icon {
    width: 42px; height: 42px; margin-bottom: 6px;
    display: grid; place-items: center;
    color: var(--black); background: var(--g-100); border-radius: 12px;
    transition: background .25s, color .25s;
}
.module-choice:hover .module-choice-body { border-color: var(--accent-100); transform: translateY(-2px); box-shadow: var(--shadow); }
.module-choice input:checked + .module-choice-body { background: var(--accent-50); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.module-choice input:checked + .module-choice-body .module-choice-icon { color: var(--white); background: var(--accent); }
.module-choice input:focus-visible + .module-choice-body { outline: 2px solid var(--accent); outline-offset: 3px; }

/* =========================================================
   Ekrany auth
   ========================================================= */
body.auth { position: relative; background: var(--white); }
body.auth::before {                                  /* kropki + poświata jak w hero www */
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
            radial-gradient(closest-side, rgba(0, 61, 165, .07), transparent) 50% 40% / min(900px, 120vw) min(450px, 60vw) no-repeat,
            radial-gradient(var(--g-300) 1px, transparent 1px) 0 0 / 24px 24px;
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 30%, transparent 85%);
    mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 30%, transparent 85%);
}
.auth-wrap { min-height: 100vh; min-height: 100svh; display: grid; justify-items: center; align-content: center; gap: 24px; padding: 40px 16px; }
.auth-logo { text-decoration: none; border-radius: 8px; }
.auth-card {
    width: min(420px, 100%); padding: 34px;
    display: grid; gap: 14px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-edge); border-radius: 24px;
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shine), var(--shadow-lg);
    animation: card-in .6s var(--ease) both;
}
.auth-card--wide { width: min(760px, 100%); }
.auth-card h1 { font-size: 30px; font-weight: 800; }
.auth-card > .form { margin-top: 8px; }
.auth-links { font-size: 14px; text-align: center; }
.auth-foot { font-size: 15px; color: var(--g-500); }
.auth-foot a, .auth-links a { font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.auth-foot a:hover, .auth-links a:hover { color: var(--accent-600); }
.big-icon {
    width: 68px; height: 68px; display: grid; place-items: center;
    font-size: 28px; color: var(--white);
    background: var(--accent); border-radius: 50%;
    box-shadow: 0 0 0 8px var(--accent-50);
    animation: pop .6s var(--ease) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); } }

/* =========================================================
   Panel — topbar
   ========================================================= */
.topbar {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255, 255, 255, .62);
    backdrop-filter: blur(18px) saturate(1.8); -webkit-backdrop-filter: blur(18px) saturate(1.8);
    border-bottom: 1px solid var(--g-200);
}
.topbar-inner { height: 68px; display: flex; align-items: center; gap: 14px; }
.topbar-sep { width: 1px; height: 22px; background: var(--g-300); }
.topbar-title { font-weight: 700; color: var(--g-500); }

.topnav { display: flex; gap: 24px; margin-left: 16px; }
.topnav a {
    position: relative; padding: 4px 0;
    font-size: 15px; font-weight: 600; color: var(--g-700); text-decoration: none;
    transition: color .2s;
}
.topnav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
    height: 2px; border-radius: 2px; background: var(--accent);
    transform: scaleX(0); transform-origin: left;
    transition: transform .3s var(--ease);
}
.topnav a:hover, .topnav a.is-active { color: var(--black); }
.topnav a:hover::after, .topnav a.is-active::after { transform: scaleX(1); }

.menu { position: relative; margin-left: auto; }
.menu > summary { list-style: none; cursor: pointer; border-radius: 999px; }
.menu > summary::-webkit-details-marker { display: none; }
.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 14px 4px 4px;
    background: var(--glass-bg);
    border: 1px solid var(--g-200); border-radius: 999px;
    box-shadow: var(--glass-shine);
    transition: border-color .2s;
}
.menu > summary:hover .user-chip, .menu[open] .user-chip { border-color: var(--accent-100); }
.avatar {
    width: 32px; height: 32px; display: grid; place-items: center;
    font-size: 12px; font-weight: 800; color: var(--white);
    background: var(--black); border-radius: 50%;
}
.user-name { font-size: 14px; font-weight: 700; }
.menu-list {
    position: absolute; right: 0; top: calc(100% + 10px);
    min-width: 240px; padding: 6px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-edge); border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shine), var(--shadow-lg);
    animation: drop .2s var(--ease);
}
.menu-list a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px; text-decoration: none;
    transition: background .15s, color .15s;
}
.menu-list a > svg { color: var(--g-500); transition: color .15s; }
.menu-list a:hover { background: var(--accent-50); color: var(--accent); }
.menu-list a:hover > svg { color: var(--accent); }
.menu-head { margin-bottom: 4px; padding: 8px 12px 10px; font-size: 13px; color: var(--g-500); border-bottom: 1px solid var(--g-200); }

/* =========================================================
   Strony
   ========================================================= */
.page { display: grid; gap: 28px; padding: 44px 0 72px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 10px 0 4px; font-size: clamp(30px, 4vw, 40px); font-weight: 800; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 12px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--g-500); background: var(--white);
    border: 1px solid var(--g-200); border-radius: 999px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.org-switch .input { width: auto; min-width: 240px; }
.empty-state { display: grid; gap: 10px; padding: 64px 20px; text-align: center; }

/* ---------- karty modułów ---------- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.module-card {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 10px;
    padding: 28px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-edge); border-radius: 24px;
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shine), var(--shadow);
    transition: box-shadow .35s, border-color .35s, transform .35s var(--ease);
}
.module-card::after {                                /* pierścienie jak na www */
    content: ""; position: absolute; right: -70px; top: -70px;
    width: 200px; height: 200px; border-radius: 50%;
    border: 1px solid var(--g-200);
    box-shadow: 0 0 0 34px rgba(255, 255, 255, .45), 0 0 0 35px var(--g-200);
    pointer-events: none;
    transition: transform .8s var(--ease), border-color .5s;
}
.module-card > * { position: relative; z-index: 1; }
.module-card.is-open:hover { transform: translateY(-4px); box-shadow: var(--glass-shine), var(--shadow-lg); }
.module-card.is-open:hover::after { transform: scale(1.08) rotate(8deg); border-color: var(--accent-100); }
.module-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.module-icon {
    width: 54px; height: 54px; display: grid; place-items: center;
    color: var(--g-500); background: var(--g-100); border-radius: 16px;
    transition: background .3s, color .3s;
}
.module-card.is-open .module-icon { color: var(--white); background: var(--black); }
.module-card.is-open:hover .module-icon { background: var(--accent); }
.module-card h2 { font-size: 26px; font-weight: 800; }
.module-actions { margin-top: auto; padding-top: 14px; }

/* ---------- badge ---------- */
.badge {
    --c: var(--g-500);
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; font-size: 12px; font-weight: 700; line-height: 1.4;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 8%, var(--white));
    border: 1px solid color-mix(in srgb, var(--c) 20%, transparent); border-radius: 999px;
}
.badge--on, .badge--active, .badge--paid { --c: var(--accent); }
.badge--on::before, .badge--active::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
    animation: dot 2.2s infinite;
}
.badge--trial { --c: var(--g-700); }
.badge--off, .badge--expired, .badge--cancelled { --c: var(--error); }
.badge--pending { --c: var(--warn); }
.badge--lg { padding: 7px 14px; font-size: 14px; }

/* ---------- karty ---------- */
.card {
    display: grid; gap: 16px; align-content: start;
    padding: 26px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-edge); border-radius: 24px;
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shine), var(--shadow);
}
.card h2 { font-size: 21px; font-weight: 800; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.license-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; }

/* ---------- licencja ---------- */
.license-big { display: flex; align-items: baseline; gap: 10px; }
.license-big strong { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.license-big span { font-weight: 600; color: var(--g-500); }
.progress { height: 8px; overflow: hidden; background: var(--g-100); border-radius: 999px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .8s var(--ease); }
.progress--lg { height: 10px; }
.license-mini { display: grid; gap: 6px; margin-top: 4px; }
.license-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--g-700); }
.price-hint { font-size: 14px; font-weight: 700; color: var(--accent); }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; font-size: 15px; }
.dl dt { color: var(--g-500); }
.dl dd { margin: 0; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- tabela ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
    padding: 10px 12px; text-align: left;
    font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--g-500);
    border-bottom: 1px solid var(--g-200);
}
.table td { padding: 13px 12px; vertical-align: middle; border-bottom: 1px solid var(--g-100); }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.table td { transition: background .15s; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--accent-50); }
.table a { font-weight: 700; text-decoration: none; transition: color .15s; }
.table a:hover { color: var(--accent); }

.order-row {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 13px 0; text-decoration: none;
    border-bottom: 1px solid var(--g-100);
    transition: color .15s;
}
.order-row:last-child { border-bottom: 0; }
.order-row:hover { color: var(--accent); }
.order-row > span { display: grid; gap: 2px; }
.order-row small { font-size: 13px; color: var(--g-500); }
.order-row-end { justify-items: end; }

/* =========================================================
   Checkout
   ========================================================= */
.checkout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.checkout-form .input { max-width: 180px; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.checkout-summary { position: sticky; top: 88px; }
.period-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.period-choice { position: relative; cursor: pointer; }
.period-choice input { position: absolute; opacity: 0; pointer-events: none; }
.period-body {
    height: 100%; display: grid; gap: 4px; padding: 18px;
    background: var(--white);
    border: 1px solid var(--g-300); border-radius: var(--radius-lg);
    transition: border-color .2s, box-shadow .25s, background .2s;
}
.period-body strong { font-size: 17px; }
.period-body small { color: var(--g-500); }
.period-body em {
    justify-self: start; margin-top: 4px; padding: 3px 9px;
    font-size: 12px; font-style: normal; font-weight: 800; color: var(--white);
    background: var(--accent); border-radius: 999px;
}
.period-choice:hover .period-body { border-color: var(--accent-100); }
.period-choice input:checked + .period-body { background: var(--accent-50); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.period-choice input:focus-visible + .period-body { outline: 2px solid var(--accent); outline-offset: 3px; }

.summary-desc { font-weight: 700; }
.totals { display: grid; margin: 4px 0 0; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--g-300); }
.totals dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.totals > .totals-gross { border-bottom: 0; padding-top: 12px; font-size: 21px; font-weight: 800; }
.totals-gross dd { font-weight: 800; }
turbo-frame#checkout-summary { display: grid; gap: 12px; }
turbo-frame#checkout-summary[busy] { opacity: .5; transition: opacity .2s; }

/* ---------- symulator / sukces ---------- */
.sim-banner {
    padding: 9px 12px; text-align: center;
    font-size: 13px; font-weight: 700; color: var(--warn);
    background: var(--warn-bg);
    border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); border-radius: 12px;
}
.sim-amount { padding: 18px 0; text-align: center; font-size: 44px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.success-box {
    display: flex; align-items: center; gap: 16px;
    padding: 20px 24px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--accent-100); border-radius: 24px;
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shine), var(--shadow);
}
.success-box > div { flex: 1; }
.success-icon {
    width: 46px; height: 46px; flex-shrink: 0;
    display: grid; place-items: center;
    font-weight: 800; color: var(--white);
    background: var(--accent); border-radius: 50%;
    box-shadow: 0 0 0 6px var(--accent-50);
    animation: pop .6s var(--ease) both;
}

/* =========================================================
   Członkowie (mb-*)
   ========================================================= */
.mb { --mb-border: var(--g-200); --mb-muted: var(--g-500); --mb-ink: var(--black); --mb-soft: var(--g-100); }

.mb-usage { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; margin-bottom: 20px; }
.mb-usage-item {
    display: block; padding: 16px 18px;
    color: inherit; text-decoration: none;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-edge); border-radius: 18px;
    box-shadow: var(--glass-shine), var(--shadow);
    transition: border-color .25s, box-shadow .25s, transform .3s var(--ease);
}
a.mb-usage-item:hover { border-color: var(--accent-100); box-shadow: var(--glass-shine), var(--shadow-lg); transform: translateY(-2px); }
.mb-usage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; }
.mb-usage-head small { font-weight: 700; color: var(--g-500); font-variant-numeric: tabular-nums; }
.mb-bar { display: block; height: 6px; margin: 12px 0 8px; overflow: hidden; background: var(--g-100); border-radius: 999px; }
.mb-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.mb-usage-note { font-size: 13px; color: var(--g-500); }
.mb-usage-item.is-full .mb-bar span { background: var(--warn); }
.mb-usage-item.is-full .mb-usage-note { color: var(--warn); font-weight: 600; }
.mb-usage-item.is-off { opacity: .55; }

.mb-list {
    overflow: hidden;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-edge); border-radius: 24px;
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shine), var(--shadow);
}
.mb-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 200px minmax(0, 260px);
    gap: 14px 24px; align-items: center;
    padding: 20px 24px;
    transition: background .15s;
}
.mb-row + .mb-row { border-top: 1px solid var(--g-200); }
.mb-row:hover { background: rgba(240, 244, 251, .5); }

.mb-person { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mb-avatar {
    flex: none; width: 42px; height: 42px;
    display: grid; place-items: center;
    font-size: 14px; font-weight: 800; color: var(--accent);
    background: var(--accent-50); border-radius: 50%;
    box-shadow: inset 0 0 0 1px var(--accent-100);
}
.mb-who { min-width: 0; }
.mb-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; }
.mb-email { overflow: hidden; font-size: 14px; color: var(--g-500); text-overflow: ellipsis; white-space: nowrap; }

.mb-role form { margin: 0; }
.mb-role-text { font-size: 15px; font-weight: 600; }

.mb-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.mb-actions form, .mb-licenses form { margin: 0; }

.mb-licenses { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-left: 56px; }
.mb-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 14px;
    font: 600 13.5px var(--font); color: var(--g-700);
    background: var(--white);
    border: 1px solid var(--g-300); border-radius: 999px;
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
}
.mb-chip svg { width: 14px; height: 14px; flex: none; }
.mb-chip:hover { border-color: var(--accent); color: var(--accent); }
.mb-chip.is-on { color: var(--accent); background: var(--accent-50); border-color: var(--accent); }
.mb-chip.is-on:hover { background: var(--accent-100); }
.mb-chip:disabled { color: var(--g-400); background: var(--g-100); border-color: transparent; cursor: not-allowed; }

.mb-empty { margin: 0; padding: 22px 24px; }

/* =========================================================
   Formularz członka (mf-*)
   ========================================================= */
.mf { max-width: 760px; }
.mf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.mf-grid > * { min-width: 0; margin: 0; }
.mf-span { grid-column: 1 / -1; }
.mf-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.mf-label .req { font-weight: 400; color: var(--g-400); }

.mf-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 10px; }
.mf-module {
    position: relative; margin: 0;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--g-300); border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.mf-module:hover { border-color: var(--accent-100); }
.mf-module input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mf-box {
    flex: none; width: 20px; height: 20px;
    display: grid; place-items: center;
    border: 1.5px solid var(--g-300); border-radius: 6px;
    transition: background .2s, border-color .2s;
}
.mf-box svg { width: 12px; height: 12px; color: var(--white); opacity: 0; transition: opacity .15s; }
.mf-module input:checked + .mf-box { background: var(--accent); border-color: var(--accent); }
.mf-module input:checked + .mf-box svg { opacity: 1; }
.mf-module input:focus-visible + .mf-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.mf-module:has(input:checked) { background: var(--accent-50); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mf-module.is-disabled { opacity: .5; cursor: not-allowed; }
.mf-module.is-disabled:hover { border-color: var(--g-300); }
.mf-module-name { display: block; font-weight: 700; line-height: 1.3; }
.mf-module-meta { display: block; font-size: 13px; color: var(--g-500); }

.mf-hint { margin: 24px 0 0; }
.mf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 24px; }

/* =========================================================
   Brak backdrop-filter → pełne tła
   ========================================================= */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .topbar { background: rgba(255, 255, 255, .96); }
    .auth-card, .menu-list, .module-card, .card, .success-box, .mb-usage-item, .mb-list, .user-chip { background: var(--white); }
}

/* =========================================================
   Responsywność
   ========================================================= */
@media (max-width: 860px) {
    .license-grid, .checkout { grid-template-columns: 1fr; }
    .checkout-summary { position: static; }
    .success-box { flex-wrap: wrap; }
    .topnav { display: none; }
}

@media (max-width: 760px) {
    .mb-row { grid-template-columns: 1fr; padding: 18px; }
    .mb-actions { justify-content: flex-start; }
    .mb-licenses { padding-left: 0; }
}

@media (max-width: 640px) {
    .form, .form-section, .form-pair, .mf-grid, .period-choices { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; border-radius: 20px; }
    .auth-card h1 { font-size: 26px; }
    .user-name, .topbar-sep, .topbar-title { display: none; }
    .user-chip { padding-right: 4px; }
    .page { padding: 32px 0 56px; }
    .module-card, .card { padding: 22px; }
    .org-switch, .org-switch .input { width: 100%; min-width: 0; }
    .mf-actions .btn { flex: 1; }
}


/* =========================================================
   Panel obsługi
   ========================================================= */
.topbar--admin { background: var(--black); border-bottom-color: var(--black); }
.topbar--admin .logo, .topbar--admin .topbar-title { color: var(--white); }
.topbar--admin .topbar-sep { background: rgba(255,255,255,.25); }
.topbar--admin .topnav a { color: rgba(255,255,255,.65); }
.topbar--admin .topnav a:hover, .topbar--admin .topnav a.is-active { color: var(--white); background: rgba(255,255,255,.12); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { display: grid; gap: 2px; padding: 18px 20px; text-decoration: none; background: var(--white); border: 1px solid var(--g-200); border-radius: 18px; box-shadow: var(--shadow); transition: border-color .2s, transform .2s var(--ease); }
.kpi:hover { border-color: var(--g-400); transform: translateY(-2px); }
.kpi span { font-size: 13px; font-weight: 700; color: var(--g-500); }
.kpi strong { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12.5px; color: var(--g-500); }
.kpi--warn { border-color: #f0c36b; background: #fffaf0; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; }
.filters .input { width: auto; flex: 1 1 180px; }
.filters input[type=search] { flex: 2 1 260px; }

.card--narrow { max-width: 760px; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pager { display: flex; align-items: center; gap: 10px; }
.stack { display: grid; gap: 20px; align-content: start; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }
.row-actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.table td .badge { margin: 2px 4px 2px 0; }
select.input { padding-right: 32px; }
.form-help { font-size: 12.5px; color: var(--g-500); }

.log { list-style: none; margin: 0; padding: 0; display: grid; }
.log li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--g-100); font-size: 14px; }
.log li:last-child { border-bottom: 0; }
.log-time { color: var(--g-500); font-variant-numeric: tabular-nums; }
.log-body small { display: block; color: var(--g-500); }

@media (max-width: 640px) {
    .log li { grid-template-columns: 1fr; gap: 2px; }
    .topbar--admin .topnav { display: flex; }
}

/* ---------- ceny i rabaty ---------- */
.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.price s { color: var(--g-400); font-weight: 600; }
.price strong { font-weight: 800; }
.price-free { color: var(--ok); }
.price-badge { padding: 2px 8px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--white); background: var(--black); border-radius: 999px; }
.price-until { font-size: 12px; color: var(--g-500); }
.totals-discount dt, .totals-discount dd { color: var(--ok); font-weight: 700; }
.input-code { text-transform: uppercase; letter-spacing: .06em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.help-text { font-size: 12.5px; color: var(--g-500); }

/* przełączniki wyboru (radio/checkbox expanded) */
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip { position: relative; cursor: pointer; }
.choice-chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip span { display: inline-block; padding: 8px 14px; font-size: 14px; font-weight: 600; border: 1px solid var(--g-300); border-radius: 999px; transition: background .2s, color .2s, border-color .2s; }
.choice-chip:hover span { border-color: var(--black); }
.choice-chip input:checked + span { color: var(--white); background: var(--black); border-color: var(--black); }
.choice-chip input:focus-visible + span { outline: 2px solid var(--black); outline-offset: 2px; }
