/* WEB implants .MF – Rezervace (veřejná část). Barvy převezme z webu přes proměnné:
   --rez-akcent, --rez-pozadi, --rez-text, --rez-radius (+ --rez-okraj, --rez-chyba, --rez-ok,
   kalendář skupin: --rez-volno, --rez-castecne) */
.rez {
  --_akcent: var(--rez-akcent, #2f6b3a);
  --_pozadi: var(--rez-pozadi, #fff);
  --_text: var(--rez-text, inherit);
  --_radius: var(--rez-radius, 10px);
  --_okraj: var(--rez-okraj, color-mix(in srgb, currentColor 22%, transparent));
  --_chyba: var(--rez-chyba, #b3261e);
  --_ok: var(--rez-ok, #1e7a3c);
  --_volno: var(--rez-volno, #1e7a3c);
  --_castecne: var(--rez-castecne, #b26a00);
  color: var(--_text);
  max-width: 44rem;
}
.rez *, .rez *::before, .rez *::after { box-sizing: border-box; }
.rez-nazev { margin: 0 0 .5em; }
.rez-popis p { margin: 0 0 .8em; }
.rez-info { display: grid; gap: .35rem 1rem; grid-template-columns: max-content 1fr; margin: 1rem 0 1.5rem; }
.rez-info > div { display: contents; }
.rez-info dt { font-weight: 700; }
.rez-info dd { margin: 0; }

.rez-formular { background: var(--_pozadi); border: 1px solid var(--_okraj); border-radius: var(--_radius); padding: 1.25rem; }
.rez-terminy { border: 0; margin: 0 0 1rem; padding: 0; }
.rez-terminy legend, .rez-pole > label { font-weight: 700; margin-bottom: .35rem; display: block; }
.rez-terminy-seznam { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.rez-termin {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: .1rem .7rem;
  border: 1px solid var(--_okraj); border-radius: var(--_radius); padding: .7rem .9rem; cursor: pointer; background: var(--_pozadi);
}
.rez-termin input { grid-row: 1 / span 3; margin: .2rem 0 0; accent-color: var(--_akcent); width: 1.15rem; height: 1.15rem; align-self: start; }
.rez-termin > span { grid-column: 2; }
.rez-termin:has(input:checked) { border-color: var(--_akcent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--_akcent) 35%, transparent); }
.rez-termin:has(input:focus-visible) { outline: 2px solid var(--_akcent); outline-offset: 2px; }
.rez-termin-kdy { font-weight: 700; }
.rez-termin-stav { font-size: .9em; color: var(--_ok); }
.rez-termin-poznamka { font-size: .9em; opacity: .85; }
.rez-termin--obsazeno, .rez-termin--uzavreno { cursor: default; opacity: .65; }
.rez-termin--obsazeno .rez-termin-stav, .rez-termin--uzavreno .rez-termin-stav { color: inherit; font-weight: 700; }
.rez-termin--obsazeno .rez-termin-kdy { text-decoration: line-through; }

.rez-mrizka { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.rez-pole { margin: 0 0 1rem; }
.rez-pole input:not([type=checkbox]):not([type=radio]), .rez-pole select, .rez-pole textarea {
  width: 100%; font: inherit; color: inherit; padding: .6rem .7rem; border: 1px solid var(--_okraj);
  border-radius: calc(var(--_radius) * .6); background: var(--_pozadi); min-height: 2.75rem;
}
.rez-pole input:focus-visible, .rez-pole select:focus-visible, .rez-pole textarea:focus-visible { outline: 2px solid var(--_akcent); outline-offset: 1px; }
.rez-pole--osob input { max-width: 8rem; }
.rez-zaskrtnout { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.rez-zaskrtnout input { margin-top: .25rem; width: 1.15rem; height: 1.15rem; accent-color: var(--_akcent); flex: none; }
.rez-pole--souhlas a { margin-left: 1.65rem; font-size: .9em; }
.rez-povinne { color: var(--_chyba); }
.rez-napoveda { font-size: .875em; opacity: .8; margin: .25rem 0 0; }
.rez-chyba-pole { color: var(--_chyba); font-weight: 600; font-size: .9em; margin: .3rem 0 0; }
.rez-pole--chyba input, .rez-pole--chyba select, .rez-pole--chyba textarea { border-color: var(--_chyba); border-width: 2px; }

.rez-zprava { border-radius: var(--_radius); padding: .9rem 1.1rem; margin: 0 0 1rem; border-left: 5px solid; }
.rez-zprava p { margin: .25rem 0; }
.rez-zprava--chyba { border-color: var(--_chyba); background: color-mix(in srgb, var(--_chyba) 9%, var(--_pozadi)); }
.rez-zprava--ok { border-color: var(--_ok); background: color-mix(in srgb, var(--_ok) 9%, var(--_pozadi)); }
.rez-dekujeme h3 { margin: 0 0 .5rem; }
.rez-dekujeme .rez-info { margin: .5rem 0; }

.rez-platba { font-weight: 600; }
.rez-tlacitko {
  font: inherit; font-weight: 700; color: #fff; background: var(--_akcent); border: 0; border-radius: var(--_radius);
  padding: .8rem 1.6rem; cursor: pointer; min-height: 2.75rem;
}
.rez-tlacitko:hover { filter: brightness(1.08); }
.rez-tlacitko:focus-visible { outline: 3px solid color-mix(in srgb, var(--_akcent) 50%, transparent); outline-offset: 2px; }
.rez-tlacitko:disabled { opacity: .6; cursor: wait; }
.rez-vypnuto p, .rez-zadne { font-weight: 600; }

/* kalendář volných termínů pro skupiny – stav dne je poznat i bez barev: vzor pozadí, značka a skrytý text pro čtečky */
.rez-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rez-pole--kalendar { margin-bottom: 1.25rem; }
.rez-kal-nadpis { margin: 0 0 .5rem; }
.rez-kalendar[aria-busy=true] { opacity: .6; transition: opacity .2s; }
.rez-kal-hlavicka { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .35rem; }
.rez-kal-mesic { margin: 0; font-weight: 700; font-size: 1.1em; text-align: center; flex: 1; }
.rez-kal-mesic:focus { outline: none; }
.rez-kal-sipka {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem;
  border: 1px solid var(--_okraj); border-radius: var(--_radius); color: inherit; text-decoration: none; font-size: 1.4rem; line-height: 1;
}
span.rez-kal-sipka { opacity: .3; }
a.rez-kal-sipka:hover { border-color: var(--_akcent); }
a.rez-kal-sipka:focus-visible { outline: 2px solid var(--_akcent); outline-offset: 2px; }
.rez-kal-mrizka { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; margin: 0 -3px; width: calc(100% + 6px); }
.rez-kal-mrizka th { font-size: .8em; font-weight: 600; padding: .15rem 0; text-align: center; opacity: .75; }
.rez-kal-mrizka abbr { text-decoration: none; border: 0; }
.rez-kal-mrizka td { padding: 0; text-align: center; vertical-align: top; }
.rez-den {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 2.9rem; border: 1px solid transparent; border-radius: calc(var(--_radius) * .6);
  color: inherit; text-decoration: none; line-height: 1.1; position: relative;
}
.rez-den-cislo { font-weight: 600; font-variant-numeric: tabular-nums; }
.rez-den-znak { font-size: .65em; min-height: 1em; line-height: 1; }
.rez-den--volno { background: color-mix(in srgb, var(--_volno) 15%, var(--_pozadi)); border-color: color-mix(in srgb, var(--_volno) 55%, transparent); }
.rez-den--volno .rez-den-znak { color: var(--_volno); }
.rez-den--castecne {
  background: linear-gradient(135deg, color-mix(in srgb, var(--_castecne) 30%, var(--_pozadi)) 50%, var(--_pozadi) 50%);
  border-color: color-mix(in srgb, var(--_castecne) 65%, transparent);
}
.rez-den--castecne .rez-den-znak { color: var(--_castecne); }
.rez-den--plno {
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, currentColor 12%, transparent) 0 2px, transparent 2px 6px);
  border-color: color-mix(in srgb, currentColor 18%, transparent);
}
.rez-den--plno .rez-den-cislo { text-decoration: line-through; opacity: .75; }
.rez-den--zavreno { opacity: .45; }
.rez-den--zavreno .rez-den-znak::before { content: "–"; }
.rez-den--minulost { opacity: .28; }
.rez-den--dnes .rez-den-cislo { text-decoration: underline; text-underline-offset: 2px; }
a.rez-den { cursor: pointer; }
a.rez-den:hover { border-color: var(--_akcent); border-width: 2px; }
a.rez-den:focus-visible { outline: 3px solid var(--_akcent); outline-offset: 1px; z-index: 1; }
.rez-den--vybrany, a.rez-den--vybrany:hover { background: var(--_akcent); border-color: var(--_akcent); color: #fff; box-shadow: 0 0 0 2px color-mix(in srgb, var(--_akcent) 35%, transparent); }
.rez-den--vybrany .rez-den-znak { color: #fff; }
.rez-kal-legenda { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .875em; }
.rez-kal-legenda li { display: inline-flex; align-items: center; gap: .35rem; }
.rez .rez-den--vzor { min-height: 1.5rem; width: 1.75rem; display: inline-flex; opacity: 1; flex: none; }
.rez-den--vzor.rez-den--zavreno .rez-den-znak::before { content: none; }
.rez-den--vzor.rez-den--zavreno { border-color: var(--_okraj); }
.rez-kal-zadny, .rez-kal-vyber { margin: .75rem 0 0; font-weight: 600; }
.rez-kal-vyber:focus, .rez-sloty:focus { outline: none; }
.rez-sloty { margin: 1rem 0 0; }
.rez-kal-nadpis-dne { margin: 0 0 .35rem; }
.rez-sloty-seznam { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
.rez-sloty .rez-termin-kdy { white-space: nowrap; }

/* past na roboty – lidé ji nevidí ani na ni nenarazí klávesnicí */
.rez-past { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 30rem) {
  .rez-formular { padding: 1rem; }
  .rez-info { grid-template-columns: 1fr; gap: 0; }
  .rez-info dd { margin-bottom: .4rem; }
  .rez-tlacitko { width: 100%; }
  .rez-kal-mrizka { border-spacing: 2px; margin: 0 -2px; width: calc(100% + 4px); }
  .rez-den { min-height: 2.75rem; }
}
