/* Controls Win32 — oec.cat (accent #004578) */
:root {
  --oec-accent: #004578;
  --oec-accent-mid: #005a9e;
  --oec-accent-dark: #003761;
  --oec-accent-check-top: #2a7bb8;
  --oec-accent-check-mid: #005a9e;
  --oec-accent-check-bot: #004578;
}

/* --- Checkboxes i radios natius --- */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 13px;
  height: 13px;
  margin: 0 6px 0 0;
  vertical-align: -2px;
  border: 1px solid #707070;
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f2 55%, #e4e4e4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

input[type="checkbox"] {
  border-radius: 2px;
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]:checked {
  border-color: var(--oec-accent-dark);
  background: linear-gradient(
    180deg,
    var(--oec-accent-check-top) 0%,
    var(--oec-accent-check-mid) 48%,
    var(--oec-accent-check-bot) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
}

input[type="radio"]:checked {
  border-color: var(--oec-accent);
  background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
}

input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    var(--oec-accent-check-top) 0%,
    var(--oec-accent) 70%,
    var(--oec-accent-dark) 100%
  );
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 1px dotted #000;
  outline-offset: 1px;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  opacity: 0.55;
  cursor: default;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  cursor: pointer;
  user-select: none;
}

/* --- Patró .oec-check / .oec-radio (opcional) --- */
.oec-check,
.oec-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: inherit;
  color: inherit;
  vertical-align: middle;
}

.oec-check-input,
.oec-radio-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.oec-check-box,
.oec-radio-dot {
  position: relative;
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border: 1px solid #707070;
  background: linear-gradient(180deg, #ffffff 0%, #f2f2f2 55%, #e4e4e4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04);
  pointer-events: none;
}

.oec-check-box {
  border-radius: 2px;
}

.oec-radio-dot {
  border-radius: 50%;
}

.oec-check-box::after,
.oec-radio-dot::after {
  content: "";
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.oec-check-input:checked + .oec-check-box {
  border-color: var(--oec-accent-dark);
  background: linear-gradient(
    180deg,
    var(--oec-accent-check-top) 0%,
    var(--oec-accent-check-mid) 48%,
    var(--oec-accent-check-bot) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.oec-check-input:checked + .oec-check-box::after {
  opacity: 1;
  left: 3px;
  top: 0;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
}

.oec-radio-input:checked + .oec-radio-dot {
  border-color: var(--oec-accent);
  background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
}

.oec-radio-input:checked + .oec-radio-dot::after {
  opacity: 1;
  left: 3px;
  top: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    var(--oec-accent-check-top) 0%,
    var(--oec-accent) 70%,
    var(--oec-accent-dark) 100%
  );
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.oec-check-input:focus-visible + .oec-check-box,
.oec-radio-input:focus-visible + .oec-radio-dot,
.oec-check:hover .oec-check-box,
.oec-radio:hover .oec-radio-dot {
  outline: 1px dotted #000;
  outline-offset: 1px;
}

.oec-check-input:disabled + .oec-check-box,
.oec-radio-input:disabled + .oec-radio-dot,
.oec-check-input:disabled ~ .oec-check-label,
.oec-radio-input:disabled ~ .oec-radio-label {
  opacity: 0.55;
  cursor: default;
}

.oec-check-label,
.oec-radio-label {
  line-height: 1.2;
}
