/* ==========================================================
   Rezervacija: kalendar + termini + obrazac
   Koristi tokene iz style.css
   ========================================================== */

.page-booking main { padding-bottom: 96px; }
.page-booking [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bk-head { padding-top: 32px; padding-bottom: 36px; }
.back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  font-weight: 600; color: var(--muted); text-decoration: none;
}
.back:hover { color: var(--ink); }
.bk-head h1 { font-size: clamp(2.3rem, 1.6rem + 2.4vw, 3.4rem); font-weight: 700; margin-bottom: 12px; }
.bk-head .lead { margin-bottom: 0; max-width: 52ch; }
.demo-note {
  display: inline-flex; gap: 8px; align-items: center; margin-top: 18px;
  background: var(--yellow-50); color: #6B4E00; padding: 8px 14px; border-radius: 999px;
  font-weight: 600; font-size: .92rem;
}

.bk-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: start; }

/* ---------- Kalendar ---------- */
.cal-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 28px; box-shadow: var(--shadow); scroll-margin-top: 96px;
}
.cal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cal-title { font-size: 1.6rem; margin: 0; }
.cal-nav {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff;
  display: grid; place-items: center; font-size: 1.1rem; color: var(--ink); cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.cal-nav:hover:not(:disabled) { border-color: var(--ink); }
.cal-nav:active:not(:disabled) { transform: scale(.94); }
.cal-nav:disabled { opacity: .35; cursor: not-allowed; }

.cal-week, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-week { margin-bottom: 8px; }
.cal-week span { text-align: center; font-size: .82rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; }

.day {
  aspect-ratio: 1 / .92; border-radius: 16px; border: 0; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: inherit; color: var(--ink); background: none;
}
.day.pad { visibility: hidden; }
.day.off { color: #A9B7C2; font-size: .95rem; }
.dn { font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; line-height: 1; }
.dl { font-size: .7rem; font-weight: 700; letter-spacing: .02em; }

button.day { cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, background-color .2s; }
button.day.free { background: var(--teal-50); }
button.day.free .dl { color: #0B7A6F; }
button.day.some { background: var(--yellow-50); }
button.day.some .dl { color: #7A5A00; }
button.day.full { background: #F1F4F6; color: #8A9AA7; cursor: not-allowed; }
button.day.full .dn { text-decoration: line-through; text-decoration-thickness: 2px; }
button.day:not(.full):hover { transform: translateY(-2px); box-shadow: 0 10px 20px -14px rgb(23 50 74 / .6); }
button.day:not(.full):active { transform: scale(.96); }
button.day.sel { background: var(--ink); color: #fff; box-shadow: 0 12px 24px -12px rgb(23 50 74 / .7); }
button.day.sel .dl { color: #CFE0EC; }
button.day:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Učitavanje */
.day.sk { background: linear-gradient(90deg, #EEF3F6 0%, #F7FAFC 50%, #EEF3F6 100%); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .day.sk { animation: shimmer 1.2s linear infinite; }
}
@keyframes shimmer { to { background-position: -200% 0; } }
.day.sk.sk-static { animation: none; opacity: .55; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px; font-size: .9rem; color: var(--muted); font-weight: 600; }
.cal-legend span { display: inline-flex; align-items: center; gap: 8px; }
.lg { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.lg-free { background: var(--teal-50); outline: 1px solid #B6E5DE; }
.lg-some { background: var(--yellow-50); outline: 1px solid #F1DC8A; }
.lg-full { background: #F1F4F6; outline: 1px solid var(--line); }

.cal-error { margin-top: 18px; color: #B42318; font-weight: 600; }
.cal-error a { color: inherit; }
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* ---------- Desna strana ---------- */
.side { position: sticky; top: 100px; display: grid; gap: 18px; }
.side-empty, .side-day, .done {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 28px;
  scroll-margin-top: 96px;
}
.side-empty { text-align: left; }
.side-empty > i { font-size: 3rem; color: var(--teal); }
.side-empty h2, .side-day h2, .bk-form h2, .done h2 { font-size: 1.5rem; margin: 8px 0 8px; }
.side-empty p { color: var(--muted); }
.slot-info { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.slot-info li { display: grid; gap: 2px; padding: 14px 16px; background: var(--tint); border-radius: 14px; }
.slot-info span { color: var(--muted); font-size: .95rem; }

.day-hint { color: var(--muted); margin-bottom: 18px; }
.slots { display: grid; gap: 10px; }
.slot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 16px 20px; border-radius: 16px; cursor: pointer;
  font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line);
  transition: border-color .2s, background-color .2s, transform .2s var(--ease);
}
.slot:hover:not(.busy) { border-color: var(--teal); }
.slot:active:not(.busy) { transform: scale(.98); }
.st { font-family: var(--f-display); font-weight: 600; font-size: 1.25rem; }
.ss { font-weight: 700; font-size: .88rem; color: #0B7A6F; }
.slot.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.slot.on .ss { color: var(--yellow); }
.slot.busy { background: #F4F6F8; color: #8A9AA7; cursor: not-allowed; }
.slot.busy .st { text-decoration: line-through; }
.slot.busy .ss { color: #8A9AA7; }

/* ---------- Obrazac ---------- */
.bk-form { padding: 28px; scroll-margin-top: 96px; }
.bk-form h2 { margin-top: 0; margin-bottom: 18px; }
.pkgs { border: 0; padding: 0; margin: 0 0 6px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pkgs legend { font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.pkg { position: relative; cursor: pointer; }
.pkg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pkg span {
  display: grid; gap: 2px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); height: 100%;
  transition: border-color .2s, background-color .2s;
}
.pkg strong { font-size: .92rem; }
.pkg em { font-style: normal; font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; }
.pkg input:checked + span { border-color: var(--orange); background: var(--orange-50); }
.pkg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin: 16px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--orange); }
.pkg-err, .priv-err { display: none; margin-top: -2px; }
.pkg-err.show, .priv-err.show { display: block; }

.bk-form .grid-2 { gap: 14px 16px; margin-bottom: 14px; }
.bk-form > .field { margin-bottom: 14px; }

.summary { display: grid; gap: 6px; background: var(--tint); border-radius: 16px; padding: 16px 18px; margin: 18px 0; }
.summary:empty { display: none; }
.summary div { display: flex; justify-content: space-between; gap: 16px; }
.summary span { color: var(--muted); }
.summary strong { text-align: right; }
.sum-total { border-top: 1px dashed #C4D2DC; padding-top: 8px; margin-top: 4px; }
.sum-total strong { font-family: var(--f-display); font-size: 1.3rem; }

.bk-form .btn { width: 100%; }
.btn.loading { opacity: .75; cursor: progress; }
.form-error a { color: inherit; }

/* ---------- Potvrda ---------- */
.done { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 36px 28px; }
.done:focus { outline: none; }
.done-ico { font-size: 4rem; color: var(--orange); }
.done p { max-width: 42ch; }
.done .btn { margin-top: 8px; }
.done .btn i { font-size: 1.3rem; }

/* ---------- Responzivno ---------- */
@media (max-width: 960px) {
  .bk-grid { grid-template-columns: 1fr; }
  .side { position: static; }
}
@media (max-width: 767px) {
  .bk-head { padding-top: 16px; padding-bottom: 24px; }
  .cal-card, .side-empty, .side-day, .bk-form, .done { padding: 18px; }
  .cal-week, .cal-days { gap: 5px; }
  .day { border-radius: 12px; aspect-ratio: 1 / 1.05; }
  .dn { font-size: 1rem; }
  .dl { font-size: .62rem; }
  .cal-title { font-size: 1.3rem; }
  .pkgs { grid-template-columns: 1fr; }
  .pkg span { grid-template-columns: 1fr auto; align-items: center; }
}
