/*
 * @futurity/design — classic/icheck.css: iCheck adapter for the Fty check box / radio look.
 *
 * WHAT
 *   iCheck 1.x hides the real <input> and draws `<div class="icheckbox_<skin>[-<color>]">` / `iradio_…` wrappers
 *   from a sprite image, with state classes `checked`, `disabled`, `hover`, `focus`. This file repaints every skin
 *   (minimal, square, flat, futurico, polaris, …) as the Fty check box: 16x16, white, 1px muted border, 4px radius
 *   (radio: round), brand-blue when checked with a white tick (radio: white dot). Sprites are switched off.
 *   Loading this file IS the opt-in: it is not scoped to `.fty-classic`.
 *
 * LOAD ORDER (after the iCheck skin CSS)
 *   icheck skin CSS → tokens.css (optional) → classic.css → classic/icheck.css
 *
 * HOW IT WINS
 *   Skins style `.icheckbox_minimal-grey` (one class) and `.icheckbox_minimal-grey.checked` (two). The attribute
 *   selector `[class*="icheckbox_"]` weighs the same as a class, so the base rule meets the skin's base rule and the
 *   state rules (`[class*="icheckbox_"].checked`) meet the skin's state rules, and this file wins by loading later.
 *   Skins that combine states (`.checked.hover`, `.checked.disabled`) are repeated here at the same weight.
 *   No !important. The skin's sprite offsets are neutralised by setting background-position/size explicitly.
 */

/* ---- Box ---------------------------------------------------------------------------------------------- */

[class^="icheckbox_"],
[class*=" icheckbox_"],
[class^="iradio_"],
[class*=" iradio_"] {
	box-sizing: border-box;
	width: 16px;
	height: 16px;
	margin: 0;
	padding: 0;
	vertical-align: middle;
	background-color: #ffffff;
	background-image: none;
	background-position: center;
	background-repeat: no-repeat;
	background-size: 12px 12px;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	box-shadow: none;
	cursor: pointer;
}

[class^="iradio_"],
[class*=" iradio_"] {
	border-radius: 50%;
}

/* ---- Hover / focus ------------------------------------------------------------------------------------- */

[class^="icheckbox_"].hover,
[class*=" icheckbox_"].hover,
[class^="iradio_"].hover,
[class*=" iradio_"].hover {
	background-color: #ffffff;
	border-color: #005a9c;
}

[class^="icheckbox_"].focus,
[class*=" icheckbox_"].focus,
[class^="iradio_"].focus,
[class*=" iradio_"].focus {
	border-color: #005a9c;
	box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}

/* ---- Checked ------------------------------------------------------------------------------------------- */

[class^="icheckbox_"].checked,
[class*=" icheckbox_"].checked,
[class^="icheckbox_"].checked.hover,
[class*=" icheckbox_"].checked.hover,
[class^="icheckbox_"].checked.disabled,
[class*=" icheckbox_"].checked.disabled {
	background-color: #005a9c;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.4l2.3 2.3 4.7-4.9' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-position: center;
	background-size: 12px 12px;
	border-color: #005a9c;
}

[class^="iradio_"].checked,
[class*=" iradio_"].checked,
[class^="iradio_"].checked.hover,
[class*=" iradio_"].checked.hover,
[class^="iradio_"].checked.disabled,
[class*=" iradio_"].checked.disabled {
	background-color: #005a9c;
	background-image: radial-gradient(circle at center, #ffffff 0, #ffffff 3px, transparent 3.5px);
	background-position: center;
	background-size: 100% 100%;
	border-color: #005a9c;
}

/* ---- Disabled ------------------------------------------------------------------------------------------ */

[class^="icheckbox_"].disabled,
[class*=" icheckbox_"].disabled,
[class^="iradio_"].disabled,
[class*=" iradio_"].disabled,
[class^="icheckbox_"].disabled.hover,
[class*=" icheckbox_"].disabled.hover,
[class^="iradio_"].disabled.hover,
[class*=" iradio_"].disabled.hover {
	cursor: default;
	opacity: 0.5;
}
