/* القائمة الشاقولية لمسار الطالب (المالك 2026-09-24)
   ---------------------------------------------------------
   One design shared by the account page (edit-request.html) and the
   registration form (form.html): a fixed right-side list of stages beside the
   content, a horizontal scrolling strip on phones. The state of every item is
   written in words (✓ / reason), never shown by colour alone. */

.account-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.account-layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.account-layout.no-sidebar > .account-sidebar { display: none; }
.account-sidebar { background: var(--surface-soft); border: 1px solid var(--line-soft); border-radius: 14px; padding: 10px; position: sticky; top: 16px; align-self: start; }
.account-sidebar .account-sidebar-title { margin: 2px 4px 8px; color: var(--text); font-size: .78rem; font-weight: 800; }
.account-sidebar nav { display: flex; flex-direction: column; gap: 5px; }

.account-nav a { display: flex; flex-direction: column; align-items: stretch; gap: 2px; color: var(--text); background: var(--surface); border: 1px solid #B8A678; border-radius: 10px; padding: 9px 12px; font-size: .82rem; font-weight: 700; text-decoration: none; transition: .2s ease; line-height: 1.5; }
.account-nav a .nav-row { display: flex; align-items: center; gap: 9px; }
.account-nav a .nav-row > i { width: 1.1em; text-align: center; }
.account-nav a .nav-label { flex: 1; }
.account-nav a:hover, .account-nav a:focus-visible { color: #FFFFFF; background: #002623; border-color: #002623; outline: none; }
.account-nav a:focus-visible { box-shadow: 0 0 0 3px #B8A678; }
.account-nav a.is-current { background: #002623; color: #FFFFFF; border-color: #002623; }

/* A finished stage: the mark is text, so it reads without colour. */
.account-nav a .nav-done { font-size: .72rem; font-weight: 800; color: var(--text-info); }
.account-nav a.is-current .nav-done, .account-nav a:hover .nav-done { color: #FFFFFF; }

/* Red only where the applicant must act (a correction). */
.account-nav a.needs-urgent { border-color: #6C1E2B; border-inline-start-width: 4px; }
.account-nav a.needs-urgent.is-current { background: #6C1E2B; border-color: #6C1E2B; }

.account-nav a .nav-badge { background: var(--surface-soft); color: var(--text); border-radius: 999px; padding: 1px 8px; font-size: .68rem; font-weight: 800; }
.account-nav a.is-current .nav-badge { background: var(--surface); color: var(--text); }
.account-nav a.needs-urgent .nav-badge { background: #6C1E2B; color: #FFFFFF; }

/* A locked stage keeps readable text and says why it is locked. */
.account-nav a.is-unavailable { background: var(--surface); color: var(--text-soft); border: 1px dashed #978362; cursor: not-allowed; font-weight: 600; }
.account-nav a.is-unavailable:hover, .account-nav a.is-unavailable:focus { background: var(--surface); color: var(--text-soft); border-color: #978362; }
.account-nav a.is-unavailable .nav-row > i { color: var(--text-sand); }
.account-nav .nav-lock-reason { font-size: .68rem; font-weight: 400; color: var(--text-soft); }

/* A stage that lives on the other page (form ⇄ account). */
.account-nav .nav-separator { margin: 6px 4px 2px; color: var(--text-soft); font-size: .7rem; font-weight: 700; border-top: 1px dashed #978362; padding-top: 6px; }

.account-content { min-width: 0; }
.account-content h3:focus-visible, .account-content h4:focus-visible { outline: 2px solid #002623; outline-offset: 3px; border-radius: 4px; }
.account-pane-hidden { display: none !important; }

/* الصفحة العامة للمفاضلة: الحالة أولاً، ثم مصادر المعلومات الثلاثة.
   لا تعتمد الحالة على اللون وحده؛ الاسم والمدة يظلان مكتوبين بجانب الـ LED. */
.public-competition-bar { padding: 13px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.competition-live-status { display: flex; align-items: center; min-width: 300px; }
.competition-status-led { font-size: 1.35rem; line-height: 1; }
.competition-status-copy { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.competition-status-label { color: var(--text-soft); font-size: .78rem; font-weight: 800; }
#statusTextShort { color: var(--text); font-size: .98rem; font-weight: 800; }
#countdownTimerShort { color: var(--text-soft); font-size: .78rem; line-height: 1.6; padding-inline-start: 8px; border-inline-start: 1px solid #B8A678; }
.public-resource-actions { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; }
.public-resource-btn { min-height: 44px; border: 1px solid #B8A678; border-radius: 11px; background: var(--surface); color: var(--text); cursor: pointer; padding: 9px 13px; font: 800 .8rem var(--font-brand); display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; }
.public-resource-btn i { color: var(--text-emerald); font-size: .95rem; }
.public-resource-btn:hover, .public-resource-btn:focus-visible { background: #002623; color: #FFFFFF; border-color: #002623; outline: none; transform: translateY(-1px); }
.public-resource-btn:hover i, .public-resource-btn:focus-visible i { color: #FFFFFF; }
.public-seats-dialog { border: 0; padding: 0; border-radius: 18px; width: min(980px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px)); color: var(--text); background: var(--surface); box-shadow: 0 20px 56px rgba(0, 38, 35, .30); }
.public-seats-dialog::backdrop { background: rgba(0, 38, 35, .54); }
.public-seats-head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line-soft); }
.public-seats-kicker { margin: 0 0 4px; color: var(--text-info); font-size: .72rem; font-weight: 800; }
.public-seats-head h2 { margin: 0; font-size: 1.1rem; }
.public-seats-head h2 i { color: var(--text-sand); margin-inline-end: 7px; }
.public-seats-head p:not(.public-seats-kicker) { margin: 6px 0 0; color: var(--text-soft); font-size: .78rem; line-height: 1.7; }
.public-seats-close { flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid #B8A678; border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem; }
.public-seats-close:hover, .public-seats-close:focus-visible { background: #002623; color: #FFFFFF; outline: none; }
.public-seats-filters { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(210px, 1fr); gap: 10px; padding: 14px 22px 8px; }
.public-seats-filters label { color: var(--text); font-size: .74rem; font-weight: 800; }
.public-seats-filters select, .public-seats-filters input { width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid #B8A678; border-radius: 9px; background: var(--surface); color: var(--text); font: .84rem var(--font-brand); }
.public-seats-state { margin: 7px 22px 10px; color: var(--text-soft); font-size: .78rem; }
.public-seats-table-wrap { max-height: 480px; overflow: auto; padding: 0 22px 22px; }
.public-announcement-frame { display: block; width: calc(100% - 44px); height: min(620px, 68vh); margin: 0 22px 22px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); }
.gate-support-title { margin-top: 16px !important; padding-top: 12px; border-top: 1px dashed #978362; }
.public-seats-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.public-seats-table th, .public-seats-table td { border-bottom: 1px solid var(--line-soft); text-align: right; padding: 9px 8px; }
.public-seats-table th { position: sticky; top: 0; background: var(--surface-soft); color: var(--text); font-weight: 800; }
.public-seats-empty { padding: 28px 12px; text-align: center; color: var(--text-soft); }

/* Registration form: once the menu is shown it replaces the older step circles
   and the step buttons of the file summary (their markup stays; the summary
   line, correction alert and eligibility notes stay visible). */
body.form-stage-nav-on .page-progress-steps,
body.form-stage-nav-on #fileProgress .progress-steps { display: none !important; }

/* The menu moves between stages and a sent section carries the applicant on
   by itself, so «السابق» / «التالي» and the page numbers are gone (owner,
   2026-09-24). The bar keeps only the action of the stage, centred: «إرسال
   القسم», or «مراجعة البيانات وإتمام التسجيل» on the last stage. */
body.form-stage-nav-on .bottom-nav-bar .btn-prev,
body.form-stage-nav-on .bottom-nav-bar .btn-next:not(#prepareReportBtn),
body.form-stage-nav-on .bottom-nav-bar .page-indicator,
body.form-stage-nav-on .page-progress-text { display: none !important; }
body.form-stage-nav-on .bottom-nav-bar { justify-content: center; }
body.form-stage-nav-on .bottom-nav-bar .nav-forward { justify-content: center; }
body.form-stage-nav-on .bottom-nav-bar .nav-forward .btn-section-submit { min-width: 220px; justify-content: center; }
/* ===== الصفحة الأولى: بوابة الدخول والدعم (المالك 2026-09-24) ===== */
/* No page numbers anywhere, and nothing on page 1 that only makes sense after
   signing in (the step bar at its foot, the «مسح» button). */
.page-progress-text { display: none !important; }
#page1 > .bottom-nav-bar { display: none !important; }

.gate-intro { text-align: right; background: var(--surface); border-inline-start: 3px solid var(--edge); border-radius: 10px; padding: 12px 16px; margin: 0 0 14px; color: var(--text); font-size: .85rem; line-height: 1.9; }
.gate-intro p { margin: 0; }
.gate-intro i { color: var(--text); margin-inline-end: 6px; }
.gate-intro details { margin-top: 6px; }
.gate-intro summary { cursor: pointer; font-weight: 700; color: var(--text-emerald); min-height: 44px; display: flex; align-items: center; }
.gate-intro details p { margin-top: 4px; color: var(--text-soft); }

.student-entry-gate .student-entry-content { text-align: right; width: 100%; }
.gate-layout { margin-top: 12px; }
.gate-layout .account-nav a { min-height: 44px; }
.gate-content { min-width: 0; }

.gate-choices { display: grid; gap: 8px; margin: 10px 0 4px; }
.gate-choice { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: right; background: var(--surface); color: var(--text); border: 1px solid #B8A678; border-radius: 12px; padding: 12px 14px; min-height: 56px; font: inherit; cursor: pointer; transition: .15s ease; }
.gate-choice > i { font-size: 1.1rem; margin-top: 3px; width: 1.4em; text-align: center; color: var(--text-emerald); }
.gate-choice strong { display: block; font-size: .92rem; }
.gate-choice small { display: block; color: var(--text-soft); font-size: .78rem; line-height: 1.7; margin-top: 2px; }
.gate-choice:hover, .gate-choice:focus-visible { border-color: var(--edge); background: var(--surface-soft); outline: none; }
.gate-choice:focus-visible { box-shadow: 0 0 0 3px #B8A678; }
.gate-choice.is-locked { cursor: not-allowed; border-style: dashed; border-color: #978362; background: var(--surface); }
.gate-choice.is-locked > i { color: var(--text-sand); }
.gate-safety { display: flex; align-items: center; gap: 8px; }
.support-ticket { border: 1px solid var(--line-soft); border-inline-start: 4px solid var(--edge); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: var(--surface); color: var(--text); font-size: .85rem; line-height: 1.8; }
.support-ticket.is-closed { border-inline-start-color: #978362; }
.support-ticket .ticket-reply { margin-top: 6px; padding: 6px 10px; background: var(--surface-soft); border-radius: 8px; }

@media (max-width: 860px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); }
  .account-sidebar { position: static; padding: 6px; }
  .account-sidebar .account-sidebar-title { display: none; }
  .account-sidebar nav { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 3px; }
  .account-nav a { flex: 0 0 auto; white-space: nowrap; }
  .account-nav .nav-lock-reason, .account-nav .nav-separator { display: none; }
  /* A short part (e.g. «التنبيهات») must still be able to start at the top
     of the screen under the menu after a tap (owner's testing, 2026-09-27). */
  .account-layout:not(.gate-layout):not(.form-stage-layout) .account-content { min-height: 100vh; }
  /* The gate has only four entries: all visible at once as a 2×2 grid, so
     «نسيت كلمة المرور» and «الدعم الفني» are never hidden off-screen. */
  .gate-layout .account-sidebar nav { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; gap: 6px; }
  .gate-layout .account-nav a { white-space: normal; justify-content: center; }
  .public-competition-bar { align-items: stretch; }
  .competition-live-status { width: 100%; }
  .public-resource-actions { width: 100%; }
  .public-resource-btn { flex: 1 1 180px; }
  .public-seats-filters { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .public-competition-bar { padding: 12px; }
  .public-resource-actions { display: grid; grid-template-columns: 1fr; }
  .public-seats-head { padding: 16px; }
  .public-seats-table-wrap { padding: 0 14px 16px; }
  .public-seats-filters { padding: 12px 14px 6px; }
  .public-seats-state { margin-inline: 14px; }
  .public-announcement-frame { width: calc(100% - 28px); margin-inline: 14px; }
}

@media print {
  .account-sidebar { display: none !important; }
  .account-layout { display: block; }
}
