/* Real-estate service order form */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700&display=swap');

body.service-form-page {
    font-family: 'Heebo', 'Segoe UI', Tahoma, Arial, sans-serif;
    background:
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(208, 229, 236, 0.9) 0%, transparent 55%),
        radial-gradient(ellipse 70% 45% at 0% 100%, rgba(220, 237, 215, 0.85) 0%, transparent 50%),
        linear-gradient(180deg, #f4f7f5 0%, #eef3f0 45%, #e8eef1 100%);
    margin: 0;
    min-height: 100vh;
    color: #2f3a2f;
}

body.service-form-page form {
    margin: 0;
    width: 100%;
    max-width: 100%;
    display: block;
}

.sf-wrap {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 16px 48px;
    box-sizing: border-box;
}

.sf-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(60, 90, 40, 0.1);
    overflow: hidden;
    animation: sfIn 0.45s ease both;
    width: 100%;
    box-sizing: border-box;
}

@keyframes sfIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sf-brand {
    background: linear-gradient(165deg, #5f8f18 0%, #7bae00 45%, #4a7a2a 100%);
    color: #fff;
    padding: 18px 22px 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.sf-brand::after {
    content: '';
    position: absolute;
    top: -40px;
    left: -20px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.sf-brand-logo {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 10px;
    padding: 10px 14px;
    box-sizing: border-box;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.sf-brand-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    position: relative;
    z-index: 1;
    direction: ltr; /* date on the left, title on the right */
}

.sf-brand h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    flex: 1 1 auto;
    text-align: right;
    direction: rtl;
    order: 2;
}

.sf-brand-meta {
    position: static;
    margin: 14px 0 0;
    font-size: 0.95rem;
    opacity: 0.95;
    direction: ltr;
    unicode-bidi: isolate;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex: 0 0 auto;
    order: 1;
    text-align: left;
    align-self: flex-end;
    padding-bottom: 2px;
}

.sf-body {
    padding: 26px 28px 30px;
}

.sf-office {
    margin: 0 0 18px;
    line-height: 1.65;
    color: #4a554a;
    font-size: 0.95rem;
}

.sf-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #3d4a3d;
    margin: 22px 0 12px;
    padding-bottom: 0;
    border-bottom: 0;
}

.sf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}

.sf-grid .sf-full {
    grid-column: 1 / -1;
}

.sf-grid .sf-email {
    grid-column: 1 / -1;
    max-width: 420px;
}

.sf-email-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.sf-email-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(165deg, #dcedd7 0%, #d0e5ec 100%);
    color: #5f8f18;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.sf-field input.sf-input-ltr,
#clientEmail {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: isolate;
    width: 100%;
    max-width: none;
    padding-left: 48px !important;
    letter-spacing: 0.02em;
}

.sf-field input.sf-input-ltr::placeholder,
#clientEmail::placeholder {
    color: #9aa69a;
    opacity: 1;
    letter-spacing: 0;
}

.sf-email-wrap:focus-within .sf-email-icon {
    background: linear-gradient(165deg, #7bae00 0%, #5f8f18 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(123, 174, 0, 0.25);
}

.sf-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #5a675a;
    margin-bottom: 4px;
}

.sf-field .req {
    color: #c0392b;
    margin-left: 2px;
}

.sf-field input[type="text"],
.sf-field input[type="email"],
.sf-field input[type="tel"],
.sf-field input[type="date"],
.sf-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d5ddd5;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #2f3a2f;
    background: #fbfcfb;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.sf-field input:focus,
.sf-field textarea:focus {
    outline: none;
    border-color: #7bae00;
    box-shadow: 0 0 0 3px rgba(123, 174, 0, 0.18);
    background: #fff;
}

.sf-hint {
    font-size: 0.82rem;
    color: #7a857a;
    margin-top: 4px;
}

.sf-legal {
    background: #f7faf6;
    border: 1px solid #e2eadc;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #3f4a3f;
    max-height: 280px;
    overflow: auto;
}

.sf-prop {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
    background: linear-gradient(180deg, #f8fbf6 0%, #f3f7f4 100%);
    border-radius: 12px;
    padding: 16px 18px;
    border: 1px solid #e4ebdf;
    font-size: 0.92rem;
    line-height: 1.7;
}

.sf-prop strong {
    color: #5f8f18;
    font-weight: 600;
    margin-left: 4px;
}

.sf-sign-box {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 4px 0 0;
}

#signature {
    width: 100%;
    max-width: 420px;
    height: 160px;
    border: 1px solid #cfd8cf;
    border-radius: 10px;
    background: #fff;
    touch-action: none;
    margin: 0;
    margin-inline-start: 0;
    margin-inline-end: auto;
    direction: ltr;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

canvas.signature-pad {
    display: block;
    width: 100%;
    height: 100%;
    background: #ffffff;
    touch-action: none;
    border-radius: 10px;
    direction: ltr;
}

.sf-sign-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 12px;
    max-width: 420px;
}

.sf-btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 11px 22px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.sf-btn-secondary {
    background: #eef3ee;
    color: #3d4a3d;
}

.sf-btn-secondary:hover {
    background: #e2eadc;
}

.sf-btn-primary {
    background: linear-gradient(165deg, #6fa012 0%, #7bae00 55%, #5f8f18 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(123, 174, 0, 0.28);
    min-width: 160px;
}

.sf-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(123, 174, 0, 0.34);
}

.sf-btn-primary:disabled,
.sf-btn-primary:disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
    background: #9aaa8a;
}

.sf-submit-row {
    display: flex;
    justify-content: flex-start;
    margin-top: 14px;
    padding-top: 0;
    border-top: 0;
    max-width: 420px;
}

.sf-pics {
    text-align: center;
    margin-top: 20px;
}

.sf-pics img {
    max-width: 46%;
    height: auto;
    border-radius: 8px;
    margin: 4px;
}

.sf-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 0.85rem;
    color: #6a756a;
    line-height: 1.6;
}

.sf-footer a {
    color: #5f8f18;
}

/* Hide legacy DetailsView chrome */
body.service-form-page table.headertbl,
body.service-form-page #propertyDetails,
body.service-form-page table.sf-details {
    width: 100% !important;
    max-width: 100% !important;
    border: 0 !important;
    margin: 0 !important;
    table-layout: fixed !important;
}

body.service-form-page #propertyDetails,
body.service-form-page table.sf-details {
    display: block !important;
}

body.service-form-page #propertyDetails tbody,
body.service-form-page #propertyDetails tr,
body.service-form-page #propertyDetails td,
body.service-form-page table.sf-details tbody,
body.service-form-page table.sf-details tr,
body.service-form-page table.sf-details td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    border: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

/* Message overlay */
#formMsgOverlay {
    display: none;
    position: fixed;
    z-index: 2147483647;
    left: 0; top: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}
#formMsgOverlay.show { display: flex !important; }
#formMsgBox {
    background: #fff;
    border-radius: 14px;
    padding: 28px 30px 22px;
    min-width: 280px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
    font-family: 'Heebo', Arial, sans-serif;
    direction: rtl;
}
#formMsgBox.error { border-top: 6px solid #c0392b; }
#formMsgBox.ok { border-top: 6px solid #7bae00; }
#formMsgIcon { font-size: 42px; line-height: 1; margin-bottom: 10px; }
#formMsgBox.error #formMsgIcon { color: #c0392b; }
#formMsgBox.ok #formMsgIcon { color: #7bae00; }
#formMsgText { font-size: 18px; color: #333; margin: 0 0 20px; line-height: 1.55; }
#formMsgOk {
    background: #7bae00;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 9px 30px;
    font-size: 16px;
    cursor: pointer;
    font-family: inherit;
}
#formMsgBox.error #formMsgOk { background: #c0392b; }

@media (max-width: 700px) {
    .sf-wrap {
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 10px 10px 32px;
    }
    .sf-body { padding: 18px 14px 24px; }
    .sf-grid,
    .sf-prop { grid-template-columns: 1fr; }
    .sf-grid .sf-email {
        grid-column: 1;
        max-width: 100%;
    }
    .sf-field input.sf-input-ltr,
    #clientEmail {
        max-width: 100%;
    }
    .sf-brand { padding: 14px 14px 16px; }
    .sf-brand-row {
        flex-wrap: nowrap;
        align-items: center;
        direction: ltr;
    }
    .sf-brand h1 {
        font-size: 1.25rem;
        flex: 1 1 auto;
        order: 2;
        text-align: right;
    }
    .sf-brand-meta {
        order: 1;
        flex: 0 0 auto;
        text-align: left;
    }
    .sf-pics img { max-width: 100%; display: block; margin: 6px auto; }
}
