/* ──────────────────────────────────────────────────────────────
   Checkbox Control — Styled Checkboxes
   ──────────────────────────────────────────────────────────────
   Wiederverwendbare Checkbox mit #18B2CB Hintergrund wenn aktiv.
   Konsistent mit Radio-Buttons (optgroup.css) und Switches.

   Nutzung:
     <label class="z-check-label">
         <input type="checkbox" class="z-check" checked> Option A
     </label>

   Auch in Gruppen:
     <div class="z-check-group">
         <label class="z-check-label">
             <input type="checkbox" class="z-check" checked> Option A
         </label>
         <label class="z-check-label">
             <input type="checkbox" class="z-check"> Option B
         </label>
     </div>

   Farbe:  --z-control-active (#18B2CB) — gemeinsame Akzentfarbe
           für Radio-Buttons, Checkboxen und Switches.

   Abhängigkeiten:  Design-Tokens aus _layout.html
   ────────────────────────────────────────────────────────────── */

/* ── Gruppe (optional) ─────────────────────────────────── */
.z-check-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

/* ── Label (Checkbox + Text) ───────────────────────────── */
.z-check-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    color: var(--z-text-mid);
    font-size: 0.8rem;
    transition: color 0.15s;
}

.z-check-label:hover {
    color: var(--z-text);
}

/* ── Checkbox Styling ──────────────────────────────────── */
.z-check {
    appearance: none;
    -webkit-appearance: none;
    width: 0.9rem;
    height: 0.9rem;
    border: 1.5px solid var(--z-border);
    border-radius: 0.2rem;
    background: var(--z-bg-input);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    position: relative;
}

.z-check:hover {
    border-color: var(--z-control-active, #18B2CB);
}

.z-check:checked {
    border-color: var(--z-control-active, #18B2CB);
    background: var(--z-control-active, #18B2CB);
}

/* Checkmark (white) */
.z-check:checked::after {
    content: '';
    position: absolute;
    top: 45%;
    left: 50%;
    width: 0.3rem;
    height: 0.55rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Checked label text */
.z-check-label:has(.z-check:checked) {
    color: var(--z-text);
}

/* ── Disabled ──────────────────────────────────────────── */
.z-check-label:has(.z-check:disabled) {
    opacity: 0.45;
    cursor: not-allowed;
}

.z-check:disabled {
    cursor: not-allowed;
}
