/* ====== PORTFOLIO: strona publiczna + panel ====== */
*, *::before, *::after { box-sizing: border-box; }
:root {
    --bg: #0f1220;
    --bg2: #171b2e;
    --card: #1c2138;
    --line: #2b3150;
    --text: #e8eaf6;
    --muted: #98a0c4;
    --accent: #6c8cff;
    --accent2: #8f6cff;
    --ok: #2ecc8f;
    --err: #ff6b7a;
}
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--bg2); padding: 1px 6px; border-radius: 4px; font-size: .92em; }

/* ---------- strona publiczna ---------- */
.public .hero {
    text-align: center;
    padding: 72px 20px 40px;
    background: radial-gradient(900px 300px at 50% -50px, rgba(108,140,255,.25), transparent);
}
.public .hero h1 { margin: 0 0 10px; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.5px; }
.public .hero p { margin: 0 auto; max-width: 620px; color: var(--muted); font-size: 18px; }
.grid-wrap { max-width: 1200px; margin: 0 auto; padding: 20px 20px 60px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 34px rgba(0,0,0,.35); }
.card .shot { display: block; aspect-ratio: 1366 / 860; background: var(--bg2); overflow: hidden; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.noshot {
    display: flex; align-items: center; justify-content: center; height: 100%; min-height: 180px;
    font-size: 64px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h2 { margin: 0; font-size: 20px; }
.card-body p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.card-body .link { font-weight: 600; font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.foot { text-align: center; color: var(--muted); padding: 30px 20px 40px; border-top: 1px solid var(--line); font-size: 14px; }

/* ---------- panel ---------- */
.topbar { background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.topbar .brand { margin-right: auto; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.topbar nav a { color: var(--muted); padding: 4px 0; }
.topbar nav a.on, .topbar nav a:hover { color: var(--text); text-decoration: none; }
.topbar nav a.on { border-bottom: 2px solid var(--accent); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.wrap.narrow { max-width: 520px; }
.wrap h1 { margin: 0 0 18px; font-size: 26px; }
.wrap h2 { margin: 32px 0 12px; font-size: 19px; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: rgba(46,204,143,.12); border-color: var(--ok); color: #9af0cc; }
.flash.err { background: rgba(255,107,122,.12); border-color: var(--err); color: #ffb3bb; }
.flash.warn { background: rgba(255,200,87,.12); border-color: #ffc857; color: #ffe2a0; }

.card-form, .panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
label small { display: block; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input:not([type]), select, textarea {
    display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea { min-height: 90px; resize: vertical; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: auto; margin: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.btn, button.btn {
    display: inline-block; cursor: pointer; border: 0; border-radius: 8px;
    padding: 10px 18px; font: inherit; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn.sec { background: var(--bg2); border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: #c0394b; }
.btn.small { padding: 5px 10px; font-size: 13px; }

table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.list th, table.list td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { background: var(--bg2); color: var(--muted); font-size: 13px; font-weight: 600; }
table.list tr:last-child td { border-bottom: 0; }
table.list img { width: 120px; height: 75px; object-fit: cover; object-position: top; border-radius: 6px; display: block; background: var(--bg2); }
table.list .noimg { width: 120px; height: 75px; border-radius: 6px; background: var(--bg2); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions form { margin: 0; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--bg2); color: var(--muted); border: 1px solid var(--line); }
.badge.on { color: var(--ok); border-color: var(--ok); }
.hint { color: var(--muted); font-size: 14px; }
.preview-img { max-width: 360px; width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; margin-bottom: 12px; }
@media (max-width: 760px) {
    table.list thead { display: none; }
    table.list tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
    table.list td { display: block; border: 0; padding: 6px 14px; }
}

/* ---------- sekcje na stronie głównej: Strony www / Aplikacje webowe ---------- */
.section-title {
    display: flex; align-items: center; gap: 18px;
    margin: 0 0 26px; font-size: 14px; font-weight: 700;
    letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.section-title::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--line), transparent);
}
.section-title span { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg2); color: var(--text); }

/* charakterystyczna linia między sekcjami */
.divider {
    position: relative; height: 3px; margin: 64px 0 56px; border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent2) 80%, transparent);
    box-shadow: 0 0 18px rgba(108,140,255,.45);
}
.divider::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: var(--bg); border: 3px solid var(--accent2); border-radius: 3px;
}
.card-body h3 { margin: 0; font-size: 20px; }

/* ---------- duży podgląd screena po najechaniu na miniaturę ---------- */
.preview {
    position: fixed; left: 0; top: 0; z-index: 100;
    pointer-events: none;
    opacity: 0; transform: scale(.97);
    transition: opacity .15s ease, transform .15s ease;
    border-radius: 12px; overflow: hidden; background: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.65), 0 0 0 1px var(--line);
}
.preview.on { opacity: 1; transform: none; }
.preview img { display: block; width: 100%; height: auto; }
@media (hover: none), (pointer: coarse) { .preview { display: none; } }


/* ---------- akordeony w ustawieniach ---------- */
details.acc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
details.acc > summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 10px; user-select: none; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details.acc[open] > summary::after { transform: rotate(180deg); }
details.acc > summary:hover { background: rgba(255,255,255,.03); }
details.acc > summary small { color: var(--muted); font-weight: 400; font-size: 13px; }
details.acc > summary .ico { font-size: 18px; }
details.acc .acc-body { padding: 4px 20px 20px; border-top: 1px solid var(--line); padding-top: 18px; }

/* wybór gotowych grafik */
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.picker .opt { margin: 0; cursor: pointer; position: relative; display: block; color: var(--text); }
.picker .opt input { position: absolute; opacity: 0; pointer-events: none; }
.picker .thumb { display: block; border-radius: 8px; overflow: hidden; border: 2px solid var(--line); background: var(--bg); aspect-ratio: 16 / 9; }
.picker.hero .thumb { aspect-ratio: 16 / 5; }
.picker .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picker .thumb.none { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.picker .cap { display: block; font-size: 13px; margin-top: 6px; text-align: center; color: var(--muted); }
.picker .opt:hover .thumb { border-color: var(--muted); }
.picker .opt input:checked + .thumb { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,140,255,.35); }
.picker .opt input:checked + .thumb + .cap { color: var(--text); font-weight: 600; }
.picker .opt input:focus-visible + .thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=range] { padding: 0; }

/* ---------- baner na górze strony głównej ---------- */
.topbanner { width: 100%; background-color: var(--bg2); background-size: cover; background-position: center; border-bottom: 1px solid var(--line); height: 260px; }
.topbanner.s { height: 180px; }
.topbanner.l { height: 380px; }
@media (max-width: 700px) { .topbanner { height: 160px; } .topbanner.s { height: 120px; } .topbanner.l { height: 220px; } }