/* ============================================================
   MILONOR — Kreator wyceny (shares design tokens with main site)
   ============================================================ */
:root {
  --bg:            #0A0B10;
  --bg-elev:       #10111A;
  --bg-elev-2:     #151620;
  --surface:       rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --fg:            #E8EAF0;
  --fg-muted:      #9499AB;
  --fg-dim:        #6B7080;

  --accent:        #2563EB;
  --accent-2:      #1E3A8A;
  --accent-soft:   rgba(37, 99, 235, 0.12);
  --accent-glow:   rgba(37, 99, 235, 0.40);
  --accent-fg:     #FFFFFF;

  --grad-accent:   linear-gradient(120deg, #3B82F6 0%, #2563EB 100%);
  --grad-text:     linear-gradient(120deg, #FFFFFF 0%, #93C5FD 52%, #BFDBFE 100%);

  --radius:        18px;
  --radius-sm:     12px;
  --radius-lg:     26px;

  --shadow-card:   0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 45px -25px rgba(0,0,0,0.9);

  --ease:          cubic-bezier(0.16, 1, 0.3, 1);
  --maxw:          1180px;

  --font-display:  'Space Grotesk', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;

  --danger: #EF4444;
  --ok: #22C55E;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: var(--fg); }
::selection { background: var(--accent); color: var(--accent-fg); }

body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(560px 420px at 78% -5%, rgba(37, 99, 235,0.11), transparent 70%),
    radial-gradient(520px 460px at 8% 12%, rgba(30, 58, 138,0.09), transparent 70%);
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; position: relative; z-index: 1; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-display); font-weight: 500; font-size: 0.96rem;
  padding: 13px 22px; border-radius: 999px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.25s ease, border-color 0.25s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad-accent); color: var(--accent-fg); box-shadow: 0 10px 34px -12px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--surface); color: var(--fg); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--accent); }
.btn-sm { padding: 9px 16px; font-size: 0.88rem; }

/* ---- Nav ---- */
header.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 11, 16, 0.78); backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 18px; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; display: inline-flex; align-items: center; gap: 10px; }
.logo .dot { color: var(--accent); }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 0.92rem; transition: color 0.2s ease; }
.back-link:hover { color: var(--fg); }
.back-link svg { width: 16px; height: 16px; }
.nav-right { display: flex; align-items: center; gap: 14px; }

.account-menu { position: relative; }
.account-link { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--fg); transition: border-color 0.2s ease; flex-shrink: 0; }
.account-link:hover { border-color: var(--accent); }
.account-link svg { width: 19px; height: 19px; flex-shrink: 0; }
.account-link.logged-in { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(37,99,235,0.25); }
.account-name { font-family: var(--font-display); font-size: 0.85rem; font-weight: 500; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.account-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 200px; z-index: 200;
  background: rgba(16, 17, 26, 0.97); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 8px 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.account-dropdown a, .account-dropdown button {
  display: block; width: 100%; text-align: left; padding: 10px 20px; font-size: 0.9rem; color: var(--fg);
  font-family: var(--font-body); transition: background 0.15s ease;
}
.account-dropdown a:hover, .account-dropdown button:hover { background: rgba(37,99,235,0.08); }
@media (max-width: 480px) {
  .account-name { display: none !important; }
  .account-dropdown { right: -10px; min-width: 220px; }
}

.cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--fg); transition: border-color 0.2s ease, color 0.2s ease; flex-shrink: 0; }
.cart-link:hover { border-color: var(--accent); }
.cart-link svg { width: 19px; height: 19px; }
.cart-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--grad-accent); color: #fff; font-size: 0.66rem; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', monospace; }

.lang-toggle { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang-toggle button { font-family: var(--font-display); font-size: 0.8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; color: var(--fg-dim); transition: color 0.2s ease, background 0.2s ease; }
.lang-toggle button.active { color: var(--accent-fg); background: var(--grad-accent); }

/* ---- Page head ---- */
.kreator-head { padding: 46px 0 8px; text-align: center; }
.kreator-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.kreator-head p { color: var(--fg-muted); max-width: 560px; margin: 0 auto; }

/* ---- Stepper ---- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 26px 0 10px; flex-wrap: wrap; }
.stepper .sp { display: flex; align-items: center; gap: 8px; color: var(--fg-dim); font-family: var(--font-display); font-size: 0.85rem; }
.stepper .sp .n { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 0.78rem; transition: all 0.3s var(--ease); }
.stepper .sp.active { color: var(--fg); }
.stepper .sp.active .n { background: var(--grad-accent); border-color: transparent; color: #fff; }
.stepper .sp.done .n { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.stepper .sep { width: 30px; height: 1px; background: var(--border-strong); }

/* ---- Upload step ---- */
.upload-stage { padding: 20px 0 90px; }
.dropzone {
  max-width: 620px; margin: 0 auto;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--bg-elev);
  padding: 56px 32px; text-align: center;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-3px); }
.dropzone .up-icon {
  width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 20px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(37, 99, 235,0.18), rgba(30, 58, 138,0.12));
  border: 1px solid var(--border-strong);
}
.dropzone .up-icon svg { width: 34px; height: 34px; color: var(--accent); }
.dropzone h3 { font-size: 1.25rem; margin-bottom: 8px; }
.dropzone p { color: var(--fg-muted); font-size: 0.95rem; margin-bottom: 20px; }
.dropzone .formats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.dropzone .fmt { font-family: var(--font-display); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--fg-muted); }
.dropzone .fmt-note { font-size: 0.8rem; color: var(--fg-dim); margin-top: 10px; }
#fileInput { display: none; }

.upload-error {
  max-width: 620px; margin: 18px auto 0; padding: 14px 18px; border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.35); color: #FCA5A5; font-size: 0.92rem;
  display: none;
}
.upload-error.show { display: block; }

.upload-progress { max-width: 620px; margin: 18px auto 0; text-align: center; color: var(--fg-muted); font-size: 0.92rem; display: none; }
.upload-progress.show { display: block; }

/* ---- Config stage ---- */
.config-stage { padding: 10px 0 100px; display: none; }
.config-stage.show { display: block; }
.config-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 34px; align-items: start; }

.viewer-card {
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--bg-elev); overflow: hidden;
  box-shadow: var(--shadow-card);
}
.viewer-canvas { width: 100%; aspect-ratio: 4 / 3; position: relative; }
.viewer-canvas canvas { display: block; width: 100%; height: 100%; }
.viewer-meta {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--border);
}
.viewer-meta .dims { font-family: var(--font-display); font-size: 0.95rem; }
.viewer-meta .dims span { color: var(--accent); }
.viewer-meta .file-name { color: var(--fg-dim); font-size: 0.85rem; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.change-file-btn { font-size: 0.85rem; color: var(--fg-muted); border-bottom: 1px dashed var(--border-strong); }
.change-file-btn:hover { color: var(--accent); border-color: var(--accent); }

.config-panel { display: flex; flex-direction: column; gap: 22px; }
.field-group { display: flex; flex-direction: column; gap: 8px; }
.field-group label { font-family: var(--font-display); font-size: 0.82rem; font-weight: 500; color: var(--fg-muted); letter-spacing: 0.02em; }
.select-wrap select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-elev); border: 1px solid var(--border-strong); font-size: 0.96rem; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239499AB' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select-wrap select:focus { outline: none; border-color: var(--accent); }

.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--accent); height: 4px; }
.range-row .range-val { font-family: var(--font-display); font-weight: 600; min-width: 52px; text-align: right; }

.qty-scale-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.number-input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-elev); border: 1px solid var(--border-strong); font-size: 0.96rem;
}
.number-input:focus { outline: none; border-color: var(--accent); }

/* Quote card */
.quote-card {
  border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: radial-gradient(120% 140% at 100% 0%, rgba(37, 99, 235,0.12), transparent 55%), var(--bg-elev);
  padding: 24px 24px 22px;
}
.quote-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 0.92rem; color: var(--fg-muted); border-bottom: 1px solid var(--border); }
.quote-row:last-of-type { border-bottom: none; }
.quote-row span.v { color: var(--fg); font-weight: 500; }
.quote-total { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--border-strong); display: flex; align-items: baseline; justify-content: space-between; }
.quote-total .label { font-family: var(--font-display); font-size: 0.95rem; color: var(--fg-muted); }
.quote-total .val { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }
.quote-note { font-size: 0.8rem; color: var(--fg-dim); margin-top: 14px; }
.quote-cta { margin-top: 18px; width: 100%; }

/* ---- Contact modal ---- */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.65);
  align-items: center; justify-content: center; padding: 20px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.contact-modal {
  width: 100%; max-width: 520px; background: var(--bg-elev-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 30px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-card);
}
.contact-modal h3 { font-size: 1.35rem; margin-bottom: 6px; }
.contact-modal .modal-sub { color: var(--fg-muted); font-size: 0.9rem; margin-bottom: 20px; }
.contact-modal form { display: flex; flex-direction: column; gap: 14px; }
.contact-modal label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--fg-muted); }
.contact-modal input, .contact-modal textarea {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px;
  padding: 12px 16px; font-size: 0.95rem; color: #E8EAF0; resize: vertical;
  transition: border-color 0.2s ease;
}
.contact-modal input::placeholder, .contact-modal textarea::placeholder { color: #6B7080; }
.contact-modal input:focus, .contact-modal textarea:focus { outline: none; border-color: #2563EB; }
.summary-box { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 0.86rem; color: var(--fg-muted); display: flex; flex-direction: column; gap: 4px; }
.summary-box b { color: var(--fg); }
.modal-close { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); display: grid; place-items: center; }
.contact-modal { position: relative; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-msg { font-size: 0.88rem; min-height: 20px; }
.form-msg.error { color: #FCA5A5; }
.form-msg.ok { color: var(--ok); }

.thankyou { text-align: center; padding: 10px 0; }
.thankyou .ty-icon { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); }
.thankyou .ty-icon svg { width: 28px; height: 28px; }
.thankyou h3 { margin-bottom: 8px; }
.thankyou p { color: var(--fg-muted); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .config-grid { grid-template-columns: 1fr; }
  .nav-inner { gap: 10px; }
  .back-link span.txt { display: none; }
}
@media (max-width: 520px) {
  .qty-scale-row { grid-template-columns: 1fr; }
  .dropzone { padding: 40px 20px; }
}
