/* ==========================================================
   FORM LAYOUT
========================================================== */

.form {

    display: flex;
    flex-direction: column;
    gap: 18px;

}

.form-row {

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;

}

.form-group {

    display: flex;
    flex-direction: column;
    gap: 6px;

}

.form-group.full {

    grid-column: 1 / -1;

}

.field-hint {

    font-size: 11.5px;
    color: var(--text-light);

}

/* ==========================================================
   LABELS
========================================================== */

label {

    font-size: 13px;
    font-weight: 600;
    color: var(--text);

}

label.required::after {

    content: " *";
    color: var(--danger);

}

/* ==========================================================
   INPUTS
========================================================== */

input,
textarea,
select {

    width: 100%;

    padding: 10px 13px;

    border: 1px solid var(--border);

    border-radius: var(--radius-sm);

    background: var(--surface);

    color: var(--text);

    font-size: 13.5px;

    transition: .18s ease;

    outline: none;

}

input:hover,
textarea:hover,
select:hover {

    border-color: var(--text-faint);

}

input:focus,
textarea:focus,
select:focus {

    border-color: var(--primary);

    box-shadow: 0 0 0 3px rgba(23,101,245,.14);

}

input::placeholder,
textarea::placeholder {

    color: var(--text-faint);

}

/* ==========================================================
   TEXTAREA
========================================================== */

textarea {

    resize: vertical;

    min-height: 120px;

    line-height: 1.6;

}

/* ==========================================================
   SEARCH INPUT
========================================================== */

.search-box {

    position: relative;

}

.search-box input {

    padding-left: 40px;

}

.search-box i,
.search-box .search-icon {

    position: absolute;

    left: 14px;

    top: 50%;

    transform: translateY(-50%);

    color: var(--text-faint);

    font-size: 15px;

}

/* ==========================================================
   SELECT
========================================================== */

select {

    cursor: pointer;

}

/* ==========================================================
   CHECKBOX
========================================================== */

.checkbox {

    display: flex;

    align-items: center;

    gap: 8px;

    cursor: pointer;

    font-size: 13.5px;

}

.checkbox input {

    width: 16px;

    height: 16px;

}

/* ==========================================================
   RADIO BUTTON
========================================================== */

.radio {

    display: flex;

    align-items: center;

    gap: 8px;

    cursor: pointer;

    font-size: 13.5px;

}

.radio input {

    width: 16px;

    height: 16px;

}

/* ==========================================================
   TOGGLE SWITCH
========================================================== */

.switch {

    position: relative;

    display: inline-block;

    width: 42px;

    height: 24px;

}

.switch input {

    display: none;

}

.slider {

    position: absolute;

    inset: 0;

    background: var(--border);

    border-radius: 999px;

    cursor: pointer;

    transition: .2s;

}

.slider::before {

    content: "";

    position: absolute;

    width: 18px;

    height: 18px;

    left: 3px;

    top: 3px;

    background: var(--surface);

    border-radius: 50%;

    transition: .2s;

}

.switch input:checked + .slider {

    background: var(--primary);

}

.switch input:checked + .slider::before {

    transform: translateX(18px);

}

/* ==========================================================
   FILE UPLOAD
========================================================== */

.file-upload {

    display: flex;

    align-items: center;

    gap: 14px;

}

.file-preview {

    width: 76px;

    height: 76px;

    border-radius: var(--radius);

    border: 1px dashed var(--border);

    display: flex;

    justify-content: center;

    align-items: center;

    background: var(--border-soft);

    color: var(--text-faint);

    font-size: 28px;

}

.file-upload input[type=file] {

    display: none;

}

/* ==========================================================
   VALIDATION
========================================================== */

.input-error {

    border-color: var(--danger) !important;

}

.input-success {

    border-color: var(--success) !important;

}

.error-message {

    color: var(--danger);

    font-size: 12px;

    margin-top: 3px;

}

.success-message {

    color: var(--success);

    font-size: 12px;

    margin-top: 3px;

}

.help-text {

    color: var(--text-light);

    font-size: 12px;

}

/* ==========================================================
   FORM ACTIONS
========================================================== */

.form-actions {

    display: flex;

    justify-content: flex-end;

    gap: 12px;

    margin-top: 24px;

}

/* ==========================================================
   INLINE FORM
========================================================== */

.inline-form {

    display: flex;

    align-items: center;

    gap: 12px;

    flex-wrap: wrap;

}

/* ==========================================================
   FILTER BAR
========================================================== */

.filter-bar {

    display: flex;

    align-items: center;

    gap: 12px;

    flex-wrap: wrap;

    margin-bottom: 20px;

}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 768px) {

    .form-row {

        grid-template-columns: 1fr;

    }

    .form-actions {

        flex-direction: column;

    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {

        width: 100%;

    }

    .filter-bar {

        flex-direction: column;
        align-items: stretch;

    }

    .inline-form {

        flex-direction: column;
        align-items: stretch;

    }

}