/* ==================================================================
   تم — استمارة الطلب (/order)
   خفيفة لـ3G: خطوط النظام، بلا صور ثقيلة، بلا مكتبات.
   ================================================================== */
:root{
  --bg:#F4F4F5; --surface:#FFFFFF; --surface-2:#EDEEEF;
  --ink:#1B1E20; --ink-2:#43484B; --muted:#6A7073;
  --rule:#DBDDDE; --rule-2:#C3C7C9;
  --brand:#AC5214;           /* برتقالي آمن للنص على الأبيض */
  --brand-fill:#F3961D;      /* برتقالي الشعار للمساحات */
  --on-brand:#1B1E20;
  --brand-soft:#FBEBDD;
  --charcoal:#343839;
  --danger:#9E362D; --ok:#2E7D4F;
  --r:14px;
  --shadow:0 1px 2px rgba(20,24,26,.05),0 10px 30px -22px rgba(20,24,26,.6);
  --font:"Segoe UI","Noto Sans Arabic","Dubai",Tahoma,system-ui,sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#1B1E1F; --surface:#242829; --surface-2:#2D3132;
    --ink:#ECEDEE; --ink-2:#C9CDCF; --muted:#9AA0A3;
    --rule:#383C3E; --rule-2:#4A4F51;
    --brand:#F3961D; --brand-soft:#3B2610;
    --danger:#E58176; --ok:#6CC592;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px -22px rgba(0,0,0,.9);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#1B1E1F; --surface:#242829; --surface-2:#2D3132;
  --ink:#ECEDEE; --ink-2:#C9CDCF; --muted:#9AA0A3;
  --rule:#383C3E; --rule-2:#4A4F51;
  --brand:#F3961D; --brand-soft:#3B2610;
  --danger:#E58176; --ok:#6CC592;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 30px -22px rgba(0,0,0,.9);
  color-scheme:dark;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:17px;line-height:1.55;
  padding-bottom:env(safe-area-inset-bottom)}
button,input,textarea{font:inherit;color:inherit}
[hidden]{display:none!important}
a{color:var(--brand)}

/* ---------- الشريط العلوي ---------- */
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;
  background:var(--charcoal);color:#fff;position:sticky;top:0;z-index:5}
.brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none}
.brand img{border-radius:9px;background:#fff}
.brand span{display:flex;flex-direction:column;line-height:1.15}
.brand b{font-size:1.15rem}
.brand small{font-size:.78rem;color:#F3961D;font-weight:600}
.icon-btn{width:44px;height:44px;border-radius:12px;border:1px solid rgba(255,255,255,.18);background:transparent;
  cursor:pointer;font-size:1.1rem;display:grid;place-items:center}
.sheet .icon-btn{border-color:var(--rule)}

.wrap{max-width:620px;margin:0 auto;padding:14px 16px 120px}

/* ---------- الخطوات ---------- */
.steps{list-style:none;display:flex;gap:6px;margin:4px 0 14px;padding:0}
.steps li{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:.78rem;color:var(--muted);text-align:center}
.steps li i{font-style:normal;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;
  background:var(--surface-2);border:2px solid var(--rule-2);font-weight:700;color:var(--ink-2)}
.steps li.on{color:var(--ink);font-weight:700}
.steps li.on i{background:var(--brand-fill);border-color:var(--brand-fill);color:var(--on-brand)}
.steps li.past i{background:var(--charcoal);border-color:var(--charcoal);color:#fff}

/* ---------- الأقسام ---------- */
.step h1{font-size:1.45rem;margin:4px 0 2px}
.lead{margin:0 0 16px;color:var(--ink-2);font-size:.95rem}
.f{display:block;margin:0 0 14px;scroll-margin-top:76px}
#details,.cards,.err{scroll-margin-top:76px}
.f > span,.f .lbl{display:block;font-weight:600;font-size:.95rem;margin-bottom:6px}
.f em{color:var(--danger);font-style:normal}
.f small,.hint{color:var(--muted);font-weight:400;font-size:.82rem}
.hint{margin:-6px 0 14px}
.narrow{max-width:180px}
input[type=text],input[type=tel],input[type=number],input[type=date],input[type=search],textarea{
  width:100%;min-height:52px;padding:12px 14px;border-radius:12px;border:1.5px solid var(--rule-2);
  background:var(--surface);font-size:1.02rem;outline:none;transition:border-color .15s}
textarea{min-height:110px;resize:vertical}
input:focus,textarea:focus{border-color:var(--brand-fill);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand-fill) 25%,transparent)}
input[dir=ltr]{text-align:left}
input[dir=ltr]::placeholder{text-align:left}
.bad input,.bad .pick,input.bad,.bad input:focus{border-color:var(--danger)!important}
.f + .err,.duo + .err,.cards + .err{margin-top:-6px}
.duo{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width:420px){.duo{grid-template-columns:1fr}}

/* منتقٍ على شكل حقل */
.pick{width:100%;min-height:52px;display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:10px 14px;border-radius:12px;border:1.5px solid var(--rule-2);background:var(--surface);cursor:pointer;text-align:right}
.pick span{flex:1;overflow:hidden;text-overflow:ellipsis}
.pick.empty span{color:var(--muted)}
.pick:disabled{opacity:.55;cursor:not-allowed}
.pick b{color:var(--muted)}

/* رقائق ومقاطع */
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips button,.seg button{min-height:46px;padding:8px 14px;border-radius:999px;border:1.5px solid var(--rule-2);
  background:var(--surface);cursor:pointer;font-weight:600;font-size:.95rem}
.chips button.on,.seg button.on{background:var(--charcoal);border-color:var(--charcoal);color:#fff}
:root[data-theme="dark"] .chips button.on,:root[data-theme="dark"] .seg button.on{background:var(--brand-fill);border-color:var(--brand-fill);color:var(--on-brand)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .chips button.on,:root:not([data-theme="light"]) .seg button.on{background:var(--brand-fill);border-color:var(--brand-fill);color:var(--on-brand)}}
.seg{display:flex;gap:6px}
.seg button{flex:1;border-radius:12px}

/* بطاقات الخدمات */
.cards{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:18px}
.card{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-height:96px;padding:12px;border-radius:var(--r);
  border:1.5px solid var(--rule);background:var(--surface);box-shadow:var(--shadow);cursor:pointer;text-align:right}
.card .ic{font-size:1.5rem;line-height:1.2}
.card b{font-size:.98rem}
.card small{color:var(--muted);font-size:.76rem;line-height:1.35}
.card.on{border-color:var(--brand-fill);background:var(--brand-soft);box-shadow:0 0 0 2px var(--brand-fill)}
.card.on small{color:var(--ink-2)}

.note{background:var(--brand-soft);border-radius:var(--r);padding:12px 14px;margin:0 0 16px;font-size:.92rem;color:var(--ink)}
.toggle{display:flex;align-items:center;gap:10px;margin-top:10px;min-height:44px;font-weight:600;cursor:pointer}
.toggle input{width:24px;height:24px;accent-color:var(--brand-fill)}

/* المرفقات */
.drop{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;padding:22px 14px;border:2px dashed var(--rule-2);
  border-radius:var(--r);background:var(--surface);text-align:center;cursor:pointer;margin-bottom:12px}
.drop input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.drop-ic{font-size:2rem}
.drop small{color:var(--muted);font-size:.82rem}
.drop.busy{opacity:.6}
.thumbs{list-style:none;padding:0;margin:0 0 16px;display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}
.thumbs li{position:relative;border-radius:12px;overflow:hidden;background:var(--surface-2);aspect-ratio:1;display:flex;
  flex-direction:column;align-items:center;justify-content:center;font-size:.72rem;color:var(--ink-2);text-align:center;padding:4px}
.thumbs img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.thumbs .doc{font-size:1.8rem}
.thumbs .nm{word-break:break-all;max-height:3.2em;overflow:hidden}
.thumbs .sz{position:absolute;bottom:4px;left:4px;background:rgba(0,0,0,.6);color:#fff;border-radius:6px;padding:0 5px;font-size:.68rem}
.thumbs .x{position:absolute;top:4px;right:4px;width:34px;height:34px;border-radius:50%;border:0;background:rgba(0,0,0,.65);
  color:#fff;font-size:1rem;cursor:pointer;display:grid;place-items:center}

.summary{background:var(--surface);border:1px solid var(--rule);border-radius:var(--r);padding:12px 14px;margin:0 0 10px;font-size:.92rem}
.summary dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:4px 12px}
.summary dt{color:var(--muted)}
.summary dd{margin:0;font-weight:600;word-break:break-word}
.summary .edit{background:none;border:0;color:var(--brand);font-weight:700;cursor:pointer;padding:8px 0;min-height:40px}
.consent{font-size:.85rem;color:var(--ink-2);margin:0 0 10px}

.err{background:color-mix(in srgb,var(--danger) 12%,var(--surface));color:var(--danger);border-radius:12px;padding:10px 14px;
  font-weight:600;margin:6px 0 10px}
.err .btn{margin-top:8px}
.warn{background:var(--brand-soft);padding:12px;border-radius:12px}
/* لا left:-9999px: في صفحة RTL يصير فيضاً قابلاً للتمرير ويوسّع الصفحة على الهاتف */
.hp{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;opacity:0;pointer-events:none}

/* الأزرار */
.bar{position:fixed;inset:auto 0 0 0;z-index:4;display:flex;gap:10px;padding:10px 16px calc(10px + env(safe-area-inset-bottom));
  background:color-mix(in srgb,var(--bg) 92%,transparent);border-top:1px solid var(--rule);backdrop-filter:blur(6px)}
.bar .btn{flex:1}
@media (min-width:660px){.bar{position:static;padding:10px 0;background:none;border:0;backdrop-filter:none}}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:54px;padding:10px 18px;border-radius:14px;
  border:1.5px solid transparent;font-weight:700;font-size:1.05rem;cursor:pointer;text-decoration:none}
.btn.sm{min-height:48px;font-size:.95rem;padding:8px 14px}
.btn.primary{background:var(--brand-fill);color:var(--on-brand)}
.btn.primary:active{filter:brightness(.95)}
.btn.primary:disabled{opacity:.6;cursor:progress}
.btn.ghost{background:var(--surface);border-color:var(--rule-2);color:var(--ink)}
.btn.wide{width:100%;margin-top:10px}
.link{background:none;border:0;color:var(--brand);font-weight:700;cursor:pointer;padding:10px 0;min-height:44px;text-decoration:underline}

/* بعد الإرسال */
.done{text-align:center;padding:20px 0}
.done-ic{width:72px;height:72px;margin:0 auto 8px;border-radius:50%;background:var(--ok);color:#fff;font-size:2.2rem;display:grid;place-items:center}
.done h1{margin:4px 0}
.done p{margin:10px 0 4px;color:var(--ink-2)}
.order-no{font-size:2rem;font-weight:800;letter-spacing:.06em;direction:ltr;padding:8px 22px;border-radius:14px;
  border:2px dashed var(--brand-fill);background:var(--surface);cursor:pointer}
.copied{display:block;color:var(--ok);font-weight:700;margin-top:4px}
.next{text-align:right;background:var(--surface);border:1px solid var(--rule);border-radius:var(--r);padding:12px 34px 12px 14px;margin:18px 0 8px}
.next li{margin:4px 0}

/* المنتقي */
.sheet{position:fixed;inset:0;z-index:10;background:rgba(0,0,0,.45);display:flex;align-items:flex-end;justify-content:center}
.sheet-box{background:var(--surface);width:100%;max-width:620px;height:88vh;height:88dvh;border-radius:18px 18px 0 0;display:flex;flex-direction:column;
  padding:12px 16px calc(12px + env(safe-area-inset-bottom))}
@media (min-width:660px){.sheet{align-items:center}.sheet-box{border-radius:18px;height:80vh}}
.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:1.1rem}
.sheet-list{list-style:none;margin:10px 0 0;padding:0;overflow-y:auto;flex:1;-webkit-overflow-scrolling:touch}
.sheet-list li button{width:100%;text-align:right;min-height:52px;padding:10px 8px;border:0;border-bottom:1px solid var(--rule);
  background:none;cursor:pointer;display:flex;flex-direction:column;align-items:flex-start}
.sheet-list li button:active,.sheet-list li button:focus{background:var(--surface-2)}
.sheet-list li button small{color:var(--muted);font-size:.8rem}
.sheet-list .grp{font-size:.78rem;color:var(--muted);font-weight:700;padding:12px 8px 4px;position:sticky;top:0;background:var(--surface)}
.sheet-list .none{padding:16px 8px;color:var(--muted)}
.sheet-free{border-top:1px solid var(--rule);padding-top:6px}
.free-row{display:flex;gap:8px}
.free-row input{flex:1}

/* بعد الإرسال: تذكير بصفحة التتبّع */
.track-note{margin:12px 0 0;padding:10px 12px;border-radius:12px;background:var(--brand-soft);color:var(--ink);font-size:.9rem;text-align:right}
.track-link{text-align:center;margin:8px 0 0;font-size:.9rem}

/* ---------- إتاحة (تدقيق 2026-09-28) ----------
   حلقة تركيز للوحة المفاتيح؛ حقل الملفات شفاف فوق منطقة الإسقاط فتظهر الحلقة على المنطقة كلها؛
   الشريط الفحمي يأخذ برتقالي الشعار لأن البرتقالي الغامق لا يُرى عليه؛ واحترام «تقليل الحركة». */
:where(a,button,summary,[tabindex]):focus-visible{outline:3px solid var(--brand);outline-offset:2px}
.top :focus-visible{outline-color:var(--brand-fill)}
.drop:focus-within{outline:3px solid var(--brand);outline-offset:3px;border-style:solid}
.brand{min-height:44px}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;
    transition-duration:.01ms!important;scroll-behavior:auto!important}
}
