:root {
  color-scheme: light;
  --paper: #f4ecdd;
  --paper-deep: #e8d8bd;
  --sheet: #fffaf0;
  --ink: #1f1714;
  --soft-ink: #3d312d;
  --muted: #74665e;
  --line: #d2bea0;
  --line-strong: #9d8061;
  --oxblood: #7a2232;
  --oxblood-dark: #551622;
  --slate: #5f7181;
  --slate-dark: #263746;
  --slate-soft: #dce3e7;
  --brass: #b5812e;
  --blue: #223f5f;
  --error: #9e2035;
  --shadow: 0 24px 70px rgba(50, 35, 24, 0.22);
  font-family: "Iowan Old Style", "Source Serif 4", Georgia, serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scrollbar-color: var(--oxblood) var(--paper-deep);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--paper-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--oxblood);
  border: 3px solid var(--paper-deep);
  border-radius: 999px;
}

body {
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, rgba(122, 34, 50, 0.18) 0 9px, transparent 9px),
    repeating-linear-gradient(0deg, rgba(85, 22, 34, 0.035) 0 1px, transparent 1px 34px),
    radial-gradient(circle at 78% 16%, rgba(181, 129, 46, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(244, 236, 221, 0.86), rgba(244, 236, 221, 0.78) 44%, rgba(244, 236, 221, 0.94)),
    url("/static/bureau-background.webp?v=20260604c");
  background-position: left top, left top, center top, left top, center top;
  background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat;
  background-size: auto, auto, 980px 620px, auto, cover;
  background-attachment: scroll, scroll, scroll, scroll, fixed;
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

::selection {
  background: var(--oxblood);
  color: #fffaf0;
}

.topbar {
  align-items: center;
  background: rgba(31, 23, 20, 0.96);
  border-bottom: 1px solid rgba(255, 250, 240, 0.16);
  color: #fffaf0;
  display: flex;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px max(20px, calc((100vw - 1240px) / 2));
  position: sticky;
  top: 0;
  z-index: 3;
}

.topbar nav {
  align-items: center;
  display: flex;
  gap: 16px;
}

.topbar a {
  text-decoration: none;
}

.topbar nav a {
  color: #e9d7b8;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brand {
  align-items: center;
  display: inline-flex;
  flex: 0 1 auto;
  gap: 12px;
  min-width: 0;
}

.brand img {
  display: block;
  filter: none;
  height: 48px;
  width: 48px;
}

.brand-wordmark {
  align-items: baseline;
  color: #fff2d7;
  display: inline-flex;
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 2.14rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.brand-wordmark b {
  color: var(--brass);
  font: inherit;
}

.topbar select,
select,
input {
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(244, 236, 221, 0.96));
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--ink);
  min-height: 42px;
  outline: none;
  padding: 9px 36px 9px 12px;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--oxblood) 50%),
    linear-gradient(135deg, var(--oxblood) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(244, 236, 221, 0.96));
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 13px) 18px,
    0 0;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px, 100% 100%;
}

input:focus,
select:focus {
  border-color: var(--oxblood);
  box-shadow: 0 0 0 3px rgba(122, 34, 50, 0.16);
}

main,
footer {
  margin: 0 auto;
  max-width: 1240px;
  padding-left: 28px;
  padding-right: 28px;
}

.studio {
  align-items: start;
  display: grid;
  gap: 52px;
  grid-template-columns: minmax(0, 1.06fr) minmax(378px, 0.72fr);
  min-height: max(690px, calc(100svh - 126px));
  padding-bottom: 58px;
  padding-top: 58px;
  position: relative;
}

.studio::after {
  background: url("/static/bureau-emblem.png?v=20260604c") center / contain no-repeat;
  content: "";
  height: min(46vw, 430px);
  opacity: 0.1;
  pointer-events: none;
  position: absolute;
  right: 300px;
  top: 255px;
  transform: rotate(-4deg);
  width: min(46vw, 430px);
  z-index: 0;
}

.studio::before {
  border: 2px solid rgba(122, 34, 50, 0.42);
  color: rgba(122, 34, 50, 0.58);
  content: "HITNA AKADEMSKA SANACIJA";
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.74rem;
  font-weight: 900;
  left: 22px;
  padding: 7px 10px;
  position: absolute;
  text-transform: uppercase;
  top: 30px;
  transform: rotate(-3deg);
}

.studio-copy {
  max-width: 720px;
  padding-top: 40px;
  position: relative;
  z-index: 1;
}

.kicker {
  color: var(--oxblood);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  margin: 0 0 14px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  color: var(--ink);
  font-size: 3.72rem;
  line-height: 1;
  margin-bottom: 20px;
  max-width: 820px;
}

h2 {
  font-size: 2.2rem;
  line-height: 1.1;
  margin-bottom: 12px;
}

.lead {
  color: var(--soft-ink);
  font-size: 1.26rem;
  line-height: 1.55;
  max-width: 670px;
}

.document-focus {
  border-top: 2px solid var(--ink);
  display: grid;
  gap: 15px;
  margin-top: 30px;
  max-width: 700px;
  padding-top: 20px;
}

.focus-label {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  margin-bottom: 0;
  text-transform: uppercase;
}

.focus-pair {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.focus-item {
  background: rgba(255, 250, 240, 0.58);
  border-left: 5px solid var(--oxblood);
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px 14px 14px 16px;
}

.focus-item:last-child {
  border-left-color: var(--slate);
}

.focus-item strong {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 900;
}

.focus-item span,
.document-line {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.45;
}

.document-line {
  align-items: baseline;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
  padding-top: 13px;
}

.document-line span {
  color: var(--oxblood);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.document-line b {
  color: var(--ink);
  font-weight: 800;
}

.assurances {
  display: flex;
  flex-wrap: wrap;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  gap: 9px;
  margin-top: 28px;
}

.assurances span,
.badge {
  background: #fff3d8;
  border: 1px solid #d7b36f;
  border-radius: 3px;
  color: #513611;
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 850;
  padding: 8px 11px;
}

.assurances span {
  align-items: center;
  gap: 7px;
}

.assurances b {
  font: inherit;
}

.assurances img {
  block-size: 18px;
  flex: 0 0 18px;
  inline-size: 18px;
}

.upload {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(246, 236, 216, 0.98));
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  display: grid;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  gap: 16px;
  margin-top: 24px;
  padding: 28px;
  position: relative;
  z-index: 1;
}

.upload::before {
  background: var(--oxblood);
  color: #fffaf0;
  content: "PRIJEM RUKOPISA";
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  padding: 7px 10px;
  position: absolute;
  right: 18px;
  text-transform: uppercase;
  top: -17px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.88rem;
  font-weight: 850;
  gap: 7px;
}

.upload select {
  width: 100%;
}

.dropzone {
  background:
    repeating-linear-gradient(135deg, rgba(122, 34, 50, 0.045) 0 1px, transparent 1px 13px),
    #fffaf0;
  border: 2px dashed var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  gap: 8px;
  min-height: 224px;
  padding: 18px;
  place-content: center;
  text-align: center;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dropzone span {
  color: var(--oxblood);
}

.dropzone strong {
  font-size: 1.34rem;
}

.dropzone small {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.dropzone.has-file small {
  align-items: center;
  color: var(--ink);
  display: grid;
  gap: 7px;
  justify-items: center;
}

.file-ready {
  color: var(--slate);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.file-selected-name {
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.file-kind {
  background: #fff;
  border: 1px solid var(--slate);
  color: var(--slate-dark);
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1;
  padding: 7px 10px;
}

.dropzone.is-dragover,
.dropzone.has-file {
  background:
    linear-gradient(180deg, rgba(220, 227, 231, 0.84), rgba(255, 250, 240, 0.94)),
    #fffaf0;
  border-color: var(--slate);
  border-style: solid;
  box-shadow: inset 0 0 0 2px rgba(95, 113, 129, 0.28);
}

.dropzone.is-invalid {
  border-color: var(--error);
  box-shadow: inset 0 0 0 2px rgba(158, 32, 53, 0.24);
}

.dropzone .formats {
  color: inherit;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
}

.dropzone .formats b {
  background: #fffaf0;
  border: 1px solid var(--line);
  color: var(--slate-dark);
  font-size: 0.76rem;
  line-height: 1;
  padding: 7px 9px;
}

.dropzone.has-file .formats {
  display: none;
}

.dropzone input {
  block-size: 1px;
  inline-size: 1px;
  opacity: 0;
  position: absolute;
}

button,
.download {
  align-items: center;
  background: var(--oxblood);
  border: 2px solid var(--oxblood-dark);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  color: #fffaf0;
  cursor: pointer;
  display: inline-flex;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 950;
  justify-content: center;
  min-height: 52px;
  padding: 12px 16px;
  text-decoration: none;
  text-transform: uppercase;
}

button:not(.program):hover,
.download:hover {
  background: var(--oxblood-dark);
}

button:disabled {
  background: #988d80;
  border-color: #7f756a;
  cursor: progress;
}

button.secondary-action {
  background: #fffaf0;
  border: 2px solid var(--line-strong);
  box-shadow: none;
  color: var(--slate-dark);
}

button.secondary-action:hover {
  background: #efe4cf;
  color: var(--slate-dark);
}

.legal {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: 0;
}

.analysis,
.dashboard {
  border-top: 2px solid var(--ink);
  padding-bottom: 68px;
  padding-top: 60px;
}

.analysis header,
.dashboard header {
  max-width: 740px;
}

#analysis-summary {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
}

.programs {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.program {
  align-items: start;
  background: var(--sheet);
  border: 2px solid var(--line-strong);
  box-shadow: none;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 14px;
  justify-content: stretch;
  min-height: 308px;
  padding: 22px;
  position: relative;
  text-align: left;
  text-transform: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.program[aria-pressed="true"] {
  background:
    linear-gradient(180deg, rgba(255, 243, 216, 0.64), var(--sheet) 64%);
  border-color: var(--oxblood);
  box-shadow: inset 0 0 0 3px rgba(122, 34, 50, 0.18), 0 18px 36px rgba(50, 35, 24, 0.14);
}

.program:hover:not([aria-disabled="true"]) {
  border-color: var(--oxblood);
  box-shadow: 0 18px 36px rgba(50, 35, 24, 0.14);
  transform: translateY(-2px);
}

.program[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
}

.program .price {
  align-self: end;
  color: var(--slate-dark);
  font-size: 2.15rem;
  font-weight: 950;
  margin-top: auto;
}

.program h3 {
  font-size: 1.46rem;
  margin-bottom: 0;
}

.program p {
  color: var(--muted);
  line-height: 1.46;
  margin-bottom: 0;
}

.program .badge {
  justify-self: start;
}

.checkout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 420px);
  margin-top: 24px;
}

#checkout-note {
  background: rgba(255, 250, 240, 0.62);
  border-left: 5px solid var(--brass);
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
  margin: 0;
  padding: 12px 0 12px 16px;
}

#stripe {
  display: grid;
  gap: 14px;
  min-height: 54px;
}

.stripe-status {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.45;
}

.stripe-checkout {
  inline-size: 100%;
}

.stripe-embedded-checkout {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(246, 236, 216, 0.98));
  border: 2px solid var(--line-strong);
  box-shadow: 0 16px 34px rgba(50, 35, 24, 0.12);
  min-height: 420px;
  padding: 14px;
}

.active-job {
  background: var(--sheet);
  border: 2px solid var(--line-strong);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  margin-top: 26px;
  padding: 24px;
}

.report-viewer {
  background:
    linear-gradient(90deg, rgba(122, 34, 50, 0.18) 0 7px, transparent 7px),
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(246, 236, 216, 0.98));
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  margin-top: 26px;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.report-viewer::before {
  background: var(--slate-dark);
  color: #fffaf0;
  content: "ZAPISNIK";
  font-size: 0.72rem;
  font-weight: 950;
  padding: 7px 10px;
  position: absolute;
  right: 18px;
  text-transform: uppercase;
  top: -1px;
}

.report-viewer-head {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.report-viewer h3 {
  font-size: 1.45rem;
  margin-bottom: 0;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.report-actions button {
  min-height: 42px;
  padding: 9px 13px;
}

.report-actions .print-action {
  background: var(--slate-dark);
  border-color: #172531;
}

.report-actions .print-action:hover {
  background: #172531;
}

.report-actions button:disabled {
  cursor: not-allowed;
}

.report-message {
  color: var(--muted);
  line-height: 1.45;
  margin: 12px 0 0;
}

.report-frame {
  background: var(--paper);
  border: 2px solid var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.7);
  display: block;
  height: min(1120px, 82vh);
  margin-top: 16px;
  width: 100%;
}

.job-head {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.job-head h3 {
  font-size: 1.35rem;
  margin-bottom: 7px;
  overflow-wrap: anywhere;
}

.job-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.status-badge[data-status="running"],
.status-badge[data-status="queued"] {
  background: #d8e4f0;
  border-color: #a9bfd4;
  color: var(--blue);
}

.status-badge[data-status="complete"] {
  background: var(--slate-soft);
  border-color: #b4c9ba;
  color: var(--slate-dark);
}

.status-badge[data-status="failed"] {
  background: #f1d8dc;
  border-color: #d59aa5;
  color: var(--error);
}

.bar {
  background: #e1d2ba;
  border: 1px solid var(--line-strong);
  height: 15px;
  margin-top: 22px;
  overflow: hidden;
}

.bar span {
  background: linear-gradient(90deg, var(--oxblood), var(--brass), var(--slate));
  display: block;
  height: 100%;
  min-width: 8px;
  transition: width 240ms ease;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.download.secondary {
  background: transparent;
  border: 1px solid var(--slate);
  color: var(--slate-dark);
}

.error {
  background: #f4d8de;
  border: 2px solid #d59aa5;
  color: var(--error);
  line-height: 1.45;
  margin-top: 14px;
  padding: 12px;
}

.local-jobs {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.local-job {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 0;
}

.local-job-main {
  display: grid;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 0;
}

.local-job-main strong {
  overflow-wrap: anywhere;
}

.local-job-main small {
  color: var(--muted);
}

.local-job-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.local-job-actions button {
  min-height: 38px;
  padding: 7px 11px;
}

footer {
  align-items: end;
  border-top: 2px solid var(--ink);
  color: var(--muted);
  display: flex;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  gap: 28px;
  justify-content: space-between;
  line-height: 1.5;
  padding-bottom: 42px;
  padding-top: 24px;
}

.footer-identity {
  display: grid;
  gap: 4px;
  max-width: 680px;
  min-width: 0;
}

.author-name,
.author-title,
.footer-note {
  margin-bottom: 0;
}

.author-name {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 950;
}

.author-title {
  color: var(--oxblood);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.footer-note {
  font-size: 0.88rem;
}

.social-links {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.social-links a {
  background: rgba(255, 250, 240, 0.58);
  border: 1px solid var(--line-strong);
  color: var(--slate-dark);
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1;
  padding: 9px 10px;
  text-decoration: none;
  text-transform: uppercase;
}

.social-links a:hover {
  background: #fffaf0;
  border-color: var(--oxblood);
  color: var(--oxblood);
}

.policy {
  max-width: 840px;
  padding-bottom: 72px;
  padding-top: 72px;
}

.policy section {
  border-top: 1px solid var(--line);
  line-height: 1.65;
  padding-top: 24px;
}

@media (max-width: 900px) {
  body {
    background-position: left top, left top, center top, left top, center top;
    background-size: auto, auto, 740px 520px, auto, auto 100vh;
    background-attachment: scroll;
  }

  h1 {
    font-size: 2.65rem;
  }

  .studio,
  .checkout {
    grid-template-columns: 1fr;
  }

  .studio {
    gap: 28px;
    min-height: 0;
  }

  .studio::after {
    height: 310px;
    opacity: 0.1;
    right: 18px;
    top: 380px;
    width: 310px;
  }

  .focus-pair {
    grid-template-columns: 1fr;
  }

  .programs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  main,
  footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar nav {
    gap: 9px;
  }

  .brand {
    gap: 9px;
  }

  .brand img {
    height: 40px;
    width: 40px;
  }

  .brand-wordmark {
    font-size: 1.48rem;
  }

  h1 {
    font-size: 2.18rem;
  }

  h2 {
    font-size: 1.78rem;
  }

  .lead {
    font-size: 1.08rem;
  }

  .upload,
  .active-job {
    padding: 18px;
  }

  .studio::before {
    left: 18px;
    top: 18px;
  }

  .studio::after {
    display: none;
  }

  .job-head,
  .local-job,
  .report-viewer-head {
    align-items: start;
    flex-direction: column;
  }

  .local-job-actions,
  .report-actions {
    justify-content: flex-start;
  }

  footer {
    align-items: start;
    flex-direction: column;
  }

  .social-links {
    justify-content: flex-start;
  }
}
