/* ---------- Form Container ---------- */
.form-group {
    position: relative;
    margin-bottom: 24px;
    width: 100%;
}

/* ---------- Input, Textarea, Select ---------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: var(--input-padding);
    border: 1px solid var(--color-gray);
    border-radius: var(--input-radius);
    background-color: var(--color-white);
    outline: none;
    font-size: 1rem;
    transition: all var(--transition-speed);
    box-sizing: border-box;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ---------- Floating Labels ---------- */
.form-group label {
    position: absolute;
    left: 12px;
    top: 16px;
    background-color: var(--color-white);
    padding: 0 4px;
    color: var(--color-gray);
    font-size: var(--label-font-size);
    pointer-events: none;
    transition: all var(--transition-speed);
}

input:focus+label,
input:not(:placeholder-shown)+label,
textarea:focus+label,
textarea:not(:placeholder-shown)+label,
select:focus+label,
select:not([value=""])+label {
    top: -8px;
    left: 8px;
    font-size: var(--label-floating-size);
    color: var(--color-blue);
}

/* ---------- Focus & Hover Effects ---------- */
input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 4px rgba(37, 95, 241, 0.3);
}

/* ---------- Disabled State ---------- */
input:disabled,
textarea:disabled,
select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: var(--color-gray);
}

/* ---------- Radio & Checkbox ---------- */
input[type="radio"],
input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-gray);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-speed);
    margin-right: 8px;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="radio"]:checked::before,
input[type="checkbox"]:checked::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

input[type="radio"]:checked::before {
    width: 10px;
    height: 10px;
    background-color: var(--color-blue);
    border-radius: 50%;
}

input[type="checkbox"]:checked::before {
    width: 12px;
    height: 12px;
    background-color: var(--color-blue);
    border-radius: 2px;
}

/* ---------- Label for Radio & Checkbox ---------- */
input[type="radio"]+label,
input[type="checkbox"]+label {
    display: inline-block;
    font-size: 0.95rem;
    color: var(--color-black);
    cursor: pointer;
}

/* ---------- Error State ---------- */
.input-error {
    border-color: var(--color-red);
}

.input-error+label {
    color: var(--color-red);
}

/* ---------- Helper Text / Small Info ---------- */
.form-text {
    font-size: 0.85rem;
    color: var(--color-gray);
    margin-top: 4px;
}

/* ---------- Radio & Checkbox Container ---------- */
.checkbox-group,
.radio-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 20px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 0.95rem;
        padding: 14px 10px 4px 10px;
    }

    .form-group label {
        font-size: 0.95rem;
    }
}
