:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --ink: #23262b;          /* grafit */
  --ink-soft: #5b6068;
  --line: #dcddd8;
  --accent: #173a6b;       /* tamnoplavi akcent */
  --accent-hover: #0f2b52;
  --accent-tint: #e8eef7;
  --error: #b42318;
  --graphite: #2b2e33;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* Logo */
.topbar { padding: 18px 0 6px; }
.logo {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

/* Prvi ekran */
.hero { padding: 18px 0 32px; }
.hero-grid { display: grid; gap: 28px; }

h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 8.4vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 750;
  text-wrap: balance;
  hyphens: manual;
}

.lead {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 1.06rem;
  max-width: 34em;
}

.hero-photo {
  margin: 0;
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  /* Grafitna površina dok fotografija ne postoji */
  background:
    radial-gradient(120% 80% at 70% 20%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(160deg, #3a3e45 0%, var(--graphite) 55%, #1e2024 100%);
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s ease;
}
.hero-photo.loaded img { opacity: 1; }
.hero-photo.missing img { display: none; }

/* Dugmad */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 26px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 650;
  font-size: 1.02rem;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:focus-visible,
input:focus-visible,
.option input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent-tint); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-soft); }
.btn-block { width: 100%; }
.btn.small { min-height: 46px; padding: 0 18px; font-size: .96rem; }

#cta { width: 100%; }

/* Obrazac */
.request {
  padding: 40px 0 56px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  scroll-margin-top: 0;
}
h2 {
  margin: 0 0 22px;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
h2:focus { outline: none; }

.field { margin: 0 0 26px; padding: 0; border: 0; min-width: 0; }

label, legend, .label-like {
  display: block;
  font-weight: 650;
  margin-bottom: 8px;
  padding: 0;
}
.optional { font-weight: 400; color: var(--ink-soft); }

input[type="text"] {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  font: inherit;
  font-size: 17px; /* sprječava zumiranje na iOS-u */
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  -webkit-appearance: none;
  appearance: none;
}
input[type="text"]::placeholder { color: #8a8f96; }
input[type="text"]:focus { border-color: var(--accent); background: #fff; }

.options { display: grid; gap: 10px; }
.option { position: relative; display: block; margin: 0; font-weight: 500; cursor: pointer; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option span {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s, background-color .15s;
}
.option span::before {
  content: "";
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid #9aa0a8;
  background: #fff;
}
.option input:checked + span {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 650;
}
.option input:checked + span::before {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 5px, #fff 6px);
}

.hint { margin: -2px 0 12px; color: var(--ink-soft); font-size: .95rem; }

.upload { width: 100%; margin: 0; }

.photo-preview {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.photo-preview img { width: 100%; max-height: 360px; object-fit: cover; }
.photo-actions { display: flex; gap: 10px; padding: 12px; }
.photo-actions .btn { flex: 1; margin: 0; }

.error {
  margin: 8px 0 0;
  color: var(--error);
  font-size: .95rem;
  font-weight: 600;
}
.field.invalid input[type="text"],
.field.invalid .option span { border-color: var(--error); }

/* Pregled upita */
.demo-note {
  margin: -10px 0 20px;
  padding: 10px 14px;
  font-size: .92rem;
  color: var(--ink-soft);
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}
.inquiry {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 6px 24px rgba(35, 38, 43, .06);
}
.inquiry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font-size: .92rem;
}
.inquiry-tag { font-weight: 700; letter-spacing: .02em; }
.inquiry-time { opacity: .85; }
.inquiry-list { margin: 0; padding: 4px 16px; }
.inquiry-list > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.inquiry-list > div:last-child { border-bottom: 0; }
.inquiry-list dt { font-size: .85rem; color: var(--ink-soft); margin-bottom: 2px; }
.inquiry-list dd { margin: 0; font-size: 1.12rem; font-weight: 650; overflow-wrap: anywhere; }
#pFotoNone { color: var(--ink-soft); font-weight: 500; }
.inquiry-photo { width: 100%; max-height: 420px; object-fit: cover; border-top: 1px solid var(--line); }

.footer { padding: 22px 0 32px; color: var(--ink-soft); font-size: .9rem; }

/* Računar: tekst lijevo, fotografija desno */
@media (min-width: 860px) {
  .wrap { padding: 0 32px; }
  .topbar { padding: 28px 0 10px; }
  .hero { padding: 40px 0 72px; }
  .hero-grid { grid-template-columns: 1fr 1.1fr; align-items: center; gap: 56px; }
  .hero-photo { aspect-ratio: 5 / 4; }
  #cta { width: auto; }
  .request { padding: 64px 0 80px; }
}
