/* Rezervacije — apple-like design */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/inter-latin-700-normal.woff2') format('woff2');
}

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --blue: #0071e3;
  --blue-h: #0077ed;
  --green: #34c759;
  --red: #ff3b30;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.16);
}

* { box-sizing: border-box; }

/* `hidden` mora vedno zmagati nad eksplicitnim display (npr. .modal-backdrop) */
[hidden] { display: none !important; }

html { font-size: 18px; }
html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 620px at 50% -12%, #dfe8fb 0%, rgba(223, 232, 251, 0) 62%),
    linear-gradient(160deg, #eef2fa 0%, #f7f8fb 42%, #efeaf7 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 1rem;
  line-height: 1.5;
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.3rem; }
p { margin: 0; }

.muted { color: var(--ink-2); }
.small { font-size: 0.85rem; }
.sub { color: var(--ink-2); margin-bottom: 24px; }
.link { color: var(--blue); text-decoration: none; font-size: 0.95rem; }
.link:hover { text-decoration: underline; }

.spacer { flex: 1; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ---- cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

/* ---- buttons ---- */
.btn {
  appearance: none; border: none; cursor: pointer;
  font: inherit; font-weight: 600;
  padding: 11px 20px; border-radius: 980px;
  background: var(--blue); color: #fff;
  transition: background .15s ease, transform .05s ease, opacity .15s ease;
  letter-spacing: -0.01em;
}
.btn:hover { background: var(--blue-h); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn.primary { background: var(--blue); }
.btn.primary:hover { background: var(--blue-h); }

.btn.ghost {
  background: #e8e8ed; color: var(--ink);
}
.btn.ghost:hover { background: #dedee4; }

.btn.danger { background: transparent; color: var(--red); }
.btn.danger:hover { background: rgba(255, 59, 48, 0.08); }

.btn.wide { width: 100%; }
.btn.small { padding: 7px 14px; font-size: 0.85rem; }

.row { display: flex; gap: 12px; align-items: center; }
.row > .btn { flex: 1; }

/* ---- forms ---- */
label {
  display: block; font-weight: 600; font-size: 0.9rem;
  color: var(--ink); margin-bottom: 14px;
}
input, textarea, select {
  display: block; width: 100%;
  margin-top: 6px; padding: 11px 14px;
  font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}
textarea { resize: vertical; }
fieldset {
  border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 14px 16px; margin: 0 0 14px;
}
legend { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); padding: 0 6px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }

/* weekday checkboxes */
.weekdays { display: flex; flex-wrap: wrap; gap: 8px; }
.wd {
  cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-size: 0.85rem; font-weight: 600; color: var(--ink-2);
  background: #fff; transition: all .15s ease;
}
.wd input { display: none; }
.wd.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---- flashes ---- */
.flash { border-radius: var(--radius-s); padding: 10px 14px; font-size: 0.9rem; margin: 4px 0 14px; }
.flash.error { background: rgba(255, 59, 48, 0.09); color: #c71f17; }
.flash.ok { background: rgba(52, 199, 89, 0.12); color: #1e7e33; }

/* ---- auth ---- */
.auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-card { text-align: center; padding: 40px 32px; }
.auth-card form { text-align: left; margin-top: 8px; }
.logo {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 15px; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
}

/* ---- booking page ---- */
.booking-main { max-width: 760px; margin: 0 auto; padding: 40px 22px 80px; }
.booking-main h1 { margin-bottom: 4px; }

.booking-card { padding: 22px; }

.date-strip {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 4px 2px 12px; margin-bottom: 16px;
  scrollbar-width: thin;
}
.date-pill {
  appearance: none; cursor: pointer; border: 1px solid var(--border-strong);
  background: #fff; border-radius: 14px; padding: 10px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 74px; transition: all .15s ease; color: var(--ink);
  font-family: inherit;
}
.date-pill .dow { font-size: 0.78rem; color: var(--ink-3); font-weight: 600; text-transform: capitalize; }
.date-pill .dnum { font-size: 0.95rem; font-weight: 600; }
.date-pill:hover { border-color: var(--blue); }
.date-pill.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.date-pill.active .dow, .date-pill.active .dnum { color: #fff; }

.slot-area { min-height: 120px; }
.slot-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.slot {
  appearance: none; cursor: pointer; font-family: inherit;
  padding: 10px 16px; border-radius: 980px;
  border: 1px solid var(--border-strong); background: #fff;
  color: var(--ink); font-weight: 600; font-size: 0.92rem;
  transition: all .15s ease;
}
.slot:hover { border-color: var(--blue); color: var(--blue); }
.slot.selected { background: var(--blue); border-color: var(--blue); color: #fff; }
.day-heading { font-weight: 700; margin-bottom: 12px; color: var(--ink); }

/* ---- modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade .18s ease;
}
.modal {
  width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2, .9, .3, 1.2);
}
.modal h2 { margin-bottom: 4px; }
.modal form { margin-top: 14px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }

.check {
  width: 60px; height: 60px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; box-shadow: 0 6px 18px rgba(52, 199, 89, 0.35);
}
.success { text-align: center; }

/* ---- dashboard / admin ---- */
.app { min-height: 100vh; }
.dash-main { max-width: 820px; margin: 0 auto; padding: 36px 22px 80px; }

.tabs { display: flex; gap: 4px; margin: 8px 0 20px; border-bottom: 1px solid var(--border); }
.tab {
  appearance: none; border: none; background: none; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 0.95rem; color: var(--ink-2);
  padding: 10px 16px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.booking-list { display: flex; flex-direction: column; gap: 14px; }
.item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; display: flex; gap: 16px; align-items: flex-start;
}
.item .datebox {
  flex: 0 0 auto; min-width: 64px; text-align: center;
  background: #f2f2f5; border-radius: var(--radius-s); padding: 10px 8px;
}
.item .datebox .d { font-size: 1.25rem; font-weight: 700; line-height: 1; }
.item .datebox .m { font-size: 0.75rem; color: var(--ink-2); font-weight: 600; text-transform: uppercase; }
.item .time { font-size: 0.9rem; color: var(--ink-2); margin-top: 2px; }
.item .body { flex: 1; min-width: 0; }
.item .name { font-weight: 700; }
.item .contact { color: var(--ink-2); font-size: 0.88rem; margin-top: 2px; }
.item .note { color: var(--ink-3); font-size: 0.85rem; margin-top: 4px; font-style: italic; }
.item .actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 980px; text-transform: uppercase; letter-spacing: .04em;
}
.badge.upcoming { background: rgba(52, 199, 89, 0.14); color: #1e7e33; }
.badge.past { background: #e8e8ed; color: var(--ink-2); }
.badge.cancelled { background: rgba(255, 59, 48, 0.12); color: #c71f17; }

.section-title { font-weight: 700; font-size: 0.95rem; color: var(--ink-2); margin: 24px 0 12px; text-transform: uppercase; letter-spacing: .05em; }
.empty { text-align: center; color: var(--ink-3); padding: 40px 0; }

/* provider row (admin) */
.provider-row .slug { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; color: var(--blue); }

.settings-card { max-width: 560px; }

/* ---- home (pristajalna stran za stranke) ---- */
.home { display: flex; min-height: 100vh; }
.home-main { width: 100%; max-width: 560px; margin: 0 auto; padding: 56px 22px 80px; }
.home-hero { text-align: center; margin-bottom: 28px; }
.home-hero h1 { margin-bottom: 6px; }
.home-hero .sub { margin-bottom: 0; }

.logo.lg { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 18px; }

.home-card { padding: 22px; }
.home-card input[type="search"] {
  margin-bottom: 18px;
  background: #f2f2f5; border: 1px solid transparent; border-radius: 12px;
  padding: 13px 16px; font-size: 1rem;
}
.home-card input[type="search"]:focus {
  background: #fff; border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

.provider-grid { display: flex; flex-direction: column; gap: 10px; }
.provider-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: #fff; text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.provider-card:hover { border-color: var(--blue); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); }
.provider-card .provider-name { font-weight: 600; }
.provider-card .provider-cta { color: var(--blue); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }

.provider-login { text-align: center; margin-top: 24px; }
.provider-login a { color: var(--ink-3); text-decoration: none; font-size: 0.9rem; transition: color .15s ease; }
.provider-login a:hover { color: var(--blue); }
