/* MajstorPapiri — zajednički stilovi (landing + app + print) */

:root {
  --navy: #16233a;
  --navy-2: #1f3253;
  --amber: #ffb020;
  --amber-dark: #e09000;
  --paper: #faf7f0;
  --ink: #21262e;
  --muted: #6b7280;
  --line: #d8d4c8;
  --ok: #1e8e5a;
  --err: #c0392b;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Barlow", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3, .display {
  font-family: "Archivo Black", "Barlow", sans-serif;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
a { color: var(--navy-2); }
img { max-width: 100%; }

.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  padding: 14px 0;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 3px solid var(--amber);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo {
  font-family: "Archivo Black", sans-serif;
  font-size: 1.25rem; color: #fff; text-decoration: none; white-space: nowrap;
}
.logo span { color: var(--amber); }
.nav a { color: #e8ecf5; text-decoration: none; margin-left: 18px; font-weight: 600; font-size: 0.95rem; }
.nav a:hover { color: var(--amber); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--amber);
  color: var(--navy);
  font-weight: 800;
  font-family: "Barlow", sans-serif;
  border: none;
  border-radius: var(--radius);
  padding: 13px 22px;
  font-size: 1.02rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.06s ease, background 0.15s ease;
}
.btn:hover { background: var(--amber-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn.secondary { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn.secondary:hover { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.5); }
.btn.ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn.small { padding: 8px 14px; font-size: 0.9rem; }
.btn.wa { background: #25d366; color: #fff; }
.btn.wa:hover { background: #1faf55; }

/* ---------- Landing ---------- */
.hero {
  background: var(--navy);
  color: #fff;
  padding: 64px 0 72px;
  background-image: repeating-linear-gradient(-45deg, transparent 0 34px, rgba(255,176,32,0.05) 34px 38px);
}
.hero h1 { font-size: clamp(1.7rem, 4.6vw, 3rem); color: #fff; max-width: 18ch; }
.hero h1 em { color: var(--amber); font-style: normal; }
.hero p.lead { font-size: 1.2rem; color: #cfd8ea; max-width: 56ch; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero .mini-note { color: #93a1bd; font-size: 0.9rem; margin-top: 12px; }

.section { padding: 56px 0; }
.section.alt { background: #f1ede2; }
.section h2 { font-size: clamp(1.4rem, 3vw, 2rem); color: var(--navy); }
.kicker {
  color: var(--amber-dark); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 0.85rem; margin-bottom: 8px;
}

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin-top: 30px; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; position: relative;
}
.step .num {
  position: absolute; top: -16px; left: 18px;
  background: var(--amber); color: var(--navy);
  font-family: "Archivo Black", sans-serif;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.step h3 { margin-top: 10px; font-size: 1.05rem; color: var(--navy); }
.step p { color: var(--muted); margin: 0; font-size: 0.96rem; }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; margin-top: 30px; align-items: stretch; }
.plan {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column;
}
.plan.featured { border-color: var(--amber); box-shadow: 0 8px 28px rgba(22,35,58,0.12); }
.plan .badge {
  align-self: flex-start; background: var(--amber); color: var(--navy);
  font-weight: 800; font-size: 0.75rem; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase; margin-bottom: 10px;
}
.plan h3 { color: var(--navy); font-size: 1.15rem; }
.plan .price { font-family: "Archivo Black", sans-serif; font-size: 2rem; color: var(--navy); }
.plan .price small { font-family: "Barlow", sans-serif; font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.plan ul { padding-left: 20px; color: var(--ink); flex: 1; }
.plan li { margin: 6px 0; }

.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; color: var(--navy); }
.faq p { color: var(--ink); margin-bottom: 4px; }

.site-footer { background: var(--navy); color: #93a1bd; padding: 28px 0; font-size: 0.9rem; }
.site-footer a { color: #cfd8ea; margin-right: 14px; }

/* ---------- App ---------- */
.app-main { padding: 26px 0 90px; }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 20px;
}
.panel h2 { font-size: 1.2rem; color: var(--navy); }
.hint { color: var(--muted); font-size: 0.92rem; }

label { display: block; font-weight: 700; margin: 14px 0 4px; font-size: 0.95rem; }
label .opt { color: var(--muted); font-weight: 500; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 130px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--amber); border-color: var(--amber); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.check b { display: block; }
.check .hint { display: block; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.msg { padding: 12px 14px; border-radius: 8px; margin: 12px 0; font-weight: 600; display: none; }
.msg.err { background: #fdecea; color: var(--err); display: block; }
.msg.ok { background: #e7f6ee; color: var(--ok); display: block; }
.msg.info { background: #fff7e0; color: #8a6100; display: block; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 9px 18px; font-weight: 700; cursor: pointer; font-size: 0.95rem; color: var(--ink);
}
.tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.rec-btn { display: inline-flex; align-items: center; gap: 8px; }
.rec-btn.recording { background: var(--err); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.75; } }

.pos-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.95rem; }
.pos-table th { text-align: left; border-bottom: 2px solid var(--navy); padding: 8px 6px; font-size: 0.85rem; }
.pos-table td { border-bottom: 1px solid var(--line); padding: 6px 4px; vertical-align: top; }
.pos-table input, .pos-table textarea { padding: 7px 8px; font-size: 0.92rem; }
.pos-table textarea { min-height: 54px; }
.pos-table .del { background: none; border: none; color: var(--err); font-size: 1.2rem; cursor: pointer; padding: 4px; }
.table-wrap { overflow-x: auto; }
.totals-line { text-align: right; font-weight: 700; margin-top: 10px; }

.hinweis {
  background: #fff7e0; border-left: 4px solid var(--amber);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 14px 0;
}
.hinweis b { color: #8a6100; }

.archive-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 16px; margin-bottom: 8px; flex-wrap: wrap;
}
.archive-item .meta { font-size: 0.9rem; color: var(--muted); }
.doc-type-a { color: var(--navy-2); font-weight: 800; }
.doc-type-r { color: var(--ok); font-weight: 800; }

/* ---------- Dokument (pregled + print) ---------- */
.doc-sheet {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(22,35,58,0.08);
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 52px;
  font-family: "Barlow", "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  color: #111;
  line-height: 1.5;
}
.doc-sheet .d-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 26px; }
.doc-sheet .d-firm { text-align: right; font-size: 12.5px; color: #333; }
.doc-sheet .d-firm .fname { font-weight: 800; font-size: 15px; color: #000; }
.doc-sheet .d-logo img { max-height: 70px; max-width: 200px; }
.doc-sheet .d-absender { font-size: 9.5px; color: #666; border-bottom: 1px solid #ccc; padding-bottom: 2px; margin-bottom: 6px; }
.doc-sheet .d-kunde { min-height: 70px; font-size: 14px; white-space: pre-line; }
.doc-sheet .d-meta { text-align: right; font-size: 12.5px; margin: 14px 0 6px; }
.doc-sheet .d-meta td { padding: 1px 0 1px 14px; }
.doc-sheet h1.d-title { font-family: "Barlow", sans-serif; font-weight: 800; font-size: 21px; margin: 26px 0 4px; color: #000; letter-spacing: 0; }
.doc-sheet .d-nr { font-size: 13px; color: #444; margin-bottom: 16px; }
.doc-sheet .d-text { margin: 14px 0; white-space: pre-line; }
.doc-sheet table.d-pos { width: 100%; border-collapse: collapse; margin: 18px 0 8px; font-size: 13.5px; }
.doc-sheet table.d-pos th { border-bottom: 1.5px solid #000; text-align: left; padding: 6px 6px; font-size: 12px; }
.doc-sheet table.d-pos td { border-bottom: 1px solid #ddd; padding: 7px 6px; vertical-align: top; }
.doc-sheet .num-col { text-align: right; white-space: nowrap; }
.doc-sheet .d-sums { width: 100%; max-width: 320px; margin-left: auto; font-size: 13.5px; border-collapse: collapse; }
.doc-sheet .d-sums td { padding: 4px 6px; }
.doc-sheet .d-sums .grand { border-top: 2px solid #000; font-weight: 800; font-size: 15px; }
.doc-sheet .d-legal { font-size: 12px; color: #333; margin-top: 16px; }
.doc-sheet .d-foot {
  margin-top: 40px; border-top: 1px solid #bbb; padding-top: 10px;
  font-size: 10.5px; color: #555; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
@media (max-width: 700px) { .doc-sheet { padding: 26px 18px; } }

/* ---------- Print ---------- */
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: absolute; inset: 0; }
  .doc-sheet { border: none; box-shadow: none; max-width: none; padding: 10mm 12mm; font-size: 12.5px; }
  @page { size: A4; margin: 8mm; }
}
