/**
 * Checkbox Component - CSS
 * Source: src/components/Atoms/Checkbox/Checkbox.tsx (tailwind-variants slots: base, indicator, icon)
 * Check icon: Lucide Check ~14px (w-3.5 h-3.5) on 16×16 control; unchecked bg-white; border 2px green-500; no radius (tv() has no rounded-*).
 * Last synced: 2026-04-09 (ui-core v2.0.76)
 */

@import url("../tokens.4b8ea74adec1.css");

.ui-checkbox {
    --ui-checkbox-check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 2px solid var(--color-green-500, #00c57b);
    border-radius: 0;
    background-color: var(--color-white, #ffffff);
    background-image: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ui-checkbox:checked {
    background-color: var(--color-green-500, #00c57b);
    background-image: var(--ui-checkbox-check-icon);
    border-color: var(--color-green-500, #00c57b);
}

.ui-checkbox:checked::after {
    content: none;
}

.ui-checkbox:indeterminate {
    background-color: var(--color-green-500, #00c57b);
    border-color: var(--color-green-500, #00c57b);
    background-image: none;
}

.ui-checkbox:indeterminate::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 2px;
    margin-left: -4px;
    margin-top: -1px;
    background: var(--color-white, #ffffff);
    border: none;
    transform: none;
}

.ui-checkbox:disabled {
    background-color: var(--color-gray-300, #e1e5e5);
    border-color: var(--color-gray-300, #e1e5e5);
    cursor: not-allowed;
}

.ui-checkbox:disabled:checked {
    background-image: var(--ui-checkbox-check-icon);
}

.ui-checkbox:disabled:indeterminate::after {
    background: var(--color-white, #ffffff);
}

.ui-checkbox:focus-visible {
    outline: 2px solid var(--color-green-500, #00c57b);
    outline-offset: 2px;
}

/* Ripple: must paint above the native input (opaque) — see checkbox.js mount */
.ui-checkbox-ripple-surface {
    position: relative;
    display: inline-flex;
    /* Match .ui-checkbox border-box (w-4 h-4 + border-2 in React) */
    --ui-checkbox-control: 16px;
    --ui-checkbox-border: 2px;
    width: var(--ui-checkbox-control);
    height: var(--ui-checkbox-control);
    flex-shrink: 0;
    vertical-align: middle;
    /*
     * Ripple clip diameter (React): useRipple.ts circle container is width/height 250%.
     * That percentage uses the checkbox *content* box. With 16px border-box and 2px border,
     * content is 12px → 2.5 × 12px = 30px (verified in Chromium on Storybook: computed
     * .__useRipple--ripple-container is 30×30).
     * Manual check: click the checkbox → Elements → [data-slot="checkbox"] > .__useRipple--ripple-container → Computed.
     */
    --ui-checkbox-ripple-clip: calc(2.5 * (var(--ui-checkbox-control) - 2 * var(--ui-checkbox-border)));
}

.ui-checkbox-ripple-surface .ui-checkbox {
    position: relative;
    z-index: 1;
}

.ui-checkbox-ripple-mount {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: var(--ui-checkbox-ripple-clip);
    height: var(--ui-checkbox-ripple-clip);
    margin-left: calc(var(--ui-checkbox-ripple-clip) / -2);
    margin-top: calc(var(--ui-checkbox-ripple-clip) / -2);
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    box-sizing: border-box;
}

.ui-checkbox-ripple-mount .ui-checkbox-ripple {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.3;
    pointer-events: none;
    transition: transform 600ms ease-out, opacity 600ms ease-out;
}

.ui-checkbox-ripple-mount .ui-checkbox-ripple.ripple-active {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0.1;
}

.ui-checkbox-ripple-mount .ui-checkbox-ripple.ripple-fading {
    opacity: 0 !important;
    transition: opacity 390ms ease-in-out 78ms;
}
