/* =========================================================
   eDestilerija — interaktivni demo (demo.html)
   ========================================================= */

/* ---------- Koraci ---------- */
.demo-steps {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  margin-bottom: 18px; padding: 8px; counter-reset: none;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.demo-steps button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 0; border-radius: 12px; background: transparent;
  font-size: 14.5px; font-weight: 700; color: var(--muted); text-align: left;
  transition: background .15s, color .15s;
}
.demo-steps button:not(:disabled):hover { background: var(--brand-50); color: var(--brand-700); }
.demo-steps button:disabled { cursor: default; opacity: .55; }
.demo-steps__n {
  width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; background: var(--bg-soft); border: 1.5px solid var(--line); color: var(--muted);
}
.demo-steps__n svg { width: 15px; height: 15px; }
.demo-steps .is-done .demo-steps__n { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.demo-steps .is-done button { color: var(--ink); }
.demo-steps .is-current button { background: var(--brand-50); color: var(--brand-700); }
.demo-steps .is-current .demo-steps__n { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 0 0 4px var(--brand-100); }

/* ---------- Prozor aplikacije ---------- */
.demo-app {
  background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow-lg), 0 2px 10px rgba(15,23,42,.06);
  scroll-margin-top: calc(var(--header-h) + 90px);
}
.demo-app__bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: #fbfcfe; border-bottom: 1px solid var(--line-2); }
.demo-app__dots { display: flex; gap: 7px; }
.demo-app__dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff6058; }
.demo-app__dots i:nth-child(2) { background: #ffbd2e; }
.demo-app__dots i:nth-child(3) { background: #28c840; }
.demo-app__url {
  flex: 1; min-width: 0; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 9px; background: #fff; border: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.demo-app__url svg { width: 14px; height: 14px; flex: none; color: var(--leaf); }
.demo-app__tag { font-size: 12px; font-weight: 700; color: var(--amber); background: var(--amber-soft); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.demo-app__reset { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); transition: color .15s, border-color .15s; }
.demo-app__reset:hover { color: var(--brand-700); border-color: var(--brand-200); }
.demo-app__reset svg { width: 16px; height: 16px; }

.demo-app__body { display: grid; grid-template-columns: 210px minmax(0, 1fr) 310px; min-height: 640px; }

/* Bočni meni (dekorativan, prati korak) */
.demo-side { background: var(--bg-soft); border-right: 1px solid var(--line-2); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.demo-side__brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 14px; font-size: 14px; font-weight: 800; color: var(--ink); }
.demo-side__brand img { width: 24px; height: 24px; border-radius: 7px; }
.demo-side__group { margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.demo-side__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--slate); }
.demo-side__item svg { width: 17px; height: 17px; flex: none; color: #94a3b8; }
.demo-side__item.is-active { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm), inset 3px 0 0 var(--brand-600); }
.demo-side__item.is-active svg { color: var(--brand-600); }

/* ---------- Glavni deo ---------- */
.demo-main { padding: 28px 32px 32px; min-width: 0; animation: fadeUp .35s ease; }
.dm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dm-head small { font-size: 13px; font-weight: 600; color: var(--muted); }
.dm-head h3 { font-size: 24px; letter-spacing: -.02em; margin-top: 2px; }
.dm-fill {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 9px 14px; border-radius: 10px; border: 1px dashed var(--brand-300); background: var(--brand-50);
  font-size: 14px; font-weight: 700; color: var(--brand-700); transition: background .15s, border-color .15s;
}
.dm-fill:hover { background: var(--brand-100); border-style: solid; }
.dm-fill svg { width: 16px; height: 16px; }
.dm-tip {
  display: flex; gap: 10px; margin-bottom: 22px; padding: 12px 14px; border-radius: 12px;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 14.5px; line-height: 1.55;
}
.dm-tip svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--amber); }

.dm-form .fields { gap: 16px; }
.dm-form .fields + .fields { margin-top: 16px; }
.fields--wide { grid-template-columns: 1.7fr 1fr; }
.fields--wide > :only-child { grid-column: 1 / -1; }

.dm-live { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.dm-live[hidden] { display: none; }
.dm-stat { padding: 12px 14px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); animation: fadeUp .25s ease; }
.dm-stat small { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.dm-stat b { display: block; margin-top: 3px; font-size: 17px; color: var(--ink); letter-spacing: -.01em; }
.dm-stat--accent { background: var(--brand-50); border-color: var(--brand-100); }
.dm-stat--accent b { color: var(--brand-700); }
.dm-stat--bad { background: #fef2f2; border-color: #fecaca; }
.dm-stat--bad b { color: #b91c1c; }

.dm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 24px; }
.dm-actions .btn svg { width: 18px; height: 18px; }
.dm-actions__hint { font-size: 13.5px; color: var(--muted); }

.dm-stock { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 14px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 14.5px; }
.dm-stock svg { width: 18px; height: 18px; flex: none; color: var(--brand-600); }
.dm-stock b { color: var(--ink); }

/* Sačuvan korak */
.dm-saved { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 700; color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.dm-saved svg { width: 15px; height: 15px; }
.dm-done { padding: 18px 20px; border-radius: 14px; background: #f0fdf4; border: 1px solid #bbf7d0; }
.dm-done > b { color: #065f46; font-size: 15px; }
.dm-done ul { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.dm-done li { display: flex; gap: 10px; font-size: 15px; color: #14532d; line-height: 1.5; }
.dm-done li svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--leaf); }
.dm-record { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 18px 0 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); }
.dm-record div { background: #fff; padding: 12px 16px; }
.dm-record dt { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dm-record dd { margin: 2px 0 0; font-size: 15px; font-weight: 700; color: var(--ink); }

/* Nalepnica */
.dm-label {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px;
  padding: 18px 20px; border-radius: 14px; border: 1.5px dashed var(--line); background: repeating-linear-gradient(135deg, #fff 0 12px, #fafbff 12px 24px);
}
.dm-label__txt small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dm-label__txt b { display: block; margin-top: 4px; font-size: 19px; color: var(--ink); }
.dm-label__txt span { display: block; font-size: 14px; color: var(--slate); }
.dm-qr { width: 92px; height: 92px; flex: none; fill: var(--ink); background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--line); }

/* Rezime */
.dm-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dm-kpis .dm-stat b { font-size: 22px; }
.dm-subtitle { margin: 24px 0 12px; font-size: 15px; color: var(--ink); }
.dm-trace { position: relative; display: flex; flex-direction: column; gap: 14px; padding-left: 26px; }
.dm-trace::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--brand-500), var(--brand-100)); }
.dm-trace li { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 0 12px; }
.dm-trace li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-500); }
.dm-trace li:first-child::before { background: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-100); }
.dm-trace time { grid-row: span 2; font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.dm-trace b { font-size: 15px; color: var(--ink); }
.dm-trace span { font-size: 14px; color: var(--muted); }
.dm-reports { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-reports span { padding: 8px 12px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink); }
.dm-reports span::before { content: "↓ "; color: var(--brand-600); }
.dm-final-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line-2); }
.dm-final-cta .btn svg { width: 18px; height: 18px; }

/* ---------- Panel stanja ---------- */
.demo-state { background: #fbfcfe; border-left: 1px solid var(--line-2); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ds-block { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.ds-block.is-flash { animation: dsFlash 1.4s ease; }
@keyframes dsFlash {
  0% { box-shadow: 0 0 0 0 rgba(79,90,240,.0); border-color: var(--line); }
  20% { box-shadow: 0 0 0 4px rgba(79,90,240,.2); border-color: var(--brand-300); }
  100% { box-shadow: 0 0 0 0 rgba(79,90,240,0); border-color: var(--line); }
}
.ds-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.ds-head b { font-size: 14px; color: var(--ink); }
.ds-head small { font-size: 12px; font-weight: 600; color: var(--muted); }
.ds-vessel { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 8px; padding: 8px 0; border-top: 1px solid var(--line-2); position: relative; }
.ds-vessel > div span { display: block; font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.ds-vessel > div small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.ds-vessel em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ds-vessel i { grid-column: 1 / -1; grid-row: 2; display: block; height: 6px; border-radius: 99px; background: var(--brand-500); transition: width .6s cubic-bezier(.4,0,.2,1); box-shadow: inset 0 0 0 999px transparent; }
.ds-vessel::after { content: ""; grid-column: 1 / -1; grid-row: 2; height: 6px; border-radius: 99px; background: var(--line-2); z-index: -1; }
.ds-vessel { isolation: isolate; }
.ds-vessel--kljuk i { background: #f59e0b; }
.ds-vessel--meka i { background: var(--brand-300); }
.ds-vessel--destilat i { background: var(--brand-600); }
.ds-vessel--kupljeno i { background: #94a3b8; }
.ds-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; }
.ds-row span { font-weight: 700; color: var(--ink); line-height: 1.3; }
.ds-row small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.ds-row b { font-size: 15px; color: var(--ink); white-space: nowrap; }
.ds-due { color: var(--amber) !important; }
.ds-empty { font-size: 13px; color: var(--muted); }
.ds-log ol { display: flex; flex-direction: column; gap: 9px; }
.ds-log li { font-size: 12.5px; line-height: 1.45; color: var(--slate); padding-left: 12px; border-left: 2px solid var(--brand-100); }
.ds-log li:first-child { border-left-color: var(--leaf); }
.ds-log time { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); }

.demo-noscript { margin-top: 16px; text-align: center; color: var(--muted); }

/* ---------- Pravila ---------- */
.demo-rules { align-items: center; }
.demo-rules h2 { font-size: clamp(26px, 3.4vw, 38px); margin-top: 18px; }
.demo-rules__copy p { margin: 16px 0 26px; font-size: 18px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1140px) {
  .demo-app__body { grid-template-columns: minmax(0, 1fr) 290px; }
  .demo-side { display: none; }
}
@media (max-width: 900px) {
  .demo-app__body { grid-template-columns: 1fr; }
  .demo-state { border-left: 0; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .demo-state .ds-block:first-child, .demo-state .ds-log { grid-column: 1 / -1; }
  .demo-steps { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .demo-steps { grid-template-columns: repeat(6, auto); justify-content: space-between; gap: 4px; padding: 6px; }
  .demo-steps button { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 11px; text-align: center; }
  .demo-app { border-radius: 16px; }
  .demo-app__tag { display: none; }
  .demo-main { padding: 22px 18px 24px; }
  .dm-head { flex-direction: column; }
  .dm-head h3 { font-size: 21px; }
  .fields--wide, .dm-live, .dm-kpis, .dm-record { grid-template-columns: 1fr; }
  .demo-state { grid-template-columns: 1fr; padding: 14px; }
  .dm-trace li { grid-template-columns: 1fr; }
  .dm-trace time { grid-row: auto; }
  .dm-label { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
  .demo-steps button span:last-child { display: none; }
}
