/* 작업 범위: ../README.md 참고 — checkbox 컴포넌트와 시각 일관 */

.custom-radio-wrap {
    display: block;
    width: 100%;
    max-width: 560px;
    margin: 12px 0 20px;
}

.custom-radio-wrap .ui-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-radio-wrap .ui-radio-legend {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    margin-bottom: 4px;
}

.custom-radio-wrap .ui-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.custom-radio-wrap .ui-radio:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-radio-wrap .ui-radio input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.custom-radio-wrap .ui-radio-mark {
    display: inline-block;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1.5px solid #888;
    border-radius: 50%;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.custom-radio-wrap .ui-radio-label {
    font-size: 14px;
    color: #111;
    line-height: 1.4;
}

.custom-radio-wrap .ui-radio input:checked + .ui-radio-mark {
    border-color: var(--primary, #111);
    box-shadow: inset 0 0 0 4px var(--primary, #111);
}

.custom-radio-wrap .ui-radio input:focus-visible + .ui-radio-mark {
    outline: 2px solid var(--primary, #111);
    outline-offset: 2px;
}

.custom-radio-wrap .ui-radio:hover:not(:has(input:disabled)) .ui-radio-mark {
    border-color: #555;
}

/* ---------- 버튼형 (variant: button) ---------- */

.custom-radio-wrap--button .ui-radio-group.ui-radio-button {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.custom-radio-wrap--button .ui-radio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--show-border, #e5e5e5);
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    color: #111;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    user-select: none;
    box-sizing: border-box;
}

.custom-radio-wrap--button .ui-radio-btn input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

.custom-radio-wrap--button .ui-radio-btn span {
    pointer-events: none;
}

.custom-radio-wrap--button .ui-radio-btn:has(input:checked) {
    background: #111;
    color: #fff;
    border-color: #111;
}

.custom-radio-wrap--button .ui-radio-btn:hover:not(:has(input:disabled)) {
    border-color: #888;
}

.custom-radio-wrap--button .ui-radio-btn:has(input:checked):hover:not(:has(input:disabled)) {
    background: #333;
    border-color: #333;
    color: #fff;
}

.custom-radio-wrap--button .ui-radio-btn:has(input:focus-visible) {
    outline: 2px solid var(--primary, #111);
    outline-offset: 2px;
}

.custom-radio-wrap--button .ui-radio-btn:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

.ui-scope .custom-radio-wrap--button .ui-radio-btn:has(input:checked) {
    background: #111;
    color: #fff;
    border-color: #111;
}
