/* עיצוב כללי */
body {
    font-family: Arial, sans-serif;
    direction: rtl;
    margin: 0;
    padding: 0;
    background-color: #f8f8f8;
    display: flex;
    justify-content: center; /* הזזת כל המסגרת ימינה */
    align-items: center;
    min-height: 90px;
    padding-right: 10%; /* התאמה למיקום הרצוי */
}

/* מיכל הטופס */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
}

.header-container {
    display: flex;
    justify-content: flex-end; /* הזזת ההדר ימינה */
    width: 100%;
    padding-right: 10%; /* התאמה למיקום הרצוי */
}

form {
    max-width: 700px;
    width: 90%; /* יישור מושלם בתוך המסגרת */
    margin: auto;
    padding: 20px;
    background: transparent;
     /* מסגרת שחורה מסביב לטופס */
    border-radius: 8px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    text-align: right;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* מיישר את כל הטקסט לצד ימין */
}

h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
    align-self: center; /* כותרת ממורכזת בתוך הטופס */
}

/* ביטול מסגרת בין TR ל-TR */
table {
    border-collapse: collapse;
}

tr {
    border: 0 !important;
}

/* עיצוב שדות קלט */
input[type="text"] {
    width: 100%; /* הרחבת השדות למלוא רוחב הטופס */
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    text-align: right;
}

/* שינוי גדלים ספציפיים */
#Commission {
    width: 33%; /* שליש מרוחב הטופס */
}

#askingPrice {
    width: 50%; /* חצי מרוחב הטופס */
}

/* כפתורים */
.button-container {
    justify-content: flex-start; /* הזזת כפתור שלח לצד ימין */
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
}

.btn {
    display: inline-block;
    width: 48%;
    padding: 10px;
    text-align: center;
    background: #28a745;
    color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.btn:hover {
    background: #218838;
}

#clearSign {
    background: #dc3545;
}

#clearSign:hover {
    background: #c82333;
}

/* כפתורי חתימה */
.signature-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
}

/* חתימה */
.signature-container {
    justify-content: flex-end;
    width: 100%;
    margin-top: 10px;
}

#signature {
    width: 257px;
    height: 90px;
    width: 230px;
    height: 90px;
    border: 1px solid #ccc; /* חיזוק המסגרת */
    display: block;
}

/* תיקון יישור הרקע */
@media (min-width: 768px) {
    .container {
        max-width: 900px;
    }
    form {
        margin: auto;
        width: 85%; /* תיקון יישור נוסף כדי להתאים את הרקע למסגרת */
    }
}

/* התאמות למסכים קטנים */
@media (max-width: 600px) {
    #signature {
        height: 120px; /* שמירת ההגבהה בנייד */
    }
    #signature {
        height: 120px; /* הגבהת השדה רק בנייד */
    }
    form {
        width: 95%;
    }
    .btn {
        width: 48%;
        margin-top: 5px;
    }
    input[type="text"] {
        width: 100%; /* התאמה למסכים קטנים */
    }
    .signature-container {
        justify-content: center;
    }
    #signature {
        width: 80%;
    }
    .signature-buttons {
        flex-direction: column;
        align-items: center;
    }
}
