/* ==============================
   LABEL ERROR (semua elemen)
   ============================== */
label.error {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
    display: block;
}

/* ==============================
   TEXT / TEXTAREA / SELECT
   ============================== */

/* Error state */
input.error:not([type="radio"]):not([type="checkbox"]),
select.error,
textarea.error {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23dc3545' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 18L18 6M6 6l12 12' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Valid state */
input.valid:not([type="radio"]):not([type="checkbox"]),
select.valid,
textarea.valid {
    border-color: #198754 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23198754' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Focus states */
input.error:focus,
select.error:focus,
textarea.error:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

input.valid:focus,
select.valid:focus,
textarea.valid:focus {
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* ==============================
   RADIO BUTTONS
   ============================== */

/* Error outline */
input[type="radio"].error {
    outline: 1px solid #dc3545;
    background: #dc3545;
    outline-offset: 2px;
}

/* Valid outline */
input[type="radio"].valid {
    outline: 1px solid #198754;
    background-color: #198754;
    outline-offset: 2px;
}

/* Label color saat error */
input[type="radio"].error + label,
input[type="radio"].error ~ label {
    color: #dc3545;
    font-weight: 500;
}

/* Label color saat valid */
input[type="radio"].valid:checked + label,
input[type="radio"].valid:checked ~ label {
    color: #198754;
    font-weight: 500;
}

/* Jika pakai div.radio-group untuk grouping */
.radio-group.error label {
    color: #dc3545;
}

.radio-group.valid label {
    color: #198754;
}
