/* Delavnica Coach – temna stran fitnesa, modri gradient iz logotipa, krepka grotesk pisava.
   Postavitev: ena kolona za telefon, spodnja navigacija, kartice kot postaje v fitnesu. */
:root {
  --bg: #0A0E16;
  --surface: #111827;
  --surface-2: #172033;
  --line: #243048;
  --text: #F2F5FA;
  --muted: #8E9AB0;
  --blue: #1E7BE6;
  --cyan: #18B1EA;
  --deep: #1441B6;
  --grad: linear-gradient(135deg, var(--cyan), var(--deep));
  --ok: #2BB673;
  --warn: #F2A93B;
  --bad: #EF5A5F;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  padding-bottom: calc(84px + var(--safe-b));
}
body[data-auth="out"] { padding-bottom: 24px; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2em; }
li + li { margin-top: 4px; }

/* ---------------------------------------------------------------- vrhnja vrstica */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: rgba(10, 14, 22, .86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand span { font-weight: 800; letter-spacing: .32em; font-size: 12px; text-transform: uppercase; color: var(--cyan); }
.demo-badge { display: none; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--warn); border: 1px solid var(--warn); border-radius: 99px; padding: 2px 8px; }
.is-demo .demo-badge { display: inline-block; }
.avatar {
  margin-left: auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad);
}
.avatar:hover { text-decoration: none; }
.avatar.sm { width: 32px; height: 32px; margin: 0; flex: none; font-size: 14px; }

/* ---------------------------------------------------------------- zasloni */
main { outline: none; }
.screen {
  max-width: 640px; margin: 0 auto; padding: 20px 16px 32px;
  display: flex; flex-direction: column; gap: 14px;
}
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--cyan);
}
.h1 { font-size: clamp(28px, 7vw, 38px); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
.h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.display { font-size: clamp(40px, 12vw, 64px); font-weight: 800; line-height: .98; letter-spacing: -.035em; }
.lead { color: #C3CBDA; font-size: 17px; max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.mt { margin-top: 10px; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.back { font-weight: 600; font-size: 15px; }

.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- kartice */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.card.tight { padding: 14px 16px; }
.card h3 { font-size: 18px; font-weight: 700; }
.card.notice { border-color: rgba(242, 169, 59, .45); background: linear-gradient(180deg, rgba(242,169,59,.08), transparent 60%), var(--surface); }
.card.demo { border-style: dashed; }
.hero-card {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(24,177,234,.22), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(20,65,182,.30), transparent 60%),
    var(--surface-2);
  border-color: #2A3A5C;
  gap: 12px;
}
details.card > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 400; font-size: 22px; line-height: 1; }
details.card[open] > summary::after { content: "–"; }
details.card > summary small, .list-item small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- gumbi */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 99px;
  font: 700 13px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: #fff;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.primary { background: var(--blue); box-shadow: 0 8px 24px -10px rgba(30,123,230,.8); }
.btn.primary:hover { background: #2B88F0; }
.btn.ghost { background: transparent; border-color: rgba(242,245,250,.5); }
.btn.ghost:hover { border-color: #fff; background: rgba(255,255,255,.04); }
.btn.danger { background: transparent; border-color: rgba(239,90,95,.6); color: #F3B4B6; }
.btn.danger:hover { background: rgba(239,90,95,.12); border-color: var(--bad); }
.btn.sm { min-height: 38px; padding: 0 16px; font-size: 11px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--cyan); font: inherit; cursor: pointer; text-align: left; }

/* ---------------------------------------------------------------- pills, statusi */
.pills, .meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-block; padding: 7px 14px; border-radius: 99px; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,.04); border: 1px solid rgba(242,245,250,.22); color: #D8DEEA;
}
.pill.neg { border-color: rgba(239,90,95,.4); color: #F3B4B6; }
.pill.tiny { padding: 1px 8px; font-size: 11px; vertical-align: middle; }
.status {
  display: inline-block; white-space: nowrap; padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(24,177,234,.14); color: var(--cyan);
}
.status.ok { background: rgba(43,182,115,.15); color: var(--ok); }
.status.warn { background: rgba(242,169,59,.15); color: var(--warn); }
.status.bad { background: rgba(239,90,95,.15); color: var(--bad); }
.match { color: var(--ok); font-weight: 600; }
.level { text-transform: capitalize; }

/* ---------------------------------------------------------------- intenzivnost, napredek */
.intensity {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
}
.intensity div { background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.hero-card .intensity div { background: rgba(10,14,22,.55); }
.intensity span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.intensity b { font-size: 14px; font-weight: 600; }
.progress { height: 8px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }

/* ---------------------------------------------------------------- seznami */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--text);
}
a.list-item:hover { text-decoration: none; border-color: #34466B; }
.chev { color: var(--muted); font-size: 22px; }
.dot {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); font-size: 14px; font-weight: 800; color: #fff;
}
.dot.done { background: var(--grad); border-color: transparent; }

/* ---------------------------------------------------------------- program */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
tr:last-child td { border-bottom: 0; }
.weeks td small { display: block; color: var(--muted); font-size: 12px; }
.weeks tr.now td { background: rgba(30,123,230,.12); }
.weeks tr.now td:first-child { box-shadow: inset 3px 0 0 var(--cyan); }
.sched { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.sched dt { font-weight: 700; color: var(--muted); font-size: 14px; }
.sched dd { margin: 0; }
.ex-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ex-list li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.ex-list small { display: block; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ex-list .note, .note { color: var(--warn); font-size: 13px; }
.code {
  flex: none; min-width: 36px; height: 28px; padding: 0 6px; border-radius: 8px;
  display: inline-grid; place-items: center; font-weight: 800; font-size: 13px;
  background: rgba(255,255,255,.06); color: #fff;
}
.c-A { background: var(--blue); }
.c-B { background: #2E5BB8; }
.c-C { background: #3B4E78; }
.c-D { background: #22334F; }
.cond { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.cond p { color: #C3CBDA; font-size: 14px; margin-top: 4px; }
.score { color: var(--cyan) !important; font-weight: 600; }
.vid {
  display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; color: #fff; background: rgba(239,90,95,.16); border: 1px solid rgba(239,90,95,.45); white-space: nowrap;
}
.vid:hover { text-decoration: none; background: rgba(239,90,95,.28); }
.vid.own { background: rgba(239,90,95,.85); border-color: transparent; }
.ex-list .vid { margin-left: 6px; vertical-align: 2px; }
.ex-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.video-row input { min-width: 0; }
.tips { color: #C3CBDA; font-size: 14px; }
.rules li { font-size: 14px; color: #C3CBDA; }
.tempo-note { border-left: 3px solid var(--cyan); padding-left: 12px; }
.week-links { display: flex; gap: 6px; flex-wrap: wrap; }
.wk {
  min-width: 44px; height: 34px; padding: 0 10px; border-radius: 99px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 700;
}
.wk:hover { text-decoration: none; border-color: #3A4D75; }
.wk.done { background: rgba(43,182,115,.16); border-color: rgba(43,182,115,.5); color: var(--ok); }
.wk.now { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }

/* ---------------------------------------------------------------- knjižnica */
.filter { display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.prog-card { color: var(--text); transition: border-color .2s ease, transform .15s ease; }
.prog-card:hover { text-decoration: none; border-color: #3A4D75; transform: translateY(-2px); }
.prog-card h3 { font-size: 22px; font-weight: 800; }
.days {
  font-weight: 800; font-size: 22px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cta-ai { background: radial-gradient(100% 120% at 100% 0%, rgba(24,177,234,.16), transparent 60%), var(--surface); }
.start-box { border-color: rgba(30,123,230,.5); }

/* ---------------------------------------------------------------- obrazci */
.form label, fieldset legend { font-size: 14px; font-weight: 600; color: #C3CBDA; }
fieldset { border: 0; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 8px; }
input, textarea, select {
  width: 100%; font: 500 16px/1.4 var(--font); color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
input:focus, textarea:focus, select:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(24,177,234,.18); }
input[type="date"] { min-height: 48px; }
input[type="range"] { padding: 0; accent-color: var(--blue); border: 0; background: none; height: 32px; }
textarea { resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chips label, .chip {
  cursor: pointer; padding: 9px 16px; border-radius: 99px; font-size: 14px; font-weight: 600; color: #D8DEEA;
  border: 1px solid rgba(242,245,250,.25); background: transparent; font-family: var(--font);
}
.chips.mini .chip { padding: 7px 13px; font-size: 13px; }
.chips input:checked + label, .chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chips input:focus-visible + label { outline: 2px solid var(--cyan); outline-offset: 2px; }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.consent input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--blue); }
.consent label { font-weight: 400; font-size: 14px; color: #C3CBDA; }
.toggle { display: flex; gap: 10px; align-items: center; }
.toggle input { width: 22px; height: 22px; accent-color: var(--bad); }

/* ---------------------------------------------------------------- prijava */
.auth { padding-top: 28px; }
.auth-hero {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 28px 22px; border-radius: 22px; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(10,14,22,.15), rgba(10,14,22,.85)),
    radial-gradient(120% 100% at 100% 0%, rgba(24,177,234,.35), transparent 55%),
    radial-gradient(100% 100% at 0% 100%, rgba(20,65,182,.55), transparent 60%),
    #0E1524;
  border: 1px solid #22304C;
}
.auth-logo { width: 84px; height: 84px; object-fit: contain; }
body[data-auth="out"] .topbar { display: none; }

/* ---------------------------------------------------------------- beleženje */
.workout .intensity { margin-top: 2px; }
#log { display: flex; flex-direction: column; gap: 14px; }
.block-head { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; padding: 4px 10px; border-radius: 8px; align-self: flex-start; margin-top: 8px; }
.ex { gap: 12px; }
.ex-top { display: flex; gap: 12px; align-items: flex-start; }
.ex h4 { font-size: 17px; font-weight: 700; }
.rx { color: #C3CBDA; font-size: 14px; font-variant-numeric: tabular-nums; }
.tempo { font-weight: 800; letter-spacing: .08em; color: var(--cyan); }
.prev { font-size: 13px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.sets { display: flex; flex-direction: column; gap: 6px; }
.set-head, .set { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 8px; align-items: center; }
.set-head span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.set .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 14px; }
.set input { text-align: center; font-weight: 700; font-size: 18px; padding: 10px 8px; font-variant-numeric: tabular-nums; }
.set input::placeholder { color: #4A5874; font-weight: 500; }
.rpe-row { display: flex; align-items: center; gap: 12px; }
.rpe-row label { font-weight: 700; font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.rpe-row select { width: auto; min-width: 96px; }
.save-bar {
  position: sticky; bottom: calc(76px + var(--safe-b)); z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 99px; background: rgba(23,32,51,.94); border: 1px solid #2A3A5C;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* ---------------------------------------------------------------- trener */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; }
.tile b { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.warn { border-color: rgba(242,169,59,.5); } .tile.warn b { color: var(--warn); }
.tile.bad { border-color: rgba(239,90,95,.5); } .tile.bad b { color: var(--bad); }
.log.flag { border-color: rgba(239,90,95,.45); }
.log-table td { padding: 8px 10px; font-variant-numeric: tabular-nums; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

/* ---------------------------------------------------------------- spodnja navigacija */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 8px 6px calc(8px + var(--safe-b));
  background: rgba(10,14,22,.94); border-top: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.tabbar[hidden], .tabbar a[hidden] { display: none; }
.tabbar a {
  flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 600;
}
.tabbar a:hover { text-decoration: none; color: var(--text); }
.tabbar svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar a.on { color: #fff; }
.tabbar a.on svg { fill: var(--cyan); }

/* ---------------------------------------------------------------- prekrivni zaslon, toast */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(6,9,15,.82); backdrop-filter: blur(6px); }
.overlay[hidden] { display: none; }
.overlay-box { max-width: 340px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.overlay-msg { font-size: 20px; font-weight: 700; min-height: 2.6em; }
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 4px solid rgba(255,255,255,.1); border-top-color: var(--cyan); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 60; transform: translate(-50%, 20px);
  max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px;
  background: #1C2A44; border: 1px solid #2D4069; color: #fff; opacity: 0; pointer-events: none; transition: .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #3A1C22; border-color: #6B2F38; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
