/* نموذج الطلب، والمراجعة، والمتابعة، ونتيجة الدفع، والإيصال */
/* هذه الصفحات تُرسم بعد تحميل البيانات: نحجز ارتفاعًا فلا يقفز التذييل داخل الشاشة (CLS) */
.rq, .tr, .pr, .rc { min-height: calc(100svh - 150px); }
.prog { margin: 8px 0 20px; }
.prog ol { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.prog li > span, .prog li > button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 8px 0 0; border: 0; border-top: 3px solid var(--line); background: none; font-size: 13.5px; line-height: 1.4; color: var(--text-2); text-align: start; cursor: default; }
.prog li > button { cursor: pointer; color: var(--text); min-height: 44px; }
.prog li.is-done > button { border-top-color: var(--ok); }
.prog li.is-cur > span { border-top-color: var(--action); color: var(--text); font-weight: 600; }
.pn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-size: 12.5px; font-weight: 600; }
.is-cur .pn { background: var(--action); color: #fff; }
.is-done .pn { background: var(--ok); color: #fff; }
@media (min-width: 720px) { .prog li > span, .prog li > button { flex-direction: row; align-items: center; font-size: 15px; } }

.step-h { font-size: 23px; margin: 0 0 14px; outline: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h3 { font-size: 17px; margin-bottom: 10px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.fld { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.fld:last-child { margin-bottom: 0; }
.fld > label, .fld > legend, .sub-l { display: block; font-weight: 500; margin-bottom: 6px; padding: 0; }
.sub-l { margin-top: 10px; }
.opt { color: var(--text-2); font-weight: 400; font-size: 14px; }
.hint { color: var(--text-2); font-size: 14px; margin: -2px 0 8px; line-height: 1.6; }
.inp { width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; font-size: 16px; }
.inp:focus { border-color: var(--text); }
textarea.inp { min-height: 80px; resize: vertical; }
.inp-sm { width: auto; min-height: 44px; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%); background-position: 16px 52%, 22px 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-inline-start: 36px; }
.fld:has(.err:not([hidden])) .inp, .fld:has(.err:not([hidden])) .opt-btn span { border-color: var(--err); }
.err { color: var(--err); font-size: 14.5px; margin: 6px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.err::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--err); color: #fff; font-size: 12px; font-weight: 700; margin-top: 3px; }
.err[hidden] { display: none; }
.errsum { border: 2px solid var(--err); background: var(--err-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; outline: none; }
.errsum ul { padding-inline-start: 18px; margin: 4px 0 0; }
.errsum a { color: var(--err); }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-btn { position: relative; display: inline-flex; }
.opt-btn input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt-btn span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; font-size: 15px; line-height: 1.45; }
.opt-btn input:checked + span { border-color: var(--action); background: var(--action-soft); color: var(--action-hover); font-weight: 500; box-shadow: inset 0 0 0 1px var(--action); }
.opt-btn input:checked + span::before { content: "✓"; margin-inline-end: 6px; font-weight: 700; }
.opt-btn input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.opts-days .opt-btn span { min-width: 120px; justify-content: center; }
.chk, .fld > label.chk { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; min-height: 44px; margin: 0; }
.chk input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--action); }
.chk-lg span { font-weight: 500; }
.num-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.num-wrap { position: relative; flex: 0 1 220px; }
.num { padding-inline-end: 52px; }
.num-unit { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); font-size: 14px; pointer-events: none; }
.num:disabled { background: var(--surface-2); }
.mat-row { display: flex; gap: 10px; align-items: center; }
.mat-row .inp { flex: 1; }
.sw-sm { width: 44px; height: 44px; }
.fld-inline { margin-bottom: 12px; }
.link-btn { background: none; border: 0; color: var(--action); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 4px; min-height: 40px; font-size: 15px; }
.it { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; scroll-margin-top: calc(var(--head-h) + 12px); }
.it-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.it-head h3 { font-size: 18px; margin: 0; }
.it-src { margin: 2px 0 0; font-size: 14px; color: var(--text-2); }
.rt { border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 4px; border: 1px solid var(--line); background: var(--surface-2); }
.rt p { margin: 0; }
.rt-label { font-weight: 500; }
.rt-why { font-size: 14px; color: var(--text-2); margin-top: 2px !important; }
.rt-final { background: var(--ok-soft); border-color: #BFD8C6; }
.rt-insp { background: var(--warn-soft); border-color: #E7D3A3; }
.rt-est { background: #E7ECF1; border-color: #C9D3DD; }
.add-row { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.add-row label { display: block; font-weight: 500; margin-bottom: 6px; }
.rq-nav { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0 24px; }
.rq-nav .btn-primary { margin-inline-start: auto; min-width: 160px; }
.geo { margin-top: 4px; }
.geo .hint { margin: 6px 0 0; }
.up-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.up-btn { position: relative; overflow: hidden; }
.up-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.up-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.files { list-style: none; display: grid; gap: 8px; margin-top: 10px; }
.file { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.file-n { font-weight: 500; overflow-wrap: anywhere; flex: 1 1 140px; }
.file-s { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; }
.file progress { width: 110px; height: 8px; }
.ok-t { color: var(--ok); }
.err-t { color: var(--err); }

.rv-list { list-style: none; display: grid; gap: 12px; }
.rv-it { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.rv-it:last-child { border-bottom: 0; padding-bottom: 0; }
.rv-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rv-top > div { display: grid; }
.rv-cost { font-weight: 600; white-space: nowrap; }
.rv-label { margin: 4px 0; font-size: 15px; }
.est { color: #2F4558; font-weight: 500; }
.ans { list-style: none; font-size: 14px; color: var(--text-2); display: grid; gap: 2px; margin: 4px 0; }
.rv-scope summary { cursor: pointer; font-size: 14.5px; color: var(--action); min-height: 40px; display: flex; align-items: center; }
.rv-scope p { margin: 4px 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.pill { display: inline-block; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-err { background: var(--err-soft); color: var(--err); }
.pill-grey { background: var(--surface-2); color: var(--text-2); }
.cost-t { width: 100%; border-collapse: collapse; font-size: 15px; }
.cost-t th, .cost-t td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.cost-t th { font-weight: 400; color: var(--text-2); padding-inline-end: 12px; }
.cost-t td { text-align: end; }
.cost-t tfoot th, .cost-t tfoot td { color: var(--text); font-weight: 600; font-size: 16.5px; border-bottom: 0; }
.ok-note { margin: 10px 0 0; color: var(--ok); font-weight: 500; }
.terms { padding-inline-start: 18px; display: grid; gap: 4px; font-size: 15px; margin-bottom: 8px; }
.rq-final { display: grid; gap: 10px; padding: 4px 0 28px; }
.center { text-align: center; }

.done, .pr-box { text-align: center; padding: 16px 0 24px; }
.done .card, .pr-box .card { text-align: start; }
.done-mark { width: 56px; height: 56px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 28px; font-weight: 700; }
.done-mark.is-warn { background: var(--warn-soft); color: var(--warn); }
.done-mark.is-err { background: var(--err-soft); color: var(--err); }
.done h2, .pr-box h2 { outline: none; }
.done .cta-row, .pr-box .cta-row { justify-content: center; margin-top: 12px; }
.ticks-plain { padding-inline-start: 18px; display: grid; gap: 4px; }

/* المتابعة */
.tr-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; margin-bottom: 12px; }
.tr-ref { font-size: 22px; font-weight: 600; margin: 0; }
.tr-status { font-size: 15px; }
.timeline { list-style: none; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 22px 14px 0; border-inline-start: 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 0; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 4px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.is-now::before { background: var(--action); box-shadow: 0 0 0 4px var(--action-soft); }
.timeline .t-l { font-weight: 500; }
.timeline .t-d { font-size: 13.5px; color: var(--text-2); }
.stages { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; font-size: 13px; }
.stages li { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.stages li.is-on { background: var(--action); color: #fff; }
.stages li.is-past { background: var(--ok-soft); color: var(--ok); }
.dues { list-style: none; display: grid; gap: 10px; }
.due { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.due b { font-size: 16px; }
.quote-t { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 8px 0; }
.quote-t th, .quote-t td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: start; }
.quote-t td.n { text-align: end; white-space: nowrap; }
.q-meta { font-size: 14px; color: var(--text-2); }
.login { max-width: 460px; }
.msgs { list-style: none; display: grid; gap: 8px; }
.msgs li { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; }

/* الإيصال */
.receipt { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 20px 0; }
.receipt h1 { font-size: 22px; }
.rc-test { border: 2px dashed var(--warn); color: var(--warn); border-radius: var(--radius-sm); padding: 8px 12px; font-weight: 600; margin-bottom: 14px; }
.rc-amt { font-size: 26px; font-weight: 600; margin: 8px 0 16px; }
@media print { .receipt { border: 0; margin: 0; padding: 0; } .no-print { display: none !important; } }
