/* Daktilora 132: boje i fontovi prema vizitki i letku LIBRODUX-a */
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(assets/fonts/inter-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(assets/fonts/inter-latin-ext-400.woff2) format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF; }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(assets/fonts/inter-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(assets/fonts/inter-latin-ext-600.woff2) format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF; }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(assets/fonts/inter-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(assets/fonts/inter-latin-ext-700.woff2) format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF; }
@font-face { font-family: Lora; font-weight: 700; font-display: swap; src: url(assets/fonts/lora-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: Lora; font-weight: 700; font-display: swap; src: url(assets/fonts/lora-latin-ext-700.woff2) format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF; }

:root {
  --burg: #4d2f32;
  --burg-deep: #351f22;
  --gold: #c99a3c;
  --gold-light: #ecc65a;
  --cream: #f7f3ec;
  --card: #fffdf9;
  --ink: #231a1b;
  --mute: #7a6b6c;
  --line: #e6ddd0;
  --ok: #2f7d4f;
  --bad: #b3261e;
  --radius: 14px;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: Lora, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--cream); color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--burg); }
button { font: inherit; }
[hidden] { display: none !important; }

/* ---------- gornja traka ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: var(--burg); color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font: 700 18px/1.1 var(--serif); letter-spacing: .01em; }
.brand-text small { font-size: 11px; letter-spacing: .08em; color: #e9d6b0; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.lic-badge { font-size: 13px; color: #f3e3bf; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }
.btn-gold { background: linear-gradient(135deg, #f3d886, var(--gold)); color: var(--burg-deep); }
.btn-gold:hover { box-shadow: 0 6px 18px rgba(201, 154, 60, .35); }
.btn-burg { background: var(--burg); color: #fff; }
.btn-burg:hover { background: var(--burg-deep); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-line { background: #fff; color: var(--burg); border-color: var(--line); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.offline { background: #fff4d6; color: #6b4b00; text-align: center; font-size: 14px; padding: 8px 16px; }

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(16px, 4vw, 40px) 56px; outline: none; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 18px clamp(16px, 4vw, 40px); font-size: 13px; color: var(--mute);
  border-top: 1px solid var(--line);
}

/* ---------- karta stupnjeva ---------- */
.hero-card {
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px); margin-bottom: 26px;
}
.hero-card h1 { margin: 0 0 6px; font: 700 clamp(24px, 3.2vw, 32px)/1.15 var(--serif); color: var(--burg); }
.hero-card p { margin: 0; color: var(--mute); }
.bar { height: 10px; border-radius: 99px; background: #efe6d8; overflow: hidden; margin-top: 14px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--burg)); border-radius: inherit; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }

.unit { margin-bottom: 26px; }
.unit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.unit-head h2 { margin: 0; font: 700 18px/1.3 var(--serif); }
.unit-head small { color: var(--mute); font-size: 13px; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 8px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-weight: 700; font-size: 15px; transition: transform .12s ease, box-shadow .12s ease;
}
.tile small { font-size: 10px; font-weight: 600; color: var(--mute); }
.tile:hover:not(.locked) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(77, 47, 50, .12); }
.tile.passed { background: #eef6f0; border-color: #cfe5d6; }
.tile.passed small { color: var(--ok); }
.tile.current { border: 2px solid var(--burg); box-shadow: 0 0 0 4px rgba(77, 47, 50, .08); }
.tile.locked { color: #b5a9a9; background: #f3eee6; cursor: not-allowed; }
.tile.paid-lock { cursor: pointer; }
.tile.paid-lock::after { content: '€'; position: absolute; top: 4px; right: 6px; font-size: 10px; color: var(--gold); }

/* ---------- vježba ---------- */
.practice { max-width: 980px; margin: 0 auto; }
.pr-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pr-head h1 { margin: 0; font: 700 22px/1.2 var(--serif); color: var(--burg); }
.pr-head p { margin: 2px 0 0; color: var(--mute); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.stat.warn b { color: var(--bad); }

.text {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 10px;
  font: 500 clamp(19px, 2.2vw, 24px)/1.75 var(--mono); letter-spacing: .02em;
  white-space: pre-wrap; word-break: break-word;
}
.text .c { border-radius: 3px; }
.text .ok { color: var(--ok); }
.text .bad { color: #fff; background: var(--bad); }
.text .cur { background: #f3e0b0; box-shadow: inset 0 -3px 0 var(--burg); }
.text .todo { color: #8e8080; }
.hint { margin: 0 0 14px; font-size: 14px; color: var(--mute); min-height: 21px; }
.hint b { color: var(--burg); }

/* tipkovnica */
.kb { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: #2b1d1f; border-radius: var(--radius); user-select: none; }
.kb-row { display: flex; gap: 6px; justify-content: center; }
.key {
  position: relative; flex: 1 1 0; max-width: 54px; min-width: 0; height: 46px;
  border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: 600 14px/1 var(--sans); color: #2b1d1f; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14);
  transition: transform .08s ease, outline-color .1s ease;
}
.key small { font-size: 10px; opacity: .65; margin-bottom: 2px; }
.key.wide { flex-grow: 1.7; max-width: 92px; font-size: 11px; }
.key.space { max-width: 360px; flex-grow: 8; }
.key.home::after { content: ''; position: absolute; bottom: 7px; width: 12px; height: 2px; border-radius: 2px; background: rgba(0, 0, 0, .45); }
.f-L5 { background: #f4d4d4; } .f-L4 { background: #fbe2bf; } .f-L3 { background: #f8efbd; } .f-L2 { background: #d6ead8; }
.f-R2 { background: #d1e6f2; } .f-R3 { background: #e0d9f4; } .f-R4 { background: #f2d8ec; } .f-R5 { background: #e8e0d2; }
.f-T, .f-x { background: #ece7e0; }
.key.next { outline: 3px solid var(--gold-light); outline-offset: 1px; transform: translateY(-2px); box-shadow: 0 0 0 6px rgba(236, 198, 90, .25); }
.key.next-shift { outline: 3px dashed var(--gold-light); outline-offset: 1px; }
.key.hit-ok { animation: hit-ok .25s ease; }
.key.hit-bad { animation: hit-bad .3s ease; }
@keyframes hit-ok { 50% { filter: brightness(1.25); } }
@keyframes hit-bad { 0%, 100% { transform: none; } 30% { transform: translateX(-3px); background: #f1a39d; } 60% { transform: translateX(3px); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--mute); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }

/* ---------- modalni prozor ---------- */
.modal { border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 24px)); background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(35, 26, 27, .35); }
.modal::backdrop { background: rgba(35, 26, 27, .55); backdrop-filter: blur(3px); }
.modal-body { padding: clamp(20px, 4vw, 30px); }
.modal h2 { margin: 0 0 6px; font: 700 24px/1.2 var(--serif); color: var(--burg); }
.modal p.lead { margin: 0 0 18px; color: var(--mute); }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.close-x { float: right; border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--mute); margin: -6px -6px 0 0; }

.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.field input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; margin: 10px 0; }
.check input { margin-top: 3px; accent-color: var(--burg); }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; background: #f1ebe1; padding: 4px; border-radius: 999px; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--mute); }
.tabs button.on { background: #fff; color: var(--burg); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 0; }

.packs { display: grid; gap: 10px; margin-bottom: 14px; }
.pack { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.pack input { accent-color: var(--burg); }
.pack div { flex: 1; }
.pack b { display: block; }
.pack small { color: var(--mute); }
.pack strong { font: 700 20px/1 var(--serif); color: var(--burg); white-space: nowrap; }
.pack.best { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(236, 198, 90, .25); }
.pack em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--burg-deep); background: var(--gold-light); padding: 2px 7px; border-radius: 99px; margin-left: 6px; }
.includes { margin: 0 0 12px; padding-left: 18px; font-size: 14px; color: var(--mute); columns: 2; }
details.r1 { margin: 8px 0; font-size: 14px; }
details.r1 summary { cursor: pointer; font-weight: 600; color: var(--burg); }

.result-big { font: 700 48px/1 var(--serif); margin: 6px 0 14px; }
.result-big.ok { color: var(--ok); } .result-big.bad { color: var(--bad); }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }

/* ---------- narudžba, provjera ---------- */
.status-card { max-width: 560px; margin: 30px auto; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 28px; }
.status-card h1 { font: 700 26px/1.2 var(--serif); color: var(--burg); margin: 10px 0; }
.status-card .icon { font-size: 44px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--burg); border-radius: 50%; margin: 0 auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- certifikat (A4 vodoravno) ---------- */
.cert-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cert-tools { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.certificate {
  width: min(100%, 1040px); aspect-ratio: 297 / 210; background: #fff; color: #231a1b;
  border: 1px solid var(--line); border-radius: 6px; padding: 4.5% 7%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  position: relative; box-shadow: 0 20px 50px rgba(35, 26, 27, .12);
  container-type: inline-size;
}
.certificate::before { content: ''; position: absolute; inset: 2.2%; border: 2px solid var(--gold); border-radius: 4px; pointer-events: none; }
.certificate::after { content: ''; position: absolute; inset: 3.2%; border: 1px solid rgba(201, 154, 60, .45); border-radius: 3px; pointer-events: none; }
.certificate .issuer { font: 600 2cqw/1.2 var(--sans); letter-spacing: .02em; }
.certificate .mark { width: 6cqw; margin: 1.6cqw 0 .6cqw; }
.certificate h1 { margin: 0; font: 700 4.2cqw/1.1 var(--serif); letter-spacing: .08em; color: var(--burg); }
.certificate .sub { margin: .8cqw 0 2.6cqw; font: 600 2cqw/1.3 var(--sans); }
.certificate .confirm { margin: 0; font-size: 1.6cqw; color: var(--mute); }
.certificate .name { margin: .8cqw 0; font: 700 3.6cqw/1.2 var(--serif); border-bottom: 1px solid var(--gold); padding: 0 3cqw .4cqw; }
.certificate .done { margin: .6cqw 0 2cqw; font-size: 1.75cqw; }
.certificate .facts { font-size: 1.7cqw; line-height: 1.75; }
.certificate .num { margin-top: 2cqw; font-size: 1.25cqw; color: var(--mute); }
.certificate .disc { margin-top: .6cqw; font-size: 1.15cqw; color: var(--mute); }

/* ---------- uži ekrani ---------- */
@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero-card { grid-template-columns: 1fr; }
  .key { height: 38px; font-size: 12px; }
  .lic-badge { display: none; }
}
@media (max-width: 560px) {
  .brand-text small { display: none; }
  .top-actions .btn { padding: 8px 12px; font-size: 13px; }
  .includes { columns: 1; }
  .result-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- ispis certifikata ---------- */
@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; }
  body > *:not(main), .cert-tools, .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  .certificate { width: 297mm; height: 210mm; border: 0; border-radius: 0; box-shadow: none; aspect-ratio: auto; }
}
