/* ============================================================================
   Checkbox Element — Premium Glass Style
   Matches the visual language of the existing input/card components.
   ============================================================================ */

.e-checkbox-group {
    margin-bottom: 0.5rem;
}

.e-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg, 0.75rem);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.e-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

/* — Hidden native input — */
.e-checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* — Custom checkmark box — */
.e-checkbox-mark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1px;
}

.e-checkbox-mark svg {
    width: 14px;
    height: 14px;
    color: #fff;
}

.e-checkbox-tick {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    transition: stroke-dashoffset 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s;
}

/* — Checked state — */
.e-checkbox-input:checked + .e-checkbox-mark {
    background: var(--c-primary, #6366f1);
    border-color: var(--c-primary, #6366f1);
    box-shadow: 0 0 12px rgba(var(--c-primary-rgb, 99, 102, 241), 0.35);
}

.e-checkbox-input:checked + .e-checkbox-mark .e-checkbox-tick {
    stroke-dashoffset: 0;
}

/* — Focus state (accessibility) — */
.e-checkbox-input:focus-visible + .e-checkbox-mark {
    outline: 2px solid var(--c-primary, #6366f1);
    outline-offset: 2px;
}

/* — Checked label container highlight — */
.e-checkbox-input:checked ~ .e-checkbox-text {
    color: rgba(255, 255, 255, 0.85);
}

/* — Label text — */
.e-checkbox-text {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s ease;
}

.e-checkbox-text a {
    /* Inherit from global .btn-link or standard link styles */
    text-underline-offset: 3px;
}

/* — Error state (when required but not checked) — */
.e-checkbox-group.has-error .e-checkbox-mark,
.e-checkbox-input:invalid:not(:placeholder-shown) + .e-checkbox-mark {
    border-color: var(--c-error, #ef4444);
}

.e-checkbox-group.has-error .e-checkbox-label {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.04);
}
