@charset "UTF-8";
/* =====================================================================
   بوابة العملاء — واجهة عامة
   ---------------------------------------------------------------------
   منفصلة عن واجهة الموظفين عمداً: الزائر هنا عميل لا موظف، يفتحها من جواله
   غالباً ومرة واحدة. فالأولوية للوضوح وكبر الأهداف، لا لكثافة المعلومات.
   تستعمل متغيّرات الهوية من app.css فتتبع ألوان الشركة تلقائياً.
   ===================================================================== */

.portal {
  background: var(--c-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal__shell { width: min(920px, 92vw); margin-inline: auto; }

/* ------------------------------ الترويسة ------------------------------ */
.portal__head {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding-block: 14px;
  position: sticky; top: 0; z-index: 20;
}
.portal__head .portal__shell {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.portal__brand img { height: 46px; width: auto; }
.portal__brand-txt { font-weight: 800; font-size: 18px; color: var(--c-primary); }

.portal__nav { display: flex; gap: 6px; margin-inline-start: auto; }
.portal__nav a {
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14.5px; color: var(--c-muted);
  display: inline-flex; align-items: center; gap: 7px;
}
.portal__nav a:hover { background: var(--c-surface-2); color: var(--c-text); }
.portal__nav a.is-active { background: var(--c-primary); color: #fff; }

/* -------------------------------- المتن -------------------------------- */
.portal__main { flex: 1; padding-block: clamp(24px, 5vw, 48px); }

.portal__intro { margin-bottom: 26px; }
.portal__intro h1 { font-size: clamp(24px, 4.5vw, 34px); font-weight: 800; margin: 0 0 10px; }
.portal__intro p { color: var(--c-muted); font-size: 15.5px; line-height: 1.9; max-width: 62ch; margin: 0; }

.portal__card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: clamp(20px, 3.5vw, 34px);
  box-shadow: var(--shadow-sm);
}
.portal__card--narrow { max-width: 640px; }

.portal__group { border: 0; padding: 0; margin: 0 0 30px; }
.portal__group:last-of-type { margin-bottom: 20px; }
.portal__group legend {
  font-size: 15px; font-weight: 800; color: var(--c-text);
  padding: 0 0 14px; margin: 0; width: 100%;
  border-bottom: 2px solid var(--c-primary-50);
  margin-bottom: 18px;
}

/* حقول أكبر من واجهة الموظفين: الاستخدام من الجوال هو الغالب */
.portal .form-control, .portal .form-select {
  padding: 12px 14px; font-size: 15.5px;
  border-color: var(--c-border);
}
.portal .form-control:focus, .portal .form-select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-50);
}
.portal .form-label { font-weight: 700; font-size: 14.5px; margin-bottom: 7px; }
.portal .req { color: var(--c-danger); }
.portal .form-text { font-size: 12.5px; }


.portal__previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.portal__preview {
  position: relative; width: 92px; height: 92px; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--c-border); background: var(--c-surface-2);
  display: grid; place-items: center;
}
.portal__preview img { width: 100%; height: 100%; object-fit: cover; }
.portal__preview i { font-size: 26px; color: var(--c-danger); }
.portal__preview span {
  position: absolute; inset-inline: 0; bottom: 0;
  background: rgba(15, 23, 42, .78); color: #fff;
  font-size: 10px; padding: 3px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.portal__actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--c-border);
}
.portal__actions .btn-lg { padding: 13px 34px; font-size: 16px; font-weight: 700; }

.portal__note, .portal__hint {
  margin: 16px 0 0; font-size: 13px; color: var(--c-muted);
  display: flex; align-items: flex-start; gap: 8px; line-height: 1.8;
}
.portal__hint { background: var(--c-primary-50); color: var(--c-primary-700);
  padding: 12px 14px; border-radius: var(--radius-sm); }

/* ------------------------------ صفحة النجاح ------------------------------ */
.portal__done {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: clamp(28px, 5vw, 52px);
  text-align: center; box-shadow: var(--shadow-sm);
}
.portal__done-mark {
  width: 78px; height: 78px; border-radius: 50%;
  background: var(--c-success); color: #fff;
  display: grid; place-items: center; font-size: 42px;
  margin: 0 auto 20px;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes pop { from { transform: scale(.5); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .portal__done-mark { animation: none } }

.portal__done h1 { font-size: clamp(22px, 4vw, 30px); font-weight: 800; margin: 0 0 12px; }
.portal__done-lede { color: var(--c-muted); font-size: 15.5px; line-height: 1.9; max-width: 54ch; margin: 0 auto 26px; }

.portal__ticket {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-700));
  color: #fff; border-radius: var(--radius);
  padding: 22px 26px; margin: 0 auto 18px; max-width: 460px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.portal__ticket-label { font-size: 12.5px; opacity: .8; font-weight: 600; }
.portal__ticket-no { font-size: clamp(26px, 5vw, 36px); font-weight: 800; letter-spacing: 1px; }

.portal__due { color: var(--c-muted); font-size: 14px; margin: 0 0 24px; }
.portal__done-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.portal__done .portal__note { justify-content: center; margin-top: 24px; }

/* ------------------------------ نتيجة الاستعلام ------------------------------ */
.portal__result {
  margin-top: 26px; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  border-inline-start: 5px solid var(--c-muted);
  padding: clamp(20px, 3.5vw, 30px); box-shadow: var(--shadow-sm);
}
.portal__result.is-open    { border-inline-start-color: #0ea5e9; }
.portal__result.is-working { border-inline-start-color: var(--c-warning); }
.portal__result.is-closed  { border-inline-start-color: var(--c-success); }

.portal__result-head {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  justify-content: space-between; padding-bottom: 18px;
  border-bottom: 1px solid var(--c-border); margin-bottom: 18px;
}
.portal__result-label { display: block; font-size: 12px; color: var(--c-muted); font-weight: 600; }
.portal__result-head strong { font-size: 21px; font-weight: 800; }

.portal__state {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px;
  font-weight: 700; font-size: 14px;
  background: var(--c-surface-2); color: var(--c-text);
}
.is-open    .portal__state { background: #e0f2fe; color: #075985; }
.is-working .portal__state { background: #fef3c7; color: #854d0e; }
.is-closed  .portal__state { background: #d1fae5; color: #065f46; }

.portal__result-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px; margin: 0;
}
.portal__result-grid dt { font-size: 12.5px; color: var(--c-muted); font-weight: 600; margin-bottom: 3px; }
.portal__result-grid dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--c-text); }

.portal__reply {
  margin-top: 20px; padding: 18px 20px;
  background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: var(--radius-sm);
}
.portal__reply-head { font-weight: 800; color: #065f46; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.portal__reply-body { color: #064e3b; line-height: 1.95; white-space: pre-wrap; font-size: 15px; }

.portal__progress {
  margin-top: 20px; padding: 18px 20px;
  background: var(--c-surface-2); border-radius: var(--radius-sm);
  display: flex; gap: 14px; align-items: flex-start;
}
.portal__progress > i { font-size: 24px; color: var(--c-warning); }
.portal__progress-sub { color: var(--c-muted); font-size: 14px; margin-top: 4px; line-height: 1.8; }

/* ------------------------------- التذييل ------------------------------- */
.portal__foot {
  border-top: 1px solid var(--c-border); background: var(--c-surface);
  padding-block: 20px; text-align: center;
  font-size: 13px; color: var(--c-muted);
}
.portal__foot-sep { margin-inline: 8px; opacity: .5; }
.portal__foot a { color: var(--c-primary); font-weight: 600; }

@media (max-width: 560px) {
  .portal__nav { width: 100%; }
  .portal__nav a { flex: 1; justify-content: center; }
  .portal__actions .btn-lg { width: 100%; justify-content: center; }
}
