@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/roboto-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/roboto-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    font: 15px/1.65 Helvetica, Arial, sans-serif;
    color: #46515e;
    background: #fff;
    --dark: #252d35;
    --ink: #32373d;
    --accent: #ed6f6d;
    --line: #dce2e8;
    --panel: #eaedf1;
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    padding: .35rem max(1rem, calc((100% - 960px) / 2));
    background: var(--dark);
    border-bottom: 4px solid var(--accent);
}
.brand, .brand img { display: block; }
nav { display: flex; flex-wrap: wrap; align-items: center; background: #f2f3f5; }
nav form { margin: 0; }
nav a, .quiet {
    display: block;
    padding: .55rem .8rem;
    color: var(--ink);
    font: 700 .85rem/1.5 Helvetica, Arial, sans-serif;
    text-decoration: none;
}
nav a:hover, .quiet:hover { background: #e2e5e9; }
main { width: min(calc(100% - 2rem), 960px); margin: 2rem auto 4rem; }
h1, h2 { font-weight: 400; color: var(--ink); line-height: 1.2; }
h1 { font-size: clamp(1.65rem, 5vw, 2.2rem); border-bottom: 1px solid var(--accent); padding-bottom: .65rem; margin: 0 0 1.2rem; }
h2 { font-size: 1.4rem; }
main > p { max-width: 78ch; }
fieldset { min-width: 0; margin: 0; padding: .35rem .8rem .65rem; border: 0; border-bottom: 1px solid var(--line); }
fieldset:nth-of-type(odd) { background: #f4f6f8; }
legend { float: left; width: 100%; padding: .3rem 0; font-weight: 600; }
fieldset label { clear: none; display: inline-flex; gap: .35rem; margin-right: 1.2rem; align-items: center; cursor: pointer; }
input[type=radio] { accent-color: #8a3d41; }
button, .button {
    background: #495565;
    color: white;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: .4rem .85rem;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}
button:hover, .button:hover { background: var(--dark); }
.quiet { background: transparent; color: var(--ink); }
:focus-visible { outline: 2px solid #b74d48; outline-offset: 3px; }
fieldset:last-of-type { margin-bottom: 1rem; }
.login { display: grid; gap: .75rem; max-width: 26rem; padding: 1rem; background: var(--panel); border: 1px solid var(--line); }
.login label { font-weight: 600; }
.login input { display: block; width: 100%; border: 1px solid #a1a8b2; padding: .4rem; font: inherit; background: white; }
.login button { justify-self: start; }
.pie-chart { max-width: 38rem; margin: 0; padding: 1rem; background: var(--panel); }
.pie-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: center; }
.pie-layout svg { display: block; width: min(100%, 15rem); height: auto; margin-inline: auto; }
.pie-base { fill: #c6d0db; }
.pie-legend { margin: 0; padding: 0; list-style: none; }
.pie-legend li { display: grid; grid-template-columns: .8rem minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: .4rem 0; overflow-wrap: anywhere; }
.pie-key { height: .8rem; background: var(--slice); }
.pie-legend strong { font-variant-numeric: tabular-nums; }
.pie-chart figcaption { margin-top: .8rem; font-size: .87rem; }
.d { --slice: #b9463d; }
.z { --slice: #365f92; }
.s { --slice: #50834c; }
@media (max-width: 34rem) {
    .pie-layout { grid-template-columns: minmax(0, 1fr); }
}
.accounts-list ul { margin: 0; padding: 0; max-width: 36rem; border: 1px solid var(--line); list-style: none; }
.accounts-list li { padding: .4rem .7rem; overflow-wrap: anywhere; }
.accounts-list li:nth-child(odd) { background: var(--panel); }
[role="alert"] { color: #892e35; }
[role="status"] { color: #276147; }

/* Logowanie i konfiguracja weryfikacji dwustopniowej */
main:has(> .auth-form) { max-width: 33rem; }
.auth-intro { margin-bottom: 1.3rem; }
.auth-form {
    width: 100%;
    max-width: none;
    gap: 1rem;
    padding: clamp(1rem, 4vw, 1.6rem);
    border-radius: .65rem;
    align-content: start;
}
.auth-form input { margin-top: .35rem; padding: .65rem; border-radius: .3rem; }
.auth-form input.otp { font-size: 1.35rem; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.auth-form button { width: 100%; padding: .65rem 1rem; font-weight: 700; border-radius: .35rem; }
.auth-form a { color: #354f69; text-align: center; }
.mfa-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; max-width: 48rem; }
.mfa-setup { padding: clamp(.9rem, 4vw, 1.4rem); border: 1px solid var(--line); border-radius: .65rem; }
.mfa-setup > p { margin-top: 0; }
.qr-frame { max-width: 15rem; margin: .75rem auto; border: 1px solid var(--line); background: #fff; }
.qr-frame svg { display: block; width: 100%; height: auto; }
.mfa-manual summary { cursor: pointer; color: #354f69; }
.mfa-manual code { overflow-wrap: anywhere; }
@media (max-width: 38rem) {
    .mfa-layout { grid-template-columns: minmax(0, 1fr); }
}
:root {
    font: 15px/1.65 Roboto, system-ui, sans-serif;
    color: #454951;
    background: #f8fafc;
    --dark: #17263d;
    --ink: #202b3a;
    --accent: #d8127d;
    --accent-dark: #a30f60;
    --line: #dce3ed;
    --panel: #f0f4f8;
}

header {
    background: var(--dark);
    border-bottom: 2px solid var(--accent);
}

nav { background: transparent; }
nav a, .quiet {
    color: #fff;
    font: 600 .87rem/1.5 Roboto, system-ui, sans-serif;
    border-radius: .35rem;
}
nav a:hover, .quiet:hover { background: #2a405e; }

main { margin-top: clamp(1.45rem, 4vw, 3rem); }
h1 { font-weight: 700; letter-spacing: -.035em; }
h2 { font-weight: 600; }

button, .button { background: var(--accent); border-radius: .35rem; font-weight: 600; }
button:hover, .button:hover { background: var(--dark); }
.quiet { background: transparent; }
:focus-visible { outline-color: var(--accent-dark); }
header :focus-visible { outline-color: #ffb8df; }

fieldset:nth-of-type(odd) { background: #f2f5f9; }
fieldset label { padding: .2rem .35rem; border-radius: .3rem; }
fieldset label:has(input:checked) { background: #e5edf7; color: #17263d; }
input[type=radio] { accent-color: var(--accent-dark); }
.login, .mfa-setup { border-color: var(--line); }
.login input { border-color: #8795a8; color: var(--ink); }
.auth-form a, .mfa-manual summary { color: var(--accent-dark); }

.pie-chart {
    max-width: 44rem;
    padding: clamp(1rem, 3vw, 1.8rem);
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: #fff;
}
.pie-layout svg { width: min(100%, 16rem); }
.pie-base { fill: #e2e8f0; }
.pie-slice { fill: var(--slice); }
.pie-legend li + li { border-top: 1px solid var(--line); }
.pie-key { border-radius: 50%; }
.pie-chart figcaption { color: #54595f; }
.d { --slice: #2863ad; }
.z { --slice: #168379; }
.s { --slice: #d9962e; }

button:not(.quiet), .button {
    transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

@media (hover: hover) {
    button:not(.quiet):hover, .button:hover {
        background: var(--dark);
        box-shadow: 0 .3rem .85rem #17263d38;
        transform: translateY(-1px);
    }
}
button:not(.quiet):active, .button:active {
    background: #101d30;
    box-shadow: none;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    button:not(.quiet), .button { transition: none; }
    button:not(.quiet):hover, .button:hover { transform: none; }
}

main:has(> .auth-form[action="/logowanie"]) > h1 { text-align: center; }

.account-row, .account-actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.account-row { justify-content: space-between; }
.account-row > div:first-child { display: grid; }
.account-row span { color: #54595f; font-size: .84rem; }
.account-actions form { margin: 0; }
.account-actions a { color: #8d2941; }
.account-toggle { background: #354f69; padding: .3rem .65rem; }
.login label.delete-confirm { display: flex; align-items: flex-start; gap: .5rem; }
.login .delete-confirm input { width: auto; margin-block-start: .35rem; }
button.danger { background: #8d2941; }

.password-hint { margin: 0; color: #54595f; font-size: .88rem; }
main:has(.auth-form[action="/logowanie?haslo"]) > form:last-child { margin-top: .75rem; }

main a:not(.button) { color: #17263d; }

header nav a:not(.button), header nav .quiet {
    color: #fff;
    background: transparent;
    border-radius: 0;
    border-bottom: 2px solid transparent;
}

header nav a:not(.button):hover, header nav .quiet:hover {
    color: #fff;
    background: transparent;
    border-bottom-color: #ffffff70;
}

header nav a[aria-current="page"]:not(.button) {
    border-bottom-color: var(--accent);
}

.door-logo {
    display: block;
    width: clamp(5.5rem, 24vw, 8rem);
    height: auto;
    margin-inline-start: auto;
}
