/* ============================================================
   AffiWave - Page & Layout styles (marketing + app shell)
   ============================================================ */

/* ===================================================================
   BRAND / LOGO
   =================================================================== */
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.32rem; letter-spacing: -0.03em; color: var(--text-strong); }
.logo svg, .logo img { width: 32px; height: 32px; }
.logo.on-ink { color: #fff; }
.logo-sm { font-size: 1.12rem; }
.logo-sm svg, .logo-sm img { width: 28px; height: 28px; }

/* ===================================================================
   MARKETING - Navbar
   =================================================================== */
.mkt-nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.mkt-nav-inner { display: flex; align-items: center; gap: var(--s-7); height: 70px; }
.mkt-links { display: flex; align-items: center; gap: 2px; margin-left: var(--s-4); }
.mkt-links a { padding: 9px 14px; font-size: var(--t-sm); font-weight: 600; color: var(--text-muted); border-radius: var(--r-sm); transition: color var(--dur), background var(--dur); }
.mkt-links a:hover { color: var(--text-strong); background: var(--n-50); }
.mkt-nav-cta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-toggle { display: none; background: none; border: none; padding: 8px; color: var(--text-strong); }
.mobile-menu { display: none; }

@media (max-width: 960px) {
  .mkt-links, .mkt-nav-cta .btn:not(.btn-primary) { display: none; }
  .nav-toggle { display: block; }
  .mobile-menu { display: none; position: fixed; inset: 70px 0 auto 0; background: #fff; border-bottom: 1px solid var(--border); padding: var(--s-5) var(--s-6); flex-direction: column; gap: 4px; box-shadow: var(--sh-lg); z-index: 99; }
  .mobile-menu.open { display: flex; }
  .mobile-menu a { padding: 13px 12px; font-weight: 600; color: var(--text); border-radius: var(--r-sm); }
  .mobile-menu a:hover { background: var(--n-50); }
  .mobile-menu .btn { margin-top: 10px; }
}

/* ===================================================================
   MARKETING - Sections / hero
   =================================================================== */
.section { padding: var(--s-12) 0; }
.section-sm { padding: var(--s-11) 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-600); margin-bottom: 16px; }
.eyebrow.on-ink { color: var(--mint); }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.section-head { max-width: 680px; margin-bottom: var(--s-9); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: var(--t-h2); margin-bottom: 16px; }
.section-head p { font-size: var(--t-lg); color: var(--text-muted); line-height: 1.6; }
.lead { font-size: var(--t-lg); color: var(--text-muted); line-height: 1.65; }

.hero { position: relative; padding: var(--s-11) 0 var(--s-10); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1.15fr; gap: var(--s-9); align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: var(--t-display); letter-spacing: -0.035em; margin-bottom: var(--s-5); }
.hero .lead { font-size: 1.22rem; max-width: 520px; margin-bottom: var(--s-6); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: var(--s-5); }
.hero-note { font-size: var(--t-sm); color: var(--text-subtle); display: flex; align-items: center; gap: 8px; }
.hero-logos { display: flex; align-items: center; gap: var(--s-6); margin-top: var(--s-8); opacity: 0.75; flex-wrap: wrap; }
.hero-logos span { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text-subtle); letter-spacing: -0.01em; }

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .hero .lead { max-width: none; }
  .section { padding: var(--s-10) 0; }
}

/* gradient mesh background */
.mesh { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.mesh-1 { width: 520px; height: 520px; background: radial-gradient(circle, var(--brand-300), transparent 70%); top: -180px; right: -120px; }
.mesh-2 { width: 420px; height: 420px; background: radial-gradient(circle, var(--blue-300), transparent 70%); top: 120px; left: -160px; opacity: 0.35; }

/* ===================================================================
   Feature / who-for grids
   =================================================================== */
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.feature { padding: var(--s-6); border-radius: var(--r-lg); background: var(--bg-surface); border: 1px solid var(--border); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur); }
.feature:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--border-strong); }
.feature .f-ico { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; margin-bottom: var(--s-4); }
.feature .f-ico svg { width: 22px; height: 22px; }
.feature h3 { font-size: var(--t-h4); margin-bottom: 8px; }
.feature p { font-size: var(--t-sm); color: var(--text-muted); line-height: 1.6; }
.f-ico.blue { background: var(--blue-50); color: var(--blue-600); }
.f-ico.amber { background: var(--warning-bg); color: #9A6206; }
.f-ico.violet { background: var(--review-bg); color: var(--violet-600); }

.whofor { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--r-md); background: var(--bg-surface); border: 1px solid var(--border); font-weight: 600; color: var(--text-strong); font-size: var(--t-sm); transition: all var(--dur) var(--ease); }
.whofor:hover { border-color: var(--brand-300); background: var(--brand-50); }
.whofor .wf-ico { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--ink-900); color: #fff; display: grid; place-items: center; flex: none; }
.whofor .wf-ico svg { width: 17px; height: 17px; }

/* steps */
.steps { display: grid; gap: var(--s-4); }
.step { display: flex; gap: 18px; padding: var(--s-5); border-radius: var(--r-lg); background: var(--bg-surface); border: 1px solid var(--border); }
.step .step-n { counter-increment: step; flex: none; width: 38px; height: 38px; border-radius: var(--r-md); background: var(--ink-900); color: #fff; font-family: var(--font-display); font-weight: 700; display: grid; place-items: center; }
.step .step-n::before { content: counter(step); }
.step h4 { font-size: var(--t-lg); margin-bottom: 4px; }
.step p { font-size: var(--t-sm); color: var(--text-muted); }

/* ===================================================================
   Dark band / CTA
   =================================================================== */
.band-ink { background: var(--ink-900); color: var(--text-onink); position: relative; overflow: hidden; }
.band-ink h2, .band-ink h3 { color: #fff; }
.band-ink .lead { color: var(--text-oninkmuted); }
.cta-band { text-align: center; padding: var(--s-12) 0; position: relative; z-index: 1; }
.cta-band h2 { font-size: var(--t-h1); margin-bottom: 16px; }
.cta-band .hero-cta { justify-content: center; }

/* ===================================================================
   Pricing
   =================================================================== */
.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); align-items: start; }
@media (max-width: 1080px) { .price-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .price-grid { grid-template-columns: 1fr; } }
.price-card { padding: var(--s-6); border-radius: var(--r-xl); background: var(--bg-surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s-4); }
.price-card.featured { border: 2px solid var(--brand-500); box-shadow: var(--sh-lg); position: relative; }
.price-card.featured::before { content: "Najpopularniejszy"; position: absolute; top: -12px; left: var(--s-6); background: var(--brand-500); color: #fff; font-size: var(--t-2xs); font-weight: 700; padding: 4px 11px; border-radius: var(--r-full); letter-spacing: 0.02em; }
.price-name { font-family: var(--font-display); font-weight: 700; font-size: var(--t-h4); color: var(--text-strong); }
.price-amt { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; color: var(--text-strong); letter-spacing: -0.02em; }
.price-amt small { font-size: var(--t-sm); font-weight: 600; color: var(--text-subtle); }
.price-feats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; font-size: var(--t-sm); color: var(--text); }
.price-feats li { display: flex; gap: 9px; align-items: flex-start; }
.price-feats svg { width: 17px; height: 17px; color: var(--brand-500); flex: none; margin-top: 2px; }

/* ===================================================================
   Footer
   =================================================================== */
.footer { background: var(--ink-900); color: var(--text-oninkmuted); padding: var(--s-10) 0 var(--s-7); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: var(--s-7); margin-bottom: var(--s-8); }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); } }
.footer h5 { color: #fff; font-family: var(--font-display); font-size: var(--t-sm); margin-bottom: 16px; letter-spacing: 0.01em; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { font-size: var(--t-sm); color: var(--text-oninkmuted); transition: color var(--dur); }
.footer a:hover { color: #fff; }
.footer-brand p { font-size: var(--t-sm); color: var(--text-oninkmuted); max-width: 300px; margin-top: 14px; line-height: 1.6; }
.footer-bottom { border-top: 1px solid var(--border-ink); padding-top: var(--s-5); display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: var(--t-xs); flex-wrap: wrap; }
.footer-credit a { text-decoration: underline; }

/* ===================================================================
   APP SHELL - sidebar + topbar
   =================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; background: var(--bg-page); }
.sidebar { background: var(--ink-900); color: var(--text-oninkmuted); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-top { padding: var(--s-5) var(--s-5) var(--s-4); }
.context-switch { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); background: rgba(255,255,255,0.05); border: 1px solid var(--border-ink); margin-top: var(--s-4); cursor: pointer; transition: background var(--dur); }
.context-switch:hover { background: rgba(255,255,255,0.08); }
.context-switch .cs-ico { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--brand-500); display: grid; place-items: center; flex: none; font-family: var(--font-display); font-weight: 700; color: #fff; font-size: var(--t-xs); }
.context-switch .cs-name { color: #fff; font-weight: 600; font-size: var(--t-sm); line-height: 1.2; }
.context-switch .cs-role { font-size: var(--t-2xs); color: var(--text-oninkmuted); }

.nav-group { padding: var(--s-3) var(--s-4); }
.nav-group-label { font-size: var(--t-2xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #5C6B82; padding: 8px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm); font-size: var(--t-sm); font-weight: 600; color: var(--text-oninkmuted); transition: all var(--dur) var(--ease); position: relative; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(14,163,122,0.16); color: #fff; }
.nav-item.active svg { color: var(--mint); opacity: 1; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--mint); }
.nav-badge { margin-left: auto; font-size: var(--t-2xs); font-weight: 700; padding: 1px 7px; border-radius: var(--r-full); background: var(--brand-500); color: #fff; }
.nav-badge.amber { background: var(--warning); }
.nav-badge.red { background: var(--danger); }
.sidebar-foot { margin-top: auto; padding: var(--s-4); border-top: 1px solid var(--border-ink); }

.app-main { display: flex; flex-direction: column; min-width: 0; grid-column: 2; grid-row: 1; }
.scrim { display: none; }
.topbar { height: var(--topbar-h); background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--s-4); padding: 0 var(--s-7); position: sticky; top: 0; z-index: 40; }
.topbar-search { display: flex; align-items: center; gap: 9px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px 13px; width: 320px; max-width: 40vw; color: var(--text-subtle); font-size: var(--t-sm); }
.topbar-search svg { width: 16px; height: 16px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-surface); display: grid; place-items: center; color: var(--text-muted); position: relative; transition: all var(--dur); }
.icon-btn:hover { color: var(--text-strong); border-color: var(--n-300); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .ping { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg-surface); }

.page { padding: var(--s-7); max-width: 1500px; width: 100%; margin-inline: auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-5); margin-bottom: var(--s-6); flex-wrap: wrap; }
.page-head h1 { font-size: var(--t-h2); margin-bottom: 6px; }
.page-head .sub { color: var(--text-muted); font-size: var(--t-sm); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); margin-bottom: var(--s-5); }
@media (max-width: 1200px) { .kpi-row { grid-template-columns: repeat(2,1fr); } }

.app-grid { display: grid; gap: var(--s-5); }
/* Two-column dashboard grids: let children shrink below content (prevents
   code-block / long-content overflow) and collapse to one column on tablet. */
.dash-grid > * { min-width: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr !important; } }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--s-5); }
.toolbar .spacer { flex: 1; }

/* mobile app shell */
.app-mobile-bar { display: none; }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 120; transform: translateX(-100%); transition: transform var(--dur) var(--ease); }
  .sidebar.open { transform: none; }
  .app-mobile-bar { display: flex; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(10,16,32,0.5); z-index: 110; opacity: 0; pointer-events: none; transition: opacity var(--dur); }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 var(--s-5); }
  .topbar-search { display: none; }
  .page { padding: var(--s-5); }
}

/* ===================================================================
   AUTH split layout
   =================================================================== */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-form-side { display: flex; flex-direction: column; padding: var(--s-7); overflow-y: auto; }
.auth-form-wrap { width: 100%; max-width: 420px; margin: auto; padding: var(--s-7) 0; }
.auth-visual { background: var(--ink-900); color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: var(--s-10); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-visual { display: none; } }
.auth h1 { font-size: var(--t-h2); margin-bottom: 8px; }
.auth-sub { color: var(--text-muted); margin-bottom: var(--s-7); }
.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--text-subtle); font-size: var(--t-xs); margin: var(--s-5) 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-foot { text-align: center; font-size: var(--t-sm); color: var(--text-muted); margin-top: var(--s-6); }
.auth-foot a { color: var(--brand-600); font-weight: 600; }

/* small helpers */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-2{margin-top:8px} .mt-4{margin-top:16px} .mt-5{margin-top:20px} .mt-6{margin-top:24px}
.mb-2{margin-bottom:8px} .mb-4{margin-bottom:16px} .mb-5{margin-bottom:20px} .mb-6{margin-bottom:24px}
.text-muted { color: var(--text-muted); } .text-subtle { color: var(--text-subtle); }
.text-sm { font-size: var(--t-sm); } .text-xs { font-size: var(--t-xs); }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-brand { color: var(--brand-600); }
.flex-1 { flex: 1; }
