/* VesterHub — My Hub portal (Etap 2a)
   Paleta VesterMobile (decyzja Tomka 13.09: spójność stylu):
   --bg #171420, --bg2 #221e2e, akcent #7c5cbf, tekst #e8e2d4, kafelki gradient 150deg */

:root {
    --bg: #171420;
    --bg2: #0d0b14;
    --accent: #5631b5; /* nasz śliwkowy (Tomek 03.11) */
    --accent2: #9a7fe0;
    --text: #e8e2d4;
    --muted: #8a849c;
    --border: #3a2d5e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    min-height: 100vh;
    display: block; /* kasuje flex z css/style.css (landing) — inaczej kroi .portal (header nie na 100%) */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #0d0b14; /* 23.09 Tomek: hub BG */
    color: var(--text);
}

/* ===== Portal (SPA shell) ===== */
.portal { display: flex; flex-direction: column; min-height: 100vh; }

.portal-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    position: relative;
    background: #0d0b14; /* FINAL kolory Tomka 16.09 (po wyłączeniu nocnego filtra Windows) */
    border-bottom: 2px solid #9a7fe0;
}

/* mobile: nav + user w hamburgerze (Tomek 03.11 — nie ściska title) */
.portal-menu { display: flex; align-items: center; gap: 1.5rem; flex: 1; }
.portal-burger { display: none; }

@media (max-width: 860px) {
    .portal-burger { display: block; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 6px 10px; font-size: 1.2rem; cursor: pointer; }
    .portal-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
        flex-direction: column; align-items: stretch; gap: .9rem;
        background: #0d0b14; border-bottom: 2px solid #9a7fe0; padding: 14px 22px; }
    .portal-menu.open { display: flex; }
    .portal-nav { flex-direction: column; }
    .portal-nav a { padding: .6rem .9rem; }
    .portal-links { flex-direction: column; }
}

.portal-brand { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; }
.portal-brand span { color: var(--accent); } /* akcent motywu #7c5cbf (23.09) */
.portal-brand svg { width: 26px; height: 26px; display: inline-block; vertical-align: -4px; margin-right: 8px; }

.portal-links { display: flex; gap: .25rem; }
.portal-links a {
    color: var(--muted);
    text-decoration: none;
    padding: .5rem .9rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: .95rem;
}
.portal-links a:hover { color: var(--text); background: rgba(124,92,191,.18); }

.portal-nav { display: flex; gap: .25rem; flex: 1; }
.portal-nav a {
    color: var(--muted);
    text-decoration: none;
    padding: .5rem .9rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: .95rem;
}
.portal-nav a.active { background: #5631b5; color: #f3f3f3; } /* FINAL Tomka 16.09 */

.portal-user { display: flex; align-items: center; gap: .75rem; font-weight: 600; }

.portal-content { flex: 1; padding: 1.5rem; width: 100%; max-width: 1100px; margin: 0 auto; }

/* footer — jak theme.css (myhub nie laduje theme.css) */
footer {
    position: relative; z-index: 1;
    border-top: 1px solid var(--border); padding: 34px 22px; text-align: center;
    color: var(--muted); font-size: .88rem;
}
footer a { color: var(--accent2); }
footer a:hover { color: var(--warm); }

/* ===== Kafelki (styl VesterMobile) ===== */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }

.tile {
    display: block;
    padding: 1.2rem;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(124,92,191,.28), rgba(13,11,20,.92) 42%, rgba(13,11,20,.62)); /* ciemny + śliwkowy odcień (03.11) */
    color: var(--text);
    cursor: pointer;
    text-align: left;
    width: 100%;
    border: 1px solid var(--border);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), border-color .25s, background .25s;
}
.tile:hover { transform: translateY(-4px); border-color: var(--accent); filter: brightness(1.12); }
.tile:active { transform: scale(.98); filter: brightness(1.1); }
.tile-big { font-size: 1.4rem; font-weight: 700; }
.tile-small { font-size: .85rem; opacity: .8; margin-top: .25rem; }

.card {
    background: linear-gradient(160deg, rgba(13,11,20,.92), rgba(13,11,20,.62)); /* jak agent (03.11) */
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.card h2 { font-size: 1.2rem; margin-bottom: .75rem; }
.card .empty { color: var(--muted); font-size: .95rem; }

/* ===== Przyciski ===== */
.btn-primary {
    background: var(--accent);
    border: 2px solid var(--accent2);
    color: var(--bg);
    font-weight: 700;
    padding: .7rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-size: .95rem;
}
.btn-primary:disabled { opacity: .55; cursor: wait; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: .45rem .9rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: .9rem;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent2); }

/* ===== Auth (login/register) ===== */
.auth-card {
    max-width: 380px;
    margin: 8vh auto;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}
.auth-card h1 { font-size: 1.8rem; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); margin: .4rem 0 1.4rem; }
.auth-card input {
    width: 100%;
    margin-bottom: .8rem;
    padding: .7rem .9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: .95rem;
}
.auth-card input:focus { outline: none; border-color: var(--accent2); }
.auth-err { color: #e57373; min-height: 1.2em; margin-top: .6rem; font-size: .9rem; }
.auth-alt { margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.auth-alt a { color: var(--accent2); }

/* ===== Modal overlay (przyszłość: parowanie 2b) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 16, .75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    min-width: 300px;
    max-width: 90vw;
    text-align: center;
}

.loading { color: var(--muted); padding: 2rem; text-align: center; }

/* ===== Etap 2b: parowanie (QR + code) i listy ===== */
.qr { width: 220px; height: 220px; margin: 1rem auto .5rem; display: block; background: #fff; padding: 8px; border-radius: 12px; }
.pair-code { font-size: 1.6rem; font-weight: 700; letter-spacing: .3em; color: var(--accent2); margin-top: .5rem; }
.muted { color: var(--muted); margin-top: .4rem; font-size: .95rem; }
.small { font-size: .8rem; }
.list-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.list-table th { text-align: left; color: var(--muted); padding: .4rem .6rem; border-bottom: 1px solid var(--border); }
.list-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.dot-on { color: #6fbf73; font-weight: 700; }
.dot-off { color: #666; }

/* Etap 2b dopracowanie: modal spacing + link FAQ */
.modal-box .muted a { color: var(--accent2); }
.faq-wrap { max-width: 700px; margin: 3rem auto; padding: 0 1rem; }
.faq-wrap h1 { font-size: 1.5rem; margin-bottom: 1.2rem; }
.faq-wrap h2 { font-size: 1.05rem; margin: 1.1rem 0 .35rem; color: var(--accent2); }
.faq-wrap code { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .1rem .4rem; font-size: .9rem; }

/* Etap 2b-UI: kafelki agentów + modal akcji */
.agent-tile { cursor: pointer; }
.tile-label .dot-on, .tile-label .dot-off { margin-right: .2rem; }
.modal-actions { display: flex; flex-direction: column; gap: .5rem; margin: .8rem 0; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.modal-actions-row { flex-direction: row; align-items: center; gap: .8rem; }
.modal-hint { margin-top: 0; font-size: .85rem; }
.btn-secondary { background: var(--bg2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: .6rem 1rem; cursor: pointer; font-weight: 600; }
.btn-secondary:hover { border-color: var(--accent2); }
.btn-danger {
    background: #0d0b14;
    border: 1px solid #6b0210;
    color: #930816;
    border-radius: 8px;
    padding: .6rem 1rem;
    cursor: pointer;
}
.btn-danger:hover { border-color: #930816; color: #b0101f; }

/* ---- Devices (F1): kafelki device, QR, checkboxy udostępnień ---- */
.device-tile { cursor: default; }
.tile-actions { margin-top: .6rem; display: flex; gap: .4rem; }
.btn-sm { padding: .3rem .7rem; font-size: .85rem; }
.dot-qr { color: #d9a94f; font-weight: 700; }
.dot-err { color: #c96a6a; font-weight: 700; }
.tile-label .dot-qr, .tile-label .dot-err { margin-right: .2rem; }
.check-row { display: block; padding: .35rem 0; cursor: pointer; }
.check-row input { margin-right: .5rem; }
.check-row.sub { padding-left: 1.6rem; font-size: .92em; }
.share-table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.share-table th { text-align: left; font-size: .85em; opacity: .7; padding: .25rem .5rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.share-table td { padding: .4rem .5rem; border-bottom: 1px solid rgba(255,255,255,.05); }
.share-table th.c, .share-table td.c { text-align: center; width: 5.5rem; }
.agent-tile { position: relative; }
.agent-menu { position: absolute; top: .35rem; right: .5rem; background: none; border: none; color: rgba(255,255,255,.55); font-size: 1.05rem; line-height: 1; cursor: pointer; padding: .2rem .45rem; }
.agent-menu:hover { color: var(--accent); }
.nick-row { display: flex; align-items: center; gap: .5rem; margin: .4rem 0 .8rem; }
.nick-row label { opacity: .75; font-size: .92em; white-space: nowrap; }
.nick-row input {
    flex: 1;
    padding: .7rem 1.2rem;
    border-radius: 10px;
    font-size: .95rem;
}
.modal-actions button:disabled { opacity: .45; cursor: not-allowed; }
/* 27.09 — Feedback agentów: wpisy idą do tabeli feedback (POST /v1/feedback).
   Konsument = przyszły agent huba (Mother Agent) — GUI dla ludzi NIE pokazuje feedbacku. */

/* ==== BACKGROUND (bloby śliwkowe + gwiazdki — wspólny wariant 2, 03.10.2026) ==== */
.blob{position:fixed;border-radius:50%;filter:blur(90px);opacity:.55;z-index:-2;pointer-events:none}
.blob-1{width:46vw;height:46vw;min-width:420px;min-height:420px;left:-12vw;top:-10vw;background:radial-gradient(circle at 35% 35%,#7c5cbf 0%,#5631b5 45%,transparent 72%);animation:drift1 240s steps(120) infinite alternate}
.blob-2{width:38vw;height:38vw;min-width:360px;min-height:360px;right:-10vw;top:26vh;background:radial-gradient(circle at 60% 40%,#9a7fe0 0%,#4a2d7a 50%,transparent 74%);animation:drift2 300s steps(150) infinite alternate}
.blob-3{width:30vw;height:30vw;min-width:300px;min-height:300px;left:28vw;bottom:-12vw;background:radial-gradient(circle at 50% 50%,#ff8c42 0%,#7c5cbf 45%,transparent 70%);opacity:.28;animation:drift3 270s steps(135) infinite alternate}
@keyframes drift1{from{transform:translate(0,0) scale(1)}to{transform:translate(9vw,7vh) scale(1.12)}}
@keyframes drift2{from{transform:translate(0,0) scale(1.05)}to{transform:translate(-8vw,-6vh) scale(.92)}}
@keyframes drift3{from{transform:translate(0,0) scale(.95)}to{transform:translate(6vw,-8vh) scale(1.1)}}
#stars{position:fixed;inset:0;z-index:-1;pointer-events:none}
/* ==== REDUCED MOTION ==== */
@media(prefers-reduced-motion:reduce){
  *{animation:none!important; transition:none!important; scroll-behavior:auto!important}
  .blob{display:none}
  #stars{display:none}
}
