/* ===========================
   Booking – clean stylesheet
   =========================== */

/* Design tokens */
:root{
    --bg:#f7f7fb;
    --card:#fff;
    --ink:#1f2937;
    --muted:#6b7280;
    --accent:#2563eb;
    --accent-outline: rgba(37, 99, 235, 0.4);
    --border:#d4e8f6;


    --ok-100:#dcfce7;  --ok-200:#bbf7d0;  --ok-400:#34d399;  --ok-500:#10b981;  --ok-800:#065f46;  --ok-900:#064e3b;
    --bad-100:#fee2e2; --bad-400:#f87171; --bad-800:#991b1b;
}

/* Reset-ish */
*{ box-sizing:border-box; }
body{
    margin:0; min-height:100vh; display:flex; align-items:center; justify-content:center;
    background:var(--bg); font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; color:var(--ink);
    padding:24px;
}

/* Layout */
.wrap{
    width:min(960px,96vw);
    background:var(--card);
    border-radius:16px;
    padding:32px;
    box-shadow:0 20px 40px rgba(31,41,55,.12);
    display:flex; flex-direction:column; gap:24px;
}
h2{ margin:0; font-size:24px; font-weight:700; text-align:center; color:var(--ink); }
.row{ display:flex; gap:16px; } .row>*{ flex:1; }
label{ font-size:14px; font-weight:600; margin-bottom:6px; display:block; }
.muted{ color:var(--muted); font-size:13px; }

/* Controls */
input,select,textarea{
    width:100%; padding:12px 14px; border:1px solid var(--border); border-radius:10px; font-size:15px;
    background:#fff; outline:none; transition:border-color .2s, box-shadow .2s;
}
.serviceInfo {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    background: #f8fbff;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    margin-top: 10px;
}
.serviceInfo .ico { width: 20px; height: 20px; flex: 0 0 20px; }

.serviceInfo[hidden] {
    display: none !important;
}
input:focus,select:focus,textarea:focus,
input:focus-visible,select:focus-visible,textarea:focus-visible{
    border-color:var(--accent);
    box-shadow:0 0 6px var(--accent-outline);
}
textarea{ resize:vertical; min-height:110px; }

/* Custom select arrow */
#service{
    -webkit-appearance:none; -moz-appearance:none; appearance:none;
    padding-right:42px;
    background:
            url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path d="M6 8l4 4 4-4" stroke="%23566" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>')
            no-repeat right 12px center/20px 20px;
}

/* Submit */
.submit{
    align-self:flex-end; margin-top:8px; padding:14px 20px; border:0; border-radius:12px;
    background:var(--accent); color:#fff; font-weight:700; font-size:16px; cursor:pointer;
    transition:transform .15s, filter .15s;
}
.submit:hover{ transform:translateY(-1px); filter:brightness(1.05); }

/* Calendar card */
.calendarCard{ border:1px solid var(--border); border-radius:14px; padding:20px; display:none; }
.calHeader{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.calNav{ display:flex; gap:8px; }
.btn{
    padding:8px 12px; border-radius:10px; border:1px solid var(--border); background:#fff; cursor:pointer;
    transition:background-color .15s;
}
.btn:hover{ background:#f5f5f5; }

.grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:8px; } /* Po–Pá */
.dow{ text-align:center; font-weight:700; font-size:12px; color:var(--muted); padding:4px 0; }

.day{
    border:1px solid var(--border); border-radius:10px; padding:10px 0; text-align:center;
    cursor:pointer; background:#fff; min-height:44px; position:relative; user-select:none;
    transition:background-color .15s, border-color .15s, box-shadow .2s;
}
.day:hover:not(.disabled){ background:#f5f5f5; }
.day.disabled{ color:#9ca3af; background:#f5f6f8; cursor:not-allowed; }
.day.placeholder{ visibility:hidden; }

/* Selected day */
.day.selected,
.day:focus-visible{
    border-color:var(--accent);
    box-shadow:0 0 6px var(--accent-outline);
}
.day.full::after{
    content:"Obsazeno"; position:absolute; right:6px; top:6px; font-size:9px; font-weight:600; color:#fff;
    background:var(--bad-800); border-radius:6px; padding:2px 6px;
}

/* Slots */
#slotsWrap{ display:none; border:1px solid var(--border); border-radius:14px; padding:20px; }
#slotsWrap.visible{ display:block; }
.slots-title{ display:flex; font-size:16px; font-weight:800; color:var(--ink); margin-bottom:10px; }

/* Responsive grid for slots */
.slots{
    display:grid; gap:10px;
    grid-template-columns:repeat(4,1fr);
    margin-top:12px;
}
@media (max-width:900px){ .slots{ grid-template-columns:repeat(3,1fr);} }
@media (max-width:600px){ .slots{ grid-template-columns:repeat(2,1fr);} }

/* Slot buttons – base */
.slotBtn{
    width:100%; text-align:center; padding:14px 0; border-radius:10px; user-select:none;
    transition:background .2s, border-color .2s, box-shadow .2s, transform .06s;
    border:2px solid transparent;
}

/* Free */
.slotBtn--free{
    background:var(--ok-100); border-color:var(--ok-400); color:var(--ok-800); cursor:pointer;
}
.slotBtn--free:hover{ background:var(--ok-200); border-color:var(--ok-500); color:var(--ok-900); }
.slotBtn--free:active{ transform:translateY(1px); }

/* Busy */
.slotBtn--busy,
.slotBtn:disabled{
    background:var(--bad-100); border-color:var(--bad-400); color:var(--bad-800);
    cursor:not-allowed !important;
}

/* Selected slot */
.slotBtn.sel,
.slotBtn:focus-visible{
    border-color:var(--accent);
    box-shadow:0 0 6px var(--accent-outline);
}

/* Loading */
#busy{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: grid;
    place-items: center;
    z-index: 9999;
}

.busy-box{
    background: #101826;
    color: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0,0,0,.3);
}

/* volitelně: ať disabled submit nevypadá klikatelně */
button.submit:disabled{
    opacity:.6; cursor:not-allowed;
}
#busy { display: none; }
#busy.active { display: grid; }


/* Responsive */
@media (max-width:720px){
    .row{ flex-direction:column; }
    .wrap{ padding:24px; }
    h2{ font-size:20px; }
}
