/* ============ DESIGN TOKENS ============ */
:root {
  --bg: #f5f3ef;
  --bg-elev: #ffffff;
  --bg-canvas: #ffffff;
  --ink: #16161a;
  --ink-soft: #4a4a52;
  --ink-muted: #8a8a92;
  --border: #e5e2dc;
  --border-strong: #16161a;

  --accent: #1a4cd9;       /* niebieski - "linia cięcia" */
  --accent-soft: #e8eefb;
  --accent-ink: #ffffff;

  --danger: #d92e2e;
  --warning: #d97706;
  --ok: #15803d;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(22,22,26,.04), 0 1px 1px rgba(22,22,26,.06);
  --shadow: 0 4px 12px rgba(22,22,26,.06), 0 2px 4px rgba(22,22,26,.04);
  --shadow-lg: 0 20px 40px rgba(22,22,26,.08), 0 8px 16px rgba(22,22,26,.04);

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'Inter Tight', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ============ TOPBAR ============ */
.site-header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
}

.brand-tagline {
  font-family: var(--font-display);
  font-size: 14px;
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}

.contact-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .15s;
  white-space: nowrap;
}
.contact-item:hover {
  color: var(--accent);
  text-decoration: none;
}

.contact-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent);
}

@media (max-width: 720px) {
  .site-header {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .brand-tagline {
    display: none;
  }
  .contact-bar {
    gap: 16px;
    font-size: 13px;
    width: 100%;
    justify-content: flex-start;
  }
  .contact-item span {
    display: none;
  }
  .contact-icon {
    width: 22px;
    height: 22px;
  }
}

/* ============ PROFILE LIST (home) ============ */
.hero {
  padding: 60px 32px 40px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto;
}

.profiles-grid {
  max-width: 1100px;
  margin: 0 auto 80px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.profile-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.profile-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.profile-card .shape-preview {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.profile-card .shape-preview .shape {
  background: var(--accent-soft);
  border: 2px dashed var(--accent);
  width: 100%;
  height: 100%;
}
.profile-card .shape-preview .shape.circle { border-radius: 50%; }
.profile-card .shape-preview .shape.rounded { border-radius: 16px; }
.profile-card .shape-preview .shape.rectangle { border-radius: 2px; }
.profile-card .shape-preview .shape.custom { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }

.profile-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.profile-card .meta {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.profile-card .marketplace-tag {
  align-self: flex-start;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: var(--ink);
  color: var(--bg-elev);
  border-radius: 100px;
  font-weight: 500;
}
.profile-card .marketplace-tag.allegro { background: #ff5a00; }
.profile-card .marketplace-tag.direct { background: var(--accent); }

/* ============ CREATOR LAYOUT ============ */
.creator {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 20px;
  padding: 20px;
  min-height: calc(100vh - 65px);
}

@media (max-width: 1100px) {
  .creator { grid-template-columns: 1fr; }
}

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel h2 .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg-elev);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
}

/* ============ CANVAS AREA ============ */
.canvas-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
  min-height: 500px;
}

.canvas-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  align-self: flex-start;
  flex-wrap: wrap;
}

.canvas-info {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  text-align: center;
}

#designCanvas {
  border: 1px solid var(--border);
  background:
    repeating-conic-gradient(#f8f7f4 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
  border-radius: 4px;
  max-width: 100%;
  height: auto;
}

/* ============ FORMS ============ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}
.field label .req { color: var(--danger); margin-left: 2px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea { resize: vertical; min-height: 70px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.field-checkbox input { width: 16px; height: 16px; margin-top: 2px; flex: none; cursor: pointer; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  transition: all .15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg-elev);
}
.btn-primary:hover { background: #000; }

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-accent:hover { background: #1340b8; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); background: var(--bg); }

.btn-sm { padding: 7px 12px; font-size: 13px; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-block { width: 100%; }

/* ============ UPLOAD AREA ============ */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: var(--bg);
}
.upload-area:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-area.dragover { border-color: var(--accent); background: var(--accent-soft); }
.upload-area .icon { font-size: 28px; margin-bottom: 8px; opacity: .6; }
.upload-area .hint { font-size: 12px; color: var(--ink-muted); margin-top: 6px; }

.uploaded-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.uploaded-list .item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.uploaded-list .item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploaded-list .item .size { color: var(--ink-muted); font-family: var(--font-mono); font-size: 11px; }
.uploaded-list .item .remove { color: var(--danger); cursor: pointer; padding: 4px; }

/* ============ NOTICES ============ */
.notice {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notice-info { background: var(--accent-soft); color: #0e2f80; border: 1px solid #c5d4f5; }
.notice-warn { background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; }
.notice-error { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }

/* ============ PROFILE INFO BANNER ============ */
.profile-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  background: var(--ink);
  color: var(--bg-elev);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.profile-banner .info { display: flex; flex-direction: column; gap: 2px; }
.profile-banner .info .name { font-family: var(--font-display); font-size: 18px; font-weight: 500; }
.profile-banner .info .specs { font-family: var(--font-mono); font-size: 12px; opacity: .75; }
.profile-banner .change { color: var(--bg-elev); border: 1px solid rgba(255,255,255,.3); }
.profile-banner .change:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(22,22,26,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn .15s ease;
}
.modal[hidden] { display: none; }
.modal-content {
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  animation: slideUp .2s ease;
}
.modal h2 { font-family: var(--font-display); font-weight: 500; font-size: 24px; margin-bottom: 12px; }
.modal p { color: var(--ink-soft); margin-bottom: 8px; }
.modal .order-id {
  font-family: var(--font-mono);
  font-size: 16px;
  background: var(--bg);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============ HELPERS ============ */
.hidden { display: none !important; }
.spacer { flex: 1; }

footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-muted);
  font-size: 13px;
}

/* ============ WIZARD (multi-item, /o/:token) ============ */

.wizard-hero {
  background: linear-gradient(135deg, #1a4cd9 0%, #0f3299 100%);
  color: white;
  padding: 32px;
  text-align: center;
}
.wizard-hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.2;
}
.wizard-hero h1 span { font-family: var(--font-mono); font-style: italic; opacity: 0.9; }
.wizard-hero .subtitle { margin: 0; opacity: 0.9; font-size: 15px; }

.wizard-progress {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-elev);
  padding: 12px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.wizard-progress .progress-text { font-size: 14px; white-space: nowrap; }
.wizard-progress .progress-text strong { color: var(--accent); }
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.wizard-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 120px; /* bottom padding pod sticky submit bar */
}

.wizard-item {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.wizard-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.wizard-item-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.wizard-item-qty {
  background: var(--ink);
  color: var(--bg-elev);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  white-space: nowrap;
}
.wizard-item-variant-mode {
  background: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}
.wizard-item-designs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wizard-design-slot {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.wizard-design-slot h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-soft);
}
.wizard-design-slot .design-area canvas {
  border: 1px solid var(--border);
  background:
    repeating-conic-gradient(#f8f7f4 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
  border-radius: 4px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
}

.customer-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.customer-section h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.wizard-submit-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-elev);
  padding: 16px 32px;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  z-index: 50;
}
.wizard-submit-bar .btn {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
}

@media (max-width: 720px) {
  .wizard-hero { padding: 24px 16px; }
  .wizard-progress { padding: 10px 16px; gap: 12px; }
  .wizard-container { padding: 20px 12px 140px; }
  .wizard-item { padding: 16px; }
  .wizard-item-header h2 { font-size: 16px; }
  .wizard-submit-bar { padding: 12px 16px; }
}
