/* ═══ Generator Żetonów — style mbprint (bazowane na ../generator/css/style.css) ═══ */

/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }
:root {
  --black: #050313; --white: #fff; --gray-50: #f6f6f6; --gray-100: #f6f6f6;
  --gray-200: #e8e8e8; --gray-300: #d4d4d4; --gray-400: #9b9b9b;
  --gray-500: #646466; --gray-600: #404040; --gray-700: #212529;
  --accent-yellow: #fccf00; --accent-green: #5eae27; --accent-purple: #c679f6;
  --accent-red: #ef4444;
  --sheet-bg: #fafafa;
  --cut-line: rgba(0, 0, 0, 0.85);
  --bleed-line: rgba(239, 68, 68, 0.85);
  --safe-line: rgba(22, 163, 74, 0.9);
}
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; background: var(--white); color: var(--black); line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* ── Header ── */
.header { background: #f6f6f6; border-bottom: 1px solid #e8e8e8; padding: 16px 0; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.logo { height: 36px; }
.header-nav { display: flex; gap: 24px; align-items: center; }
.header-nav a {
  color: #050313;
  text-decoration: none;
  font-family: 'Archivo', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
}
.header-nav a:hover { text-decoration: underline; }
.lang-dropdown { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid #e8e8e8; border-radius: 6px;
  padding: 7px 12px; font-family: 'Archivo', sans-serif;
  font-size: 0.9rem; font-weight: 600; line-height: 1;
  cursor: pointer; color: #050313; white-space: nowrap;
}
.lang-btn:hover { background: rgba(0,0,0,0.04); }
.lang-flag { font-size: 20px; line-height: 1; display: flex; align-items: center; }
.lang-label { text-transform: uppercase; }
.lang-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  min-width: 150px; z-index: 999; overflow: hidden;
}
.lang-menu.open { display: block; }
.lang-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 16px; background: none; border: none;
  font-family: 'Archivo', sans-serif; font-size: 0.95rem; font-weight: 500;
  color: #050313; cursor: pointer; text-align: left;
}
.lang-option:hover { background: #f6f6f6; }

/* ── Hero ── */
.hero { max-width: 1200px; margin: 0 auto; padding: 48px 24px 36px; }
.hero h1 { font-size: clamp(28px, 4vw, 48px); font-weight: 900; line-height: 1.1; letter-spacing: -0.03em; text-transform: uppercase; margin-bottom: 12px; }
.hero h1 .hl-y { background: var(--accent-yellow); padding: 0 6px; }
.hero h1 .hl-g { background: var(--accent-green); padding: 0 6px; }
.hero h1 .hl-p { background: var(--accent-purple); padding: 0 6px; color: #fff; }
.hero p { font-size: 15px; color: var(--gray-600); max-width: 620px; }

/* ── Main layout ── */
.main { max-width: 1200px; margin: 0 auto; padding: 0 24px 80px; display: grid; grid-template-columns: 1fr 340px; gap: 36px; align-items: start; }

/* ── Settings bar (shape, dimensions, copies) ── */
.settings-bar { border: 1px solid var(--gray-200); padding: 20px 24px; margin-bottom: 20px; }
.settings-bar h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; border-bottom: 3px solid var(--accent-yellow); padding-bottom: 6px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: start; }
.settings-grid .full { grid-column: 1 / -1; }
.settings-grid .span-2 { grid-column: span 2; }

.field label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-700); margin-bottom: 5px; }
.field input[type="number"], .field input[type="text"], .field select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--gray-300);
  font-size: 14px; font-family: inherit; background: var(--white);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent-purple); }
.field .help { font-size: 11px; color: var(--gray-500); margin-top: 3px; }

/* ── Shape picker (tiles) ── */
.shape-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shape-tile {
  background: var(--white); border: 2px solid var(--gray-200); padding: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.shape-tile:hover { border-color: var(--gray-400); }
.shape-tile.active { border-color: var(--accent-purple); background: #f5f3ff; }
.shape-tile svg { width: 32px; height: 32px; }
.shape-tile span { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--gray-600); }
.shape-tile.active span { color: var(--accent-purple); }

/* ── Token upload & list ── */
.token-list-section { border: 1px solid var(--gray-200); padding: 20px 24px; margin-bottom: 20px; }
.token-list-section h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; border-bottom: 3px solid var(--accent-yellow); padding-bottom: 6px; }
.token-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; min-height: 100px; }
.token-cell {
  position: relative; background: var(--gray-50); border: 1px solid var(--gray-200);
  padding: 8px; cursor: pointer; transition: border-color 0.15s;
}
.token-cell:hover { border-color: var(--gray-400); }
.token-cell.drag-over { border-color: var(--accent-purple); border-style: dashed; background: #f5f3ff; }
.token-cell-num { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--gray-500); margin-bottom: 4px; }
.token-cell-sides { display: flex; gap: 4px; }
.token-side {
  flex: 1; position: relative; aspect-ratio: 1;
  background: var(--gray-200); overflow: hidden;
}
.token-side img { width: 100%; height: 100%; object-fit: cover; display: block; }
.token-side.empty {
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--gray-300); background: var(--white); color: var(--gray-400); font-size: 18px;
}
.token-side.empty.required { border-color: var(--accent-red); background: #fef2f2; color: var(--accent-red); }
.token-cell-copies {
  position: absolute; top: 6px; right: 6px;
  background: var(--accent-purple); color: var(--white);
  font-size: 9px; font-weight: 700; padding: 2px 5px;
  border-radius: 2px;
}
.token-cell-delete {
  position: absolute; top: 6px; left: 6px; width: 18px; height: 18px;
  border: none; background: rgba(0,0,0,0.55); color: var(--white);
  font-size: 12px; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.token-cell:hover .token-cell-delete { display: flex; }
.token-cell-delete:hover { background: var(--accent-red); }

.add-token-btn {
  padding: 24px; border: 2px dashed var(--gray-300);
  background: none; cursor: pointer; font-size: 13px; font-weight: 700;
  color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.03em;
  grid-column: 1 / -1;
}
.add-token-btn:hover { border-color: var(--black); color: var(--black); }
.add-token-btn.dragover { border-color: var(--accent-green); color: var(--accent-green); background: #f0fdf4; }

/* ── A3 Sheet preview ── */
.preview-section { border: 1px solid var(--gray-200); padding: 20px; margin-bottom: 20px; }
.preview-section h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; border-bottom: 3px solid var(--accent-yellow); padding-bottom: 6px; }
.sheet-preview-wrap {
  background: var(--sheet-bg); border: 1px solid var(--gray-200); padding: 20px;
  display: flex; align-items: center; justify-content: center; min-height: 240px;
  overflow: auto;
}
#sheet-preview { background: var(--white); box-shadow: 0 4px 16px rgba(0,0,0,0.06); max-width: 100%; }
.sheet-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 12px;
}
.sheet-stat {
  padding: 8px 12px; background: var(--gray-50); border: 1px solid var(--gray-200);
  font-size: 11px;
}
.sheet-stat-label { display: block; font-weight: 700; text-transform: uppercase; color: var(--gray-500); font-size: 9px; margin-bottom: 2px; }
.sheet-stat-value { font-weight: 700; color: var(--black); }

/* ── Submit ── */
.submit-btn { width: 100%; padding: 13px 18px; background: var(--accent-purple); color: var(--white); border: none; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; transition: background 0.15s; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.submit-btn:hover { background: #b366e8; }
.submit-btn:disabled { background: var(--gray-400); cursor: not-allowed; }
.btn-spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: var(--white); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.submit-btn { position: relative; overflow: hidden; }
.btn-progress-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: rgba(0,0,0,0.2); }
.btn-progress-fill { display: block; height: 100%; width: 0; background: var(--accent-yellow); transition: width 0.3s ease; }

/* ── Feedback / status ── */
.form-feedback { padding: 12px 14px; margin-bottom: 14px; font-size: 13px; border: 1px solid; }
.form-feedback.hidden { display: none; }
.form-feedback.success { background: #f0fdf4; border-color: var(--accent-green); color: #22543d; }
.form-feedback.error { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.form-feedback-title { font-weight: 700; margin-bottom: 3px; }

/* ── Download section ── */
.download-section { margin-top: 16px; }
.download-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--accent-green); color: var(--white);
  text-decoration: none; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-radius: 4px; margin-right: 8px; margin-bottom: 8px;
}
.download-link:hover { background: #4a8c1f; }
.download-link.zip { background: var(--accent-purple); }
.download-link.zip:hover { background: #b366e8; }

/* ── Sidebar ── */
.sidebar-section { border: 1px solid var(--gray-200); padding: 20px; margin-bottom: 20px; }
.sidebar-section h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; border-bottom: 3px solid var(--accent-yellow); padding-bottom: 6px; }
.specs-list { list-style: none; }
.specs-list li { padding: 6px 0; border-bottom: 1px solid var(--gray-100); font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.specs-list li:last-child { border-bottom: none; }
.specs-list .spec-label { color: var(--gray-500); }
.specs-list .spec-value { font-weight: 700; text-align: right; }
.checklist { list-style: none; }
.checklist li { padding: 5px 0; font-size: 12px; display: flex; gap: 8px; align-items: flex-start; }
.checklist li::before { content: '•'; color: var(--accent-yellow); font-weight: 900; font-size: 18px; line-height: 1; margin-top: -2px; }

/* ── Footer ── */
.footer { background: var(--black); padding: 20px 0; text-align: center; font-size: 12px; color: rgba(255,255,255,0.6); }
.footer-link { color: inherit; }
.footer-sep { margin: 0 6px; }
.footer-credit { opacity: 0.5; }
.tokens-help-spacing { margin-top: 10px; }

/* Grupy mieszanych kształtów */
.token-group { border: 1px solid #dedde3; border-radius: 14px; padding: 18px; margin-bottom: 18px; background: #fff; }
.group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.group-head h3 { margin: 0; }
.group-head button, .sheet-nav button { border: 1px solid #d3d2d8; background: #fff; border-radius: 8px; padding: 7px 11px; cursor: pointer; }
.group-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 14px; }
.group-controls select, .group-controls input { min-height: 40px; border: 1px solid #cbcbd2; border-radius: 8px; padding: 7px 9px; }
.group-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #666; }
.group-tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.sheet-nav { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 12px 0; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .hero h1 { font-size: 28px; }
  .header-nav a:not(.lang-btn) { display: none; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .settings-grid { grid-template-columns: 1fr; }
  .shape-picker { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 32px 24px 24px; }
  .hero p { font-size: 13px; }
  .submit-btn { font-size: 13px; padding: 12px; }
  .settings-bar { padding: 14px 16px; }
  .sidebar-section { padding: 14px; }
  .sheet-stats { grid-template-columns: 1fr 1fr; }
}
