/* Pixi – wspólny wygląd strony i panelu.
   Kolory pochodzą z logo: cztery „piksele” (błękit, fiolet, róż, słońce) na atramentowym granacie. */

@font-face { font-family: "Poppins"; src: url("/static/fonts/Poppins-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/Poppins-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/static/fonts/DMSans.woff") format("woff"); font-weight: 300 800; font-display: swap; }

:root {
  --ink: #17112E;          /* tekst, tło ekranu urządzenia */
  --ink-2: #2A2150;
  --paper: #F3F1FA;        /* tło panelu */
  --card: #FFFFFF;
  --line: #E2DDF0;
  --muted: #6B6585;
  --cyan: #2FD3FF;
  --violet: #7B5CFF;       /* główne działania */
  --violet-dark: #5B3FE0;
  --pink: #FF5FA8;
  --sun: #FFC23D;
  --gold: #E8B04A;         /* Kamil Senger Services */
  --ok: #18A86B;
  --bad: #E0405E;
  --r-lg: 22px;
  --r-sm: 11px;
  --display: "Poppins", "Avenir Next", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--body); color: var(--ink); background: var(--paper); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 4vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; font-weight: 500; }
p { margin: 0 0 12px; max-width: 68ch; }
a { color: var(--violet-dark); }
.hidden { display: none !important; }
.muted, .meta { color: var(--muted); }
.meta { font-size: 14px; }
small { font-size: 13px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

/* --- przyciski i pola ------------------------------------------------------------------- */
button, .btn {
  font: 600 15px/1 var(--body); border: 0; border-radius: var(--r-sm); padding: 12px 18px; cursor: pointer;
  background: var(--violet); color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s;
}
button:hover, .btn:hover { background: var(--violet-dark); }
button:disabled { opacity: .45; cursor: default; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
button.ghost:hover, .btn.ghost:hover { background: #fff; box-shadow: inset 0 0 0 1.5px #C9C1E6; }
button.small { padding: 8px 12px; font-size: 14px; }
button.danger { background: var(--bad); }
button.link { background: none; color: var(--violet-dark); padding: 0; font-weight: 600; text-decoration: underline; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
label.inline { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 10px 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; font: 400 16px/1.4 var(--body); color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px #7B5CFF26; }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--violet); }
input[type=range] { width: 100%; accent-color: var(--violet); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > input, .row > select { flex: 1 1 200px; width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.err:empty, .ok:empty { min-height: 0; margin: 0; }
.err { color: var(--bad); font-weight: 600; min-height: 1.2em; margin-top: 8px; font-size: 14px; }
.ok { color: var(--ok); font-weight: 600; min-height: 1.2em; margin-top: 8px; font-size: 14px; }
.note { background: #FFF6DE; border-radius: var(--r-sm); padding: 10px 13px; font-size: 14px; margin: 10px 0; }
.code { font: 600 15px/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: var(--paper); border-radius: 8px;
        padding: 8px 10px; word-break: break-all; user-select: all; }

/* przełącznik */
input.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 30px; background: #D7D2E8;
          position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
                 background: #fff; box-shadow: 0 1px 3px #17112E40; transition: transform .2s; }
input.switch:checked { background: var(--violet); }
input.switch:checked::after { transform: translateX(20px); }

/* piksel – znak kategorii (cztery kolory z logo) */
.px { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.px.c { background: var(--cyan); } .px.v { background: var(--violet); } .px.p { background: var(--pink); } .px.s { background: var(--sun); }

/* --- okrągły ekran urządzenia (element rozpoznawczy) --------------------------------------- */
.device {
  --size: 300px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none; position: relative;
  background: radial-gradient(circle at 50% 35%, #231A45 0%, #0E0920 70%);
  box-shadow: 0 0 0 10px #2A2150, 0 0 0 11px #3A2F66, 0 30px 60px -20px #17112E99;
  color: #fff; display: grid; place-items: center; text-align: center; overflow: hidden;
}
.device .scr { width: 76%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; justify-items: center; }
.device .clock { font: 700 calc(var(--size) * .2)/1 var(--display); letter-spacing: -0.02em; }
.device .line { font-size: calc(var(--size) * .052); color: #C9C3E6; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device .chip { display: inline-flex; gap: 8px; align-items: center; background: #ffffff14; border-radius: 30px;
                padding: 6px 12px; font-size: calc(var(--size) * .048); max-width: 100%; }
.device .chip { min-width: 0; }
.device .chip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.device.alarm { background: radial-gradient(circle at 50% 40%, #5A1530 0%, #1A0710 75%); }
.device .big { font: 700 calc(var(--size) * .085)/1.15 var(--display); }

/* ============================ STRONA STARTOWA ============================ */
.site { background: var(--paper); }
.site header.top { background: var(--ink); color: #fff; }
.site .wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.site nav.bar { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.site nav.bar img { height: 38px; display: block; }
.site nav.bar .links { display: flex; gap: 10px; }
.site nav.bar .btn.ghost { color: #fff; box-shadow: inset 0 0 0 1.5px #ffffff40; }
.site nav.bar .btn.ghost:hover { background: #ffffff10; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 48px 0 96px; }
.hero h1 { font-size: clamp(38px, 5.6vw, 68px); letter-spacing: -0.025em; }
.hero p.lead { font-size: 20px; color: #CFC9EA; margin: 22px 0 30px; max-width: 34ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .cta .btn { padding: 15px 22px; font-size: 16px; }
.hero .stage { display: grid; place-items: center; position: relative; }
.hero .device { --size: min(400px, 78vw); }
.hero .caption { color: #CFC9EA; font-size: 14px; margin-top: 30px; text-align: center; min-height: 1.5em; }
.hero .device .scr > * { transition: opacity .35s; }
.hero .device.swap .scr > * { opacity: 0; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 16px; } .hero .stage { order: -1; } }

.site section.band { padding: 80px 0; }
.site section.band h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 14px; }
.site section.band .intro { font-size: 18px; color: var(--muted); margin-bottom: 40px; }
.abilities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 56px; }
.abilities div { display: grid; grid-template-columns: 22px 1fr; gap: 4px 14px; }
.abilities .px { width: 16px; height: 16px; border-radius: 4px; margin-top: 5px; grid-row: span 2; }
.abilities h3 { font-size: 19px; font-weight: 700; }
.abilities p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .abilities { grid-template-columns: 1fr; } }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; padding: 0; list-style: none; }
.steps li { background: var(--card); border-radius: var(--r-lg); padding: 26px; counter-increment: s; }
.steps li::before { content: counter(s); font: 700 44px/1 var(--display); color: var(--violet); display: block; margin-bottom: 14px; }
.steps h3 { font-weight: 700; font-size: 19px; margin-bottom: 6px; }
.steps p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.band.dark { background: var(--ink); color: #fff; }
.band.dark .intro, .band.dark p { color: #CFC9EA; }
.trust { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.trust ul { margin: 0; padding-left: 20px; color: #CFC9EA; }
.trust li { margin-bottom: 10px; }
@media (max-width: 760px) { .trust { grid-template-columns: 1fr; } }
footer.site-foot { background: #0F0A22; color: #A9A3C6; padding: 46px 0; }
footer.site-foot .wrap { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
footer.site-foot .kss { display: flex; align-items: center; gap: 16px; }
footer.site-foot .kss img.mark { height: 54px; }
footer.site-foot .kss img.word { height: 40px; }

/* ============================ LOGOWANIE ============================ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .side { background: var(--ink); color: #fff; display: grid; place-items: center; padding: 40px; gap: 26px; align-content: center; }
.auth .side img { height: 54px; }
.auth .side .device { --size: min(320px, 70vw); }
.auth .side p { color: #CFC9EA; text-align: center; max-width: 30ch; }
.auth .form { display: grid; place-items: center; padding: 40px 24px; }
.auth form { width: 100%; max-width: 380px; }
.auth form h1 { margin-bottom: 6px; }
.auth form button[type=submit] { width: 100%; justify-content: center; margin-top: 18px; padding: 14px; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } .auth .side { padding: 28px 20px; } .auth .side .device { display: none; } }

/* ============================ PANEL ============================ */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #fff; padding: 26px 16px; position: sticky; top: 0; height: 100vh;
           display: flex; flex-direction: column; gap: 22px; align-self: start; }
.sidebar .brand img { height: 40px; display: block; margin-left: 10px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav button { background: none; color: #CFC9EA; justify-content: flex-start; padding: 11px 12px; font-weight: 500; gap: 12px; }
.sidebar nav button:hover { background: #ffffff0d; color: #fff; }
.sidebar nav button[aria-current=page] { background: #ffffff16; color: #fff; font-weight: 700; }
.sidebar .who { margin-top: auto; font-size: 14px; color: #A9A3C6; padding: 0 10px; display: grid; gap: 10px; }
.sidebar .who button { color: #fff; box-shadow: inset 0 0 0 1.5px #ffffff30; }
.sidebar .made { display: flex; align-items: center; gap: 10px; padding: 0 10px; opacity: .85; }
.sidebar .made img { height: 26px; }
.sidebar .made span { font-size: 12px; line-height: 1.3; color: #A9A3C6; }
main.content { padding: 34px clamp(18px, 4vw, 48px) 80px; max-width: 980px; width: 100%; }
main.content > section { display: none; }
main.content > section.active { display: block; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.pagehead p { margin: 8px 0 0; color: var(--muted); }
.panel { background: var(--card); border-radius: var(--r-lg); padding: 24px; margin-bottom: 18px; }
.panel > h2 { margin-bottom: 6px; }
.panel > h2 + p { color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; background: var(--card);
          border-radius: 30px; padding: 8px 14px; }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: #B9B3D1; }
.status .dot.on { background: var(--ok); box-shadow: 0 0 0 4px #18A86B22; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; padding: 12px; gap: 10px; z-index: 5; flex-direction: row; align-items: center; }
  .sidebar .brand img { height: 30px; margin: 0; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .sidebar nav button { white-space: nowrap; padding: 9px 11px; }
  .sidebar nav button .px { display: none; }
  .sidebar .who, .sidebar .made { display: none; }
  main.content { padding-top: 22px; }
}

/* pulpit */
.home-top { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; margin-bottom: 18px; }
.home-top .device { --size: 260px; }
@media (max-width: 700px) { .home-top { grid-template-columns: 1fr; justify-items: center; } }
.checklist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 13px; color: #fff; }
.checklist li.done .tick { background: var(--ok); border-color: var(--ok); }
.checklist li.done .txt { color: var(--muted); text-decoration: line-through; }
.checklist .txt { flex: 1; }
.quick { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chat { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.msg { padding: 10px 14px; border-radius: 16px; max-width: 80%; }
.msg.me { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--paper); border-bottom-left-radius: 5px; }
.list { list-style: none; padding: 0; margin: 8px 0 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .txt { flex: 1; min-width: 0; }
.list .txt b { font-weight: 600; }
.list .empty { color: var(--muted); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.cols .panel { margin-bottom: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.tile { background: var(--paper); color: var(--ink); border-radius: 16px; padding: 14px; text-align: left; display: grid; gap: 4px;
        justify-items: start; font-weight: 600; }
.tile:hover { background: #E9E5F7; }
.tile.on { background: var(--sun); }
.tile .meta { font-weight: 400; color: inherit; opacity: .75; }

/* dom */
.area { margin-top: 22px; }
.area h3 { font-weight: 700; margin-bottom: 4px; }
.ent { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ent .state { font-size: 14px; color: var(--muted); }
.ent .acts { display: flex; gap: 6px; align-items: center; }
.ent .acts label { margin: 0; font-weight: 500; font-size: 13px; display: flex; gap: 6px; align-items: center; }
@media (max-width: 640px) { .ent { grid-template-columns: 1fr; } }

/* dodatki */
.addon { border-top: 1px solid var(--line); padding: 20px 0; }
.addon:first-of-type { border-top: 0; }
.addon .head { display: flex; align-items: center; gap: 14px; }
.addon .head .txt { flex: 1; }
.addon .head h3 { font-weight: 700; }
.addon .body { margin: 14px 0 0 0; }
.addon details { margin-top: 10px; }
.addon summary { cursor: pointer; font-weight: 600; color: var(--violet-dark); }
.addon ol { padding-left: 22px; margin: 10px 0; }
.addon ol li { margin-bottom: 6px; }
.tabs { display: inline-flex; background: var(--paper); border-radius: 12px; padding: 4px; gap: 4px; margin: 10px 0; }
.tabs button { background: none; color: var(--ink); padding: 8px 14px; font-weight: 600; }
.tabs button[aria-selected=true] { background: #fff; box-shadow: 0 1px 3px #17112E1F; }

/* dźwięki */
.snd { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.snd:last-child { border-bottom: 0; }
.snd .name { font-weight: 600; }
.snd .vol { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.snd .vol span { width: 3ch; text-align: right; }
@media (max-width: 700px) { .snd { grid-template-columns: 1fr 1fr; } .snd .name { grid-column: 1 / -1; } }

/* poczta */
.box { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.box .txt { flex: 1; min-width: 0; }
.wizard { background: var(--paper); border-radius: var(--r-lg); padding: 20px; margin-top: 14px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.guide { margin-top: 16px; }
.guide .code { margin: 6px 0 10px; }
.ent .temp { width: 84px; flex: none; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 14px 0 6px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.vol { display: flex; align-items: center; gap: 10px; }
.vol span { width: 4ch; text-align: right; color: var(--muted); font-size: 14px; }
input[type=time] { max-width: 150px; font: 400 16px/1.4 var(--body); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; background: #fff; color: var(--ink); }
#help summary { font-size: 17px; }
