:root {
    --header-height: 154px;
    --footer-height: 44px;
    --green: #10824f;
    --soft-green: #edf8f2;
    --ink: #303030;
    --muted: #6f6f6f;
    --line: #dedede;
    --grey: #b9b9b9;

    /* PAYMENT CARD FONT SIZES — edit these values if needed */
    --payment-account-number-font-size: 20px;
    --payment-account-title-font-size: 17px;
    --payment-account-number-font-size-mobile: 16px;
    --payment-account-title-font-size-mobile: 15px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: #fff; color: var(--ink); font-family: "Noto Sans Arabic", "Segoe UI", Arial, sans-serif; }
button, input, select { font: inherit; }

.fixed-header {
    position: fixed;
    z-index: 20;
    inset: 0 0 auto;
    height: var(--header-height);
    overflow: hidden;
    background: #fff;
    border-bottom: 1px solid #999;
}

.language-toggle {
    position: absolute;
    right: 8px;
    top: 7px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 76px;
    height: 28px;
    padding: 2px;
    border: 1px solid #bbb;
    border-radius: 999px;
    background: #656364;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.language-toggle span {
    display: grid;
    place-items: center;
    border-radius: 999px;
    transition: .2s ease;
}

.language-toggle.ur-active .toggle-ur,
.language-toggle.en-active .toggle-en {
    background: #333132;
    color: #fff;
}

.brand-row {
    height: 112px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: ltr;
    gap: 10px;
}

.brand-row { flex-direction: column; gap: 3px; }
.brand-name { color: #174f3d; font-size: clamp(23px, 6vw, 34px); font-weight: 900; }
.brand-subtitle { color: var(--muted); font-size: 13px; font-weight: 700; }

.title-bar {
    position: relative;
    height: 42px;
    display: grid;
    place-items: center;
    direction: ltr;
    background: #333132;
    color: #fff;
    font-weight: 700;
    padding: 0 88px 0 8px;
    font-size: clamp(17px, 4.7vw, 23px);
    white-space: nowrap;
}

.scroll-pane {
    position: fixed;
    inset: var(--header-height) 0 var(--footer-height);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 14px 28px;
    background-color: #fff;
    background-image: linear-gradient(rgba(255,255,255,.88), rgba(255,255,255,.88)), url("images/background.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 96% auto;
}

#appointmentForm, .success-screen, .independent-notice { max-width: 620px; margin-inline: auto; }
.independent-notice { margin-bottom: 14px; padding: 13px 15px; border: 1px solid #e1b94d; border-radius: 12px; background: #fff8df; color: #4f411c; font-size: 12px; font-weight: 700; line-height: 1.7; }

.form-card {
    display: none;
    position: relative;
    margin: 0 0 12px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: linear-gradient(#f5f5f5, #e1e1e1);
    box-shadow: 0 3px 10px rgba(0,0,0,.06);
    animation: reveal .25s ease both;
}

.form-card.visible { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.step-number {
    position: absolute;
    top: 12px;
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #4a4a4a;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
}

/* Urdu numbers on the right; English numbers on the left. */
html[dir="rtl"] .step-number { right: 13px; }
html[dir="ltr"] .step-number { left: 13px; }
html[dir="rtl"] .form-card { padding-right: 52px; }
html[dir="ltr"] .form-card { padding-left: 52px; }

label, legend { display: block; margin: 0 0 7px; font-size: 14px; font-weight: 700; line-height: 1.55; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

select, input[type="text"], input[type="tel"], input[type="date"] {
    width: 100%;
    min-height: 44px;
    padding: 8px 11px;
    border: 1.5px solid #cfcfcf;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: #222;
}

select:focus, input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,130,79,.11); }
.conditional { display: none; margin-top: 10px; }
.conditional.visible { display: block; animation: reveal .2s ease both; }
.choice-grid, .payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stacked-choices { display: grid; gap: 8px; }

.choice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    margin: 0;
    padding: 8px 11px;
    border: 1.5px solid #ccc;
    border-radius: 10px;
    background: #fff;
}

.choice.wide { justify-content: flex-start; }
.choice:has(input:checked) { border-color: var(--green); background: var(--soft-green); }
.choice input, .agreement input { accent-color: var(--green); }
.inline-fieldset { margin-top: 10px; }
.manual-fields input[type="tel"] { direction: ltr; text-align: left; }
.upload-box { padding: 12px; border: 1.5px dashed var(--green); border-radius: 10px; background: #fff; }
input[type="file"] { width: 100%; direction: ltr; }
.chosen-file { margin-top: 8px; color: var(--green); font-size: 13px; font-weight: 700; }
.ocr-review-heading { display: none; margin-bottom: 10px; padding: 10px; border-radius: 9px; background: var(--soft-green); color: #075d39; }
.ocr-review-heading.visible { display: block; }
.ocr-review-heading small { display: block; margin-top: 4px; color: #537067; line-height: 1.5; }
.manual-fields > label, .two-columns label { margin-top: 8px; font-size: 13px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.name-fields { display: none; margin: 14px 0; }
.name-fields.visible { display: grid; animation: reveal .2s ease both; }
.manual-hint { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.price { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 10px; border-radius: 10px; background: #fff; }
.price strong { direction: ltr; color: #8a6415; font-size: 21px; }
.notice { margin: 10px 0; padding: 9px; border-radius: 8px; background: #fff6d9; color: #74591a; font-size: 12px; }
.payment-details { display: none; direction: ltr; margin: 12px 0; text-align: left; }
.payment-details.visible { display: block; animation: reveal .2s ease both; }
.payment-account-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) 112px;
    gap: 16px;
    align-items: center;
    min-height: 152px;
    padding: 14px 16px;
    border: 1px solid #bfc7c3;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
}
.payment-brand {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 14px;
    text-align: center;
}
.payment-brand strong { display: block; color: #252525; font-size: 15px; line-height: 1.15; }
.payment-brand-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #f3f3f3;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}
.payment-account-card.jazzcash .payment-brand-mark { background: #fff2b9; color: #c61c35; }
.payment-account-card.easypaisa .payment-brand-mark { background: #edf7ed; color: #3b286d; }
.payment-account-card.hbl .payment-brand-mark { background: #eaf8f7; color: #008c84; font-size: 18px; }
.payment-account-info { min-width: 0; }
.payment-field-label {
    display: inline-block;
    margin: 2px 0 5px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #2a8d7e;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;
}
.payment-account-number,
.payment-account-title {
    overflow-wrap: anywhere;
    color: #303030;
    font-weight: 900;
    line-height: 1.15;
}
.payment-account-number { margin: 0 0 9px; font-size: var(--payment-account-number-font-size); letter-spacing: .2px; }
.payment-account-title { font-size: var(--payment-account-title-font-size); }
.payment-qr-image {
    aspect-ratio: 1;
    width: 100%;
    display: block;
    object-fit: contain;
    border-radius: 8px;
    background: #f3f3f3;
}
.payment-proof { padding: 11px; border: 1.5px dashed var(--green); border-radius: 10px; background: #fff; }
.agreement { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; font-size: 12px; font-weight: 500; }
.agreement input { margin-top: 6px; }
.fee-disclosure { margin: 0 0 12px; padding: 10px 12px; border-radius: 9px; background: #fff; color: #555; font-size: 12px; line-height: 1.65; }
.policy-links { display: flex; justify-content: center; gap: 16px; margin: -4px 0 12px; direction: ltr; font-size: 12px; font-weight: 800; }
.policy-links a { color: #0b6840; }
.submit-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 15px; border: 0; border-radius: 10px; background: var(--green); color: white; text-align: center; text-decoration: none; font-weight: 800; cursor: pointer; }
.submit-button:disabled { cursor: wait; opacity: .82; }
.submit-spinner { display: none; font-size: 20px; font-weight: 900; line-height: 1; }
.submit-button.processing .submit-spinner { display: inline-block; animation: submit-spin .75s linear infinite; }
@keyframes submit-spin { to { transform: rotate(360deg); } }
.error { display: none; margin: 12px 0 0; padding: 10px; border-radius: 9px; background: #fff0f0; color: #a12626; font-size: 13px; }
.error.visible { display: block; }
.success-screen { display: none; padding: 28px 20px; border-radius: 18px; background: #eee; text-align: center; }
.success-screen.visible { display: block; }
.success-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: var(--soft-green); color: var(--green); font-size: 34px; font-weight: 900; }
.reference-number { direction: ltr; margin: 16px 0; padding: 13px; border: 1.5px dashed var(--green); border-radius: 10px; background: #fff; font-size: 23px; font-weight: 900; }
.success-screen p { color: var(--muted); line-height: 1.8; }

.fixed-footer {
    position: fixed;
    z-index: 20;
    inset: auto 0 0;
    height: var(--footer-height);
    display: flex;
    flex-direction: row;
    direction: ltr;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 4px 10px;
    background: linear-gradient(#bdbdbd, #dedede);
    color: #fff;
    font-size: clamp(12px, 3.5vw, 15px);
    font-weight: 700;
    border-top: 1px solid #999;
}

.fixed-footer a { color: #303030; text-decoration: none; font-weight: 800; white-space: nowrap; }
.website, .phone-link { direction: ltr; }
.footer-separator { color: #666; font-weight: 500; }

.sticky-whatsapp {
    position: fixed;
    z-index: 30;
    right: 12px;
    bottom: calc(var(--footer-height) + 12px);
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 5px 16px rgba(0,0,0,.22);
}

.sticky-whatsapp img { width: 46px; height: 46px; object-fit: contain; }

html.keyboard-open .fixed-footer,
html.keyboard-open .sticky-whatsapp { display: none; }
html.keyboard-open .fixed-header { display: none; }
html.keyboard-open .scroll-pane {
    top: 0;
    bottom: 42vh;
    padding-bottom: 16px;
}

@media (max-height: 700px) {
    :root { --header-height: 138px; --footer-height: 42px; }
    .brand-row { height: 100px; }
    .title-bar { height: 38px; }
    .language-toggle { top: 5px; }
}

@media (max-width: 520px) {
    .payment-account-card {
        grid-template-columns: 80px minmax(0, 1fr) 82px;
        gap: 10px;
        min-height: 122px;
        padding: 12px;
    }
    .payment-brand-mark { width: 48px; height: 48px; border-radius: 13px; font-size: 20px; }
    .payment-brand strong { font-size: 12px; }
    .payment-field-label { font-size: 9px; }
    .payment-account-number { font-size: var(--payment-account-number-font-size-mobile); }
    .payment-account-title { font-size: var(--payment-account-title-font-size-mobile); }
}

@media (max-width: 370px) {
    .choice-grid, .payment-grid, .two-columns { grid-template-columns: 1fr; }
    .payment-account-card { grid-template-columns: 70px minmax(0, 1fr) 68px; gap: 8px; padding: 10px; }
    .payment-brand-mark { width: 42px; height: 42px; }
    .payment-account-number { font-size: 14px; }
    .payment-account-title { font-size: 13px; }
    .fixed-footer { gap: 6px; padding-inline: 6px; }
    .fixed-footer { font-size: 12px; }
}

/* Website shortcode: use the same app interface without nested scrolling. */
html:has(body.website-embed),
html:has(body.website-embed) body { height: auto; min-height: 0; overflow: visible; }
body.website-embed .fixed-header,
body.website-embed .fixed-footer { position: relative; inset: auto; }
body.website-embed .scroll-pane { position: relative; inset: auto; height: auto !important; min-height: 0 !important; overflow: visible; }
body.website-embed .sticky-whatsapp { position: fixed; }
body.website-embed.keyboard-open .fixed-header,
body.website-embed.keyboard-open .fixed-footer { display: flex; }
body.website-embed.keyboard-open .scroll-pane { inset: auto; padding-bottom: 28px; }
