/* SnapClick Studio - system wizualny v2 (jasny, przestronny, nawigacja górna). */

/* Fonty serwowane lokalnie (wariantowe, licencja SIL OFL 1.1 - fonts/OFL.txt). */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-wght-normal.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;
}
@font-face {
  font-family: 'Lexend'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/lexend-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lexend'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/lexend-latin-wght-normal.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 {
  --bg: #F8FAFC;
  --bg-tint: #EEF2FF;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-2: #334155;
  --muted: #64748B;

  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-ink: #4338CA;
  --accent-soft: #EEF2FF;
  --violet: #7C3AED;
  --vton: #7C3AED;
  --vton-soft: #F3E8FF;
  --vton-ink: #6D28D9;
  --success: #047857;
  --success-soft: #ECFDF5;
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --danger: #B91C1C;
  --danger-soft: #FEF2F2;
  --gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);

  --font-display: 'Lexend', 'Plus Jakarta Sans', 'Segoe UI Variable Display', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -8px rgba(15, 23, 42, .10);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .04), 0 24px 56px -16px rgba(79, 70, 229, .22);
  --ring: 0 0 0 4px rgba(79, 70, 229, .18);

  --container: 1240px;
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 28px; }

/* ---------- Nawigacja górna ---------- */
.topnav {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, .8);
}
.topnav .container { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--gradient); display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6); }
.brand b { font-weight: 600; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; flex: 1; min-width: 0; }
.nav-links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nav-links svg { flex: 0 0 auto; opacity: .85; }

.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none; transition: border-color .15s, color .15s; }
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }

.user-menu { position: relative; }
.avatar-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gradient); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 8px; display: none; }
.menu.open { display: block; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu .who small { display: block; color: var(--muted); font-size: 12.5px; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px; background: none; text-align: left; text-decoration: none; font-size: 14px; cursor: pointer; color: var(--text-2); }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); }

.nav-toggle { display: none; }

@media (max-width: 1080px) {
  .topnav .container { gap: 12px; }
  .nav-actions > a.icon-btn { display: none; } /* Ustawienia są w menu konta */
  .nav-toggle { display: grid; }
  .nav-links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 20px 20px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { border-radius: 12px; padding: 12px 14px; }
}

/* ---------- Typografia i sekcje ---------- */
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: -.025em; line-height: 1.08; margin: 0; }
.h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -.015em; margin: 0; }
.lead { font-size: 17px; color: var(--muted); line-height: 1.6; margin: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 500; color: var(--text-2); box-shadow: var(--shadow-sm); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }

.accent-word { position: relative; white-space: nowrap; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.accent-word::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -.22em; height: .32em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M2 14 C 40 4, 80 4, 110 11 S 170 18, 198 6' fill='none' stroke='%237C3AED' stroke-width='4' stroke-linecap='round' opacity='.55'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

.section { margin-top: 56px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.link { font-size: 14px; font-weight: 600; color: var(--accent-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { text-decoration: underline; }

/* ---------- Przyciski i kontrolki ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .7); }
.btn-primary:hover { box-shadow: 0 12px 28px -8px rgba(79, 70, 229, .8); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-lg { height: 52px; padding: 0 24px; font-size: 15.5px; border-radius: 14px; }

.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 12px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.pill-select { position: relative; display: inline-flex; align-items: center; }
.pill-select select { appearance: none; -webkit-appearance: none; height: 38px; padding: 0 34px 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.pill-select::after { content: ""; position: absolute; right: 14px; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg) translateY(-2px); pointer-events: none; }
.pill-select select:hover { border-color: var(--border-strong); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 15px; outline: 0; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: var(--ring); }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-vton { background: var(--vton-soft); color: var(--vton-ink); }
.badge-glass { background: rgba(255, 255, 255, .86); color: var(--text); backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

/* ---------- Tło dekoracyjne ---------- */
.glow { position: relative; isolation: isolate; }
.glow::before {
  content: ""; position: absolute; inset: -120px 0 auto 0; height: 640px; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
  background:
    radial-gradient(600px 280px at 20% 30%, rgba(99, 102, 241, .16), transparent 70%),
    radial-gradient(520px 260px at 80% 20%, rgba(168, 85, 247, .14), transparent 70%),
    radial-gradient(800px 300px at 50% 80%, rgba(56, 189, 248, .08), transparent 70%);
}

/* ---------- Pulpit ---------- */
.hero { text-align: center; padding: 56px 0 8px; }
.hero .display { font-size: clamp(36px, 5.2vw, 60px); margin-top: 18px; }
.hero .lead { max-width: 680px; margin: 18px auto 0; }

.composer { max-width: 1040px; margin: 36px auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 18px; text-align: left; }
.composer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.composer textarea { width: 100%; min-height: 96px; resize: vertical; border: 0; outline: 0; padding: 14px 6px 6px; font-size: 16px; line-height: 1.55; background: transparent; }
.composer textarea::placeholder { color: #94A3B8; }
.composer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.composer-bar .spacer { flex: 1; }
.composer-bar .btn { margin-left: auto; }
.upload-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px dashed var(--border-strong); background: var(--surface-2); font-size: 13.5px; font-weight: 500; color: var(--text-2); cursor: pointer; text-decoration: none; }
.upload-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.hint { font-size: 12.5px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 20px 22px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: 0 0 auto; }
.stat-icon.vton { background: var(--vton-soft); color: var(--vton-ink); }
.stat-icon.ok { background: var(--success-soft); color: var(--success); }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--muted); }

.project-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.pcard { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; border-radius: var(--r-lg); }
.pcard-media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.pcard:hover .pcard-media img { transform: scale(1.06); }
.pcard:hover .pcard-media { box-shadow: var(--shadow-md); }
.pcard-media .badge { position: absolute; top: 12px; left: 12px; }
.pcard-media .count { top: auto; left: auto; right: 12px; bottom: 12px; }
.pcard-title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.pcard-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 2px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, #E9EEF5 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.metric { padding: 22px 24px; }
.metric + .metric { border-left: 1px solid var(--border); }
.metric-value { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -.02em; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.metric-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { display: flex; gap: 14px; padding: 20px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.feature:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: 0 0 auto; }
.feature-icon.vton { background: var(--vton-soft); color: var(--vton-ink); }
.feature-title { font-weight: 600; font-size: 14.5px; }
.feature-desc { font-size: 13.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

.empty, .error-box { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
.error-box { color: var(--danger); border-color: #FECACA; background: var(--danger-soft); }

.footer { margin: 72px 0 0; padding: 28px 0 40px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 1080px) {
  .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .stats, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--border); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .features, .project-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; }
  .avatar-btn { padding: 3px; }
  .avatar-btn svg { display: none; }
  .eyebrow { font-size: 12px; }
  .composer { padding: 14px; border-radius: var(--r-lg); }
  .composer-bar .pill-select, .composer-bar .pill-select select, .composer-bar .upload-chip, .composer-bar .btn { width: 100%; }
  .section-head { flex-direction: column; align-items: stretch; }
  .section-head .input { width: 100% !important; }
}

/* ---------- Logowanie ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-showcase { padding: 40px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-showcase .display { font-size: clamp(34px, 4vw, 52px); margin-top: 22px; }
.auth-showcase .lead { margin-top: 18px; max-width: 520px; }
.mosaic { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 560px; }
.mosaic .tile { aspect-ratio: 3 / 4; border-radius: var(--r-lg); display: grid; place-items: center; box-shadow: var(--shadow-md); }
.mosaic .tile:nth-child(2) { transform: translateY(28px); }
.mosaic .tile svg { width: 62%; height: auto; }
.auth-panel { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 420px; padding: 36px; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
.auth-card h1 { font-family: var(--font-display); font-weight: 600; font-size: 28px; letter-spacing: -.02em; margin: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--danger-soft); color: var(--danger); border: 1px solid #FECACA; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: #3730A3; font-size: 13px; line-height: 1.5; margin-top: 18px; }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-showcase { padding: 28px 22px 0; }
  .mosaic { display: none; }
  .auth-panel { padding: 28px 18px 48px; }
  .auth-card { padding: 26px; }
}

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