﻿/* =========================================
   Forms
   ========================================= */

/* =========================================
   Form Group
   ========================================= */

.form-group {
    width: 100%;
    margin-bottom: 14px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* -----------------------------------------
   Label
   ----------------------------------------- */

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

/* =========================================
   Form Row
   ========================================= */

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 16px;
    box-sizing: border-box;
}

/* -----------------------------------------
   Form Row - Three Columns
   ----------------------------------------- */

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 16px;
    box-sizing: border-box;
}

/* -----------------------------------------
   Form Row - Four Columns
   ----------------------------------------- */

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 16px;
    box-sizing: border-box;
}

/* =========================================
   Form Control
   ========================================= */

.form-control {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #1e293b;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    box-sizing: border-box;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

/* -----------------------------------------
   Focus
   ----------------------------------------- */

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}

/* -----------------------------------------
   Placeholder
   ----------------------------------------- */

.form-control::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* -----------------------------------------
   Disabled
   ----------------------------------------- */

.form-control:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

/* -----------------------------------------
   Readonly
   ----------------------------------------- */

.form-control[readonly] {
    background: #f8fafc;
    color: #475569;
}

/* =========================================
   Textarea
   ========================================= */

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* =========================================
   Form Select
   ========================================= */

.form-select {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 9px 38px 9px 12px;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #1e293b;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

/* -----------------------------------------
   Select Focus
   ----------------------------------------- */

.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background-color: #fff;
}

/* -----------------------------------------
   Select Disabled
   ----------------------------------------- */

.form-select:disabled {
    background-color: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

/* =========================================
   Checkbox / Radio
   ========================================= */

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #334155;
    font-size: 14px;
}

.form-check-input {
    width: 17px;
    height: 17px;
    margin: 0;
    cursor: pointer;
    accent-color: #2563eb;
}

.form-check-label {
    margin: 0;
    cursor: pointer;
}

/* =========================================
   Form Actions
   ========================================= */

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 24px;
    direction: rtl;
}

/* =========================================
   Validation
   ========================================= */

.field-validation-error {
    display: block;
    min-height: 18px;
    margin-top: 5px;
    color: #dc2626;
    font-size: 12px;
    line-height: 1.5;
}

/* -----------------------------------------
   Validation Summary
   ----------------------------------------- */

.validation-summary-errors {
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 7px;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.6;
}

/* =========================================
   Status
   ========================================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

/* -----------------------------------------
   Active
   ----------------------------------------- */

.status-active {
    color: #166534;
    background: #dcfce7;
}

/* -----------------------------------------
   Inactive
   ----------------------------------------- */

.status-inactive {
    color: #991b1b;
    background: #fee2e2;
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 768px) {
    .form-row,
    .form-row-3,
    .form-row-4 {
        grid-template-columns: 1fr;
    }
}
