/* ============================================================
   StreamPress DTF kalkulator — "print job ticket" estetika
   Papir + črnilo + CMYK registracijske oznake
   ============================================================ */

:root {
  --paper: #f3efe7;
  --paper-deep: #e9e3d6;
  --ink: #181512;
  --ink-soft: #4a443c;
  --line: #d4cbb8;
  --cyan: #00a6c2;
  --magenta: #e2007a;
  --yellow: #f5b800;
  --accent: var(--magenta);
  --good: #1e8a4c;
  --rush: #c2421a;
  --error: #b3261e;
  --radius: 3px;
  --font-display: "Archivo", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

/* hidden atribut mora premagati display pravila (.field ipd.) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(24, 21, 18, 0.05) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- CMYK registracijska črta na vrhu ---------- */
.registration-strip { display: flex; height: 6px; }
.registration-strip .reg { flex: 1; }
.reg.c { background: var(--cyan); }
.reg.m { background: var(--magenta); }
.reg.y { background: var(--yellow); }
.reg.k { background: var(--ink); }

/* ---------- Glava ---------- */
.site-header { border-bottom: 2px solid var(--ink); background: var(--paper); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--magenta); letter-spacing: -2px; font-size: 20px; }
.brand-name {
  font-weight: 900; font-stretch: 115%; font-size: 22px; letter-spacing: 0.04em;
}
.brand-name em { font-style: normal; color: var(--magenta); }
.header-tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--ink-soft); border: 1px solid var(--line); padding: 5px 10px;
}

/* ---------- Hero ---------- */
.hero { padding: 56px 0 36px; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero h1 {
  margin: 0 0 14px;
  font-weight: 900; font-stretch: 120%;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 0.95; letter-spacing: -0.015em;
  text-transform: uppercase;
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero h1 .outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  display: inline-block;
}
.hero-sub {
  max-width: 560px; margin: 0; color: var(--ink-soft); font-size: 1.05rem;
  animation: rise 0.6s 0.12s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Postavitev ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px; align-items: start; padding-top: 36px; padding-bottom: 72px;
}
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .ticket-col { order: -1; }
}

/* ---------- Kartice ---------- */
.card {
  background: #fffdf8;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 rgba(24, 21, 18, 0.12);
  padding: 24px;
  margin-bottom: 24px;
}
.card h2 {
  margin: 0 0 18px; font-size: 1.15rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 10px;
}
.step {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; flex: none;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
}
#sec-contact .step { background: var(--cyan); }
#sec-order .step { background: var(--magenta); }
#sec-positions .step { background: var(--yellow); color: var(--ink); }
#sec-submit .step { background: var(--magenta); }

.hint { margin: -8px 0 16px; font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- Polja ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft);
}
.req { color: var(--magenta); }

input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], textarea, select {
  font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; background: #fff;
  box-shadow: 3px 3px 0 var(--magenta);
}
textarea { resize: vertical; }

input[type="file"] {
  font-family: var(--font-mono); font-size: 0.82rem;
  border: 1.5px dashed var(--ink); background: var(--paper);
  padding: 9px; border-radius: var(--radius); width: 100%;
}

/* ---------- Izbire (radio kartice) ---------- */
.choice-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  border: 0; padding: 0; margin: 0 0 18px;
}
.choice-row .label { width: 100%; margin-bottom: 4px; }
.choice { flex: 1; min-width: 130px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  display: flex; flex-direction: column; gap: 2px;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: 10px 14px; background: var(--paper);
  transition: all 0.12s ease;
}
.choice-body small { color: var(--ink-soft); font-size: 0.78rem; }
.choice-body small.good { color: var(--good); font-weight: 700; }
.choice-body small.rush { color: var(--rush); font-weight: 700; }
.choice input:checked + .choice-body {
  background: var(--ink); color: var(--paper);
  box-shadow: 3px 3px 0 var(--magenta);
}
.choice input:checked + .choice-body small { color: var(--paper-deep); }
.choice input:checked + .choice-body small.good { color: #7fe3a8; }
.choice input:checked + .choice-body small.rush { color: #ffac8e; }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--cyan); outline-offset: 2px; }
.choice-row.compact .choice-body { padding: 8px 10px; }

/* ---------- Velikosti majic ---------- */
.label-note { text-transform: none; letter-spacing: 0; color: var(--ink-soft); font-weight: 400; }
.sizes-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 8px;
}
@media (max-width: 560px) { .sizes-grid { grid-template-columns: repeat(3, 1fr); } }
.size-cell { display: flex; flex-direction: column; gap: 4px; }
.size-cell .size-name {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-align: center;
  background: var(--ink); color: var(--paper); padding: 3px 0;
}
.size-cell.is-3xl .size-name { background: var(--magenta); }
.size-cell input { text-align: center; padding: 8px 4px; }
.sizes-total { margin: 10px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.sizes-total strong { font-family: var(--font-mono); color: var(--ink); }

/* ---------- Barvna paleta ---------- */
.color-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 7px; margin-top: 8px;
}
.swatch {
  aspect-ratio: 1; border: 1.5px solid var(--ink); border-radius: var(--radius);
  cursor: pointer; padding: 0; position: relative;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.swatch:hover { transform: scale(1.12); z-index: 2; }
.swatch:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.swatch.selected {
  box-shadow: 0 0 0 2.5px var(--paper), 0 0 0 5px var(--magenta);
  transform: scale(1.08); z-index: 1;
}
.swatch.selected::after {
  content: '✓'; position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 900; font-size: 15px; color: #fff;
  text-shadow: 0 0 3px rgba(0,0,0,0.9);
}
.color-selected { margin: 12px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.color-selected strong { font-family: var(--font-mono); color: var(--ink); }

/* ---------- Predogledi pozicij ---------- */
#previews { display: grid; gap: 18px; }
.preview-block { text-align: center; }
.preview-block .preview-title {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 8px;
}
.preview-block canvas {
  width: 100%; max-width: 420px; height: auto;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: #fff; cursor: grab; touch-action: none;
}
.preview-block canvas.dragging { cursor: grabbing; }
.preview-empty { color: var(--ink-soft); font-size: 0.9rem; font-style: italic; }

.shirt-summary { font-size: 0.82rem; margin: 4px 0; font-family: var(--font-mono); }

/* ---------- Pozicije ---------- */
.position-row {
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--paper); padding: 16px; margin-bottom: 14px;
  animation: rise 0.25s ease both;
}
.position-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.position-index {
  font-family: var(--font-mono); font-weight: 600; font-size: 13px;
  background: var(--yellow); padding: 3px 9px;
}
.btn-remove {
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  width: 28px; height: 28px; cursor: pointer; border-radius: var(--radius);
  font-size: 13px; line-height: 1;
  transition: all 0.12s ease;
}
.btn-remove:hover { background: var(--error); border-color: var(--error); color: #fff; }
.grid-pos {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px 14px;
}
.span-pos-file { grid-column: 1 / -1; }
.pos-custom-wrap { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid-pos { grid-template-columns: 1fr 1fr; } .grid-pos > .field:first-child { grid-column: 1 / -1; } }

/* ---------- Datoteke ---------- */
.filedrop { display: block; cursor: pointer; }
.filedrop input { cursor: pointer; }
.filedrop-label { display: none; }
.filelist { list-style: none; padding: 0; margin: 12px 0 0; }
.filelist li {
  font-family: var(--font-mono); font-size: 0.8rem;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 10px; border-bottom: 1px dashed var(--line);
}
.filelist li .fsize { color: var(--ink-soft); flex: none; }
.size-meter { font-size: 0.85rem; color: var(--ink-soft); margin: 14px 0 0; }
.error-text { color: var(--error); font-weight: 700; }

/* ---------- Gumbi ---------- */
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border-radius: var(--radius); padding: 12px 22px;
  transition: all 0.12s ease;
}
.btn.ghost {
  background: transparent; border: 1.5px dashed var(--ink); color: var(--ink); width: 100%;
}
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-style: solid; }
.btn.primary {
  display: block; width: 100%; margin-top: 16px;
  background: var(--magenta); color: #fff; border: 1.5px solid var(--ink);
  font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.05em;
  box-shadow: 4px 4px 0 var(--ink);
}
.btn.primary:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn.primary:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary:disabled { opacity: 0.55; cursor: wait; }

.turnstile-box { min-height: 70px; display: flex; justify-content: center; }

.status { margin: 14px 0 0; font-size: 0.92rem; min-height: 1.4em; }
.status.ok { color: var(--good); font-weight: 700; }
.status.err { color: var(--error); font-weight: 700; }

/* ---------- Job ticket (rezultat) ---------- */
.ticket-col { position: sticky; top: 20px; }
@media (max-width: 920px) { .ticket-col { position: static; } }

.ticket {
  background: #fffdf8;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  position: relative;
}
.ticket-head {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--ink); color: var(--paper); padding: 12px 18px;
}
.ticket-title {
  font-weight: 900; font-stretch: 118%; letter-spacing: 0.14em; font-size: 1rem;
}
.ticket-no { font-family: var(--font-mono); font-size: 11px; color: var(--yellow); }

#ticket-body { padding: 16px 18px 4px; }

.ticket-error {
  margin: 14px 18px 0; padding: 10px 12px;
  background: #fbeae9; border: 1.5px solid var(--error); color: var(--error);
  font-size: 0.85rem; font-weight: 600;
}

.ticket-rows { margin: 0; }
.trow {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 7px 0;
}
.trow dt { font-size: 0.85rem; color: var(--ink-soft); }
.trow dd { margin: 0; font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.trow.total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; }
.trow.total dt { color: var(--ink); font-weight: 800; font-size: 0.95rem; text-transform: uppercase; }
.trow.total dd { font-size: 1.5rem; color: var(--magenta); }
.ticket-rows.small .trow { padding: 4px 0; }
.ticket-rows.small dt, .ticket-rows.small dd { font-size: 0.78rem; }

.ticket-sep {
  border-top: 1px dashed var(--line); margin: 8px 0;
}
.ticket-sub {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-soft); margin: 8px 0 4px;
}
.rot-list { list-style: none; margin: 0; padding: 0; }
.rot-list li {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 0.82rem; padding: 4px 0;
}
.rot-list .rot-badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  background: var(--paper-deep); border: 1px solid var(--ink);
  padding: 1px 7px; white-space: nowrap;
}
.rot-list .rot-badge.rot90 { background: var(--yellow); }

.ticket-note {
  margin: 8px 18px 18px; padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.78rem; font-style: italic; color: var(--ink-soft);
}

/* perforiran spodnji rob */
.ticket-perfo {
  height: 12px;
  background-image: radial-gradient(circle at 8px 0, var(--paper) 5px, transparent 5.5px);
  background-size: 22px 12px;
  background-repeat: repeat-x;
  margin-top: -2px;
}

/* ---------- Noga ---------- */
.site-footer {
  border-top: 2px solid var(--ink); padding: 20px 0; background: var(--paper);
}
.site-footer .wrap {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft);
}
.cmyk-dots i {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 5px;
}
.cmyk-dots .c { background: var(--cyan); }
.cmyk-dots .m { background: var(--magenta); }
.cmyk-dots .y { background: var(--yellow); }
.cmyk-dots .k { background: var(--ink); }
