﻿@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2'), url('/fonts/webfonts/Vazirmatn-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2'), url('/fonts/webfonts/Vazirmatn-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
}

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background: #f7f7f7;
    margin: 0;
    padding: 0;
    direction: rtl;
}

.form-container {
    max-width: 900px;
    margin: 32px auto;
    background: #fff;
    border: 1.5px solid #bbb;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    padding: 28px 18px;
}

.header {
    text-align: center;
    margin-bottom: 8px;
}

    .header h2 {
        margin: 0 0 4px 0;
        font-size: 1.18rem;
        font-weight: 700;
        color: #222;
    }

    .header h3 {
        margin: 0 0 12px 0;
        font-size: 1.05rem;
        font-weight: 500;
        color: #444;
    }

.section-title {
    background: #f0f4f8;
    border-right: 4px solid #2980b9;
    padding: 5px 12px;
    margin: 24px 0 10px 0;
    font-weight: 700;
    color: #2980b9;
    font-size: 1.05rem;
    border-radius: 4px;
    display: inline-block;
}


.form-group {
    flex: 1 1 calc(33.333% - 20px);
    min-width: 180px;
    display: flex;
    flex-direction: column;
}
    

label {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
}

input[type="text"],
input[type="date"],
input[type="number"],
select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cfd8dc;
    border-radius: 4px;
    background: #f8fafb;
    font-size: 0.95rem;
    line-height: 1.4;
}

.text-danger {
    font-size: 0.85rem;
    color: #d9534f;
    margin-top: 2px;
}

/* چک‌باکس‌ها */
.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

    .checkbox-row label,
    .checkbox-row span,
    .checkbox-row input {
        margin-bottom: 5px;
        font-weight: 400;
        color: #444;
        font-size: 0.97rem;
    }

.inline-checkboxes label {
    display: inline-block;
    margin-left: 16px;
    margin-bottom: 0;
    font-weight: 400;
    font-size: 0.97rem;
    color: #444;
}

/* جدول‌ها */
.table-container {
    overflow-x: auto;
    width: 100%;
    margin-top: 10px;
    border: 1px solid #ddd;
}

table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
    background-color: #fff7e6;
    font-size: 0.97rem;
}

    table th,
    table td {
        border: 1px solid #ccc;
        padding: 8px;
        text-align: center;
        white-space: nowrap;
        vertical-align: middle;
    }

    table th {
        background: #e3eaf2;
        color: #2980b9;
        font-weight: bold;
    }

    table td {
        max-width: 200px;
        overflow-x: auto;
        text-overflow: ellipsis;
    }

td[contenteditable="true"] {
    background-color: #fffbe7;
    outline: none;
    transition: background 0.2s;
    min-width: 120px;
}

    td[contenteditable="true"]:focus {
        background: #fff3c1;
    }

/* دکمه‌ها */
.btn-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    background: #2980b9;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 36px;
    font-size: 1.08rem;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn:hover {
        background: #206694;
    }

.btn-secondary {
    background: #888;
}

    .btn-secondary:hover {
        background: #555;
    }

/* سوالات ترکیبی */
.question-box {
    margin-bottom: 12px;
    padding: 8px 10px 4px 10px;
    border: 1px solid #bbb;
    border-radius: 6px;
    background: #f8f8f8;
}

    .question-box input[type="text"] {
        width: auto;
        min-width: 90px;
        display: inline-block;
        margin-left: 8px;
        margin-right: 4px;
    }

    .question-box label {
        display: inline-block;
        margin-left: 12px;
        margin-bottom: 0;
        font-weight: 400;
        font-size: 0.97rem;
        color: #444;
    }

.question-title {
    font-weight: 500;
    font-size: 0.97rem;
    margin-bottom: 4px;
    display: block;
    color: #222;
}

.form-footer {
    margin-top: 16px;
    font-size: 0.92rem;
    color: #888;
    text-align: left;
}

/* موبایل */
@media (max-width: 768px) {
    .form-row {

        gap: 12px;
    }

    .form-group {
        min-width: 100%;
    }

    .checkbox-row {
        flex-direction: column;
        align-items: flex-start;
    }

        .checkbox-row input[type="text"] {
            width: 100% !important;
        }

    table,
    th,
    td {
        font-size: 0.93rem;
    }

    .header h2,
    .header h3 {
        font-size: 1rem;
    }

    .section-title {
        font-size: 0.99rem;
    }

    .btn-row {
        flex-direction: column;
        gap: 8px;
    }
}

td[contenteditable="true"] {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
    max-width: none;
}
