/* Accessibility, the account menu and the profile page
   Moved out of styles.css on 2026-11-05 (one big file split by section; the rules are unchanged and in the same order).
   Every page links this file right after css/account.css. */

/* ═════════════════════════════════════════════════════════════
   Accessibility
   ═════════════════════════════════════════════════════════════ */

/* Visible keyboard focus everywhere (inputs keep their own gold border + glow) */
a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible,
.ver-option-card:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* "Skip to content" link: off-screen until it receives keyboard focus */
.skip-link {
  position: absolute;
  top: -60px;
  right: 12px;
  z-index: 1000;
  background: var(--gold);
  color: #000;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  transition: top .15s;
}
.skip-link:focus { top: 0; }

/* Respect the OS "reduce motion" setting (the loading animation and SweetAlert's loader keep moving: they are functional) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .swal2-loader { animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
  .egl > i { animation-duration: 2.6s !important; animation-iteration-count: infinite !important; }
  .btn.is-busy::after { animation-duration: 1.2s !important; animation-iteration-count: infinite !important; }
}

/* Phone numbers and e-mail addresses are typed left-to-right even in the RTL layout */
input[type="tel"], input[type="email"], input[type="url"] {
  direction: ltr;
  text-align: right;
}

/* ═════════════════════════════════════════════════════════════
   ACCOUNT MENU (site header)
   ═════════════════════════════════════════════════════════════ */
.acct { position: relative; }
.acct-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  background: var(--card);
  border: 1px solid var(--b2);
  border-radius: 999px;
  color: var(--t1);
  font-size: 13px;
  font-weight: 700;
  transition: border-color .15s;
}
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: var(--gold); }
.acct-ava {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: var(--b1);
  flex-shrink: 0;
}
.acct-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-caret { font-size: 10px; color: var(--t3); transition: transform .15s; }
.acct-btn[aria-expanded="true"] .acct-caret { transform: rotate(180deg); }

.acct-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 300;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: var(--card);
  border: 1px solid var(--b2);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  padding: 8px;
}
.acct-head { display: flex; align-items: center; gap: 12px; padding: 12px 10px 14px; }
.acct-ava-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  background: var(--b1);
  flex-shrink: 0;
}
.acct-who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acct-who strong { font-size: 14px; font-weight: 800; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-who span { font-size: 12px; color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.acct-facts {
  margin: 0 2px 8px;
  padding: 10px 12px;
  background: var(--s);
  border: 1px solid var(--b1);
  border-radius: 10px;
  display: grid;
  gap: 8px;
}
.acct-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.acct-facts dt { color: var(--t3); }
.acct-facts dd { margin: 0; color: var(--t1); font-weight: 700; }
.acct-panel a,
.acct-panel .acct-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--t2);
  font-size: 13px;
  font-weight: 700;
  background: none;
  border: none;
  text-align: right;
}
.acct-panel a:hover, .acct-panel .acct-logout:hover { background: var(--s); color: var(--t1); }
.acct-panel i { width: 16px; text-align: center; color: var(--t3); }
.acct-panel .acct-logout, .acct-panel .acct-logout i { color: #f87171; }
.acct-panel .acct-logout { margin-top: 6px; position: relative; }
.acct-panel .acct-logout::before { content: ''; position: absolute; top: -4px; left: 8px; right: 8px; height: 1px; background: var(--b1); }
.acct-panel .acct-logout:hover { background: rgba(239, 68, 68, 0.1); color: #fca5a5; }

/* ─── the sign-out screen (js/login-form.js byeScreenShow): picture + name + the logo animation, then "اتسجّل خروجك" ─── */
.bye-screen { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(8, 8, 10, 0.74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: byeIn .22s ease-out both; }
.bye-card { width: min(300px, 100%); text-align: center; padding: 26px 22px 20px; border-radius: 18px; background: var(--card);
  border: 1px solid rgba(212, 160, 23, 0.35); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); animation: byeCard .3s cubic-bezier(.2, .8, .2, 1) both; }
.bye-ava-wrap { position: relative; width: 72px; height: 72px; margin: 0 auto 14px; }
.bye-ava { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); display: block; background: var(--s); }
.bye-badge { position: absolute; bottom: -2px; left: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #1d1d22; border: 1px solid var(--b2); color: #f87171; font-size: 11px; transition: color .2s; }
.bye-screen[data-state="done"] .bye-badge { color: var(--green); }
.bye-title { margin: 0; font-size: 17px; font-weight: 900; color: var(--t1); }
.bye-name { margin: 4px 0 0; font-size: 13px; color: var(--t2); }
.bye-status { min-height: 46px; margin-top: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.bye-check { font-size: 30px; color: var(--green); animation: byePop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.bye-see { font-size: 13px; color: var(--t2); font-weight: 700; }
@keyframes byeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes byeCard { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes byePop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
@media (max-width: 540px) {
  .acct-name, .acct-caret { display: none; }
  .acct-btn { padding: 3px; }
}

/* ═════════════════════════════════════════════════════════════
   PROFILE PAGE
   ═════════════════════════════════════════════════════════════ */
.pf-card {
  background: var(--s);
  border: 1px solid var(--b1);
  border-radius: 16px;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.pf-id { display: flex; align-items: center; gap: 18px; min-width: 0; }
.pf-ava {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  background: var(--b1);
  flex-shrink: 0;
}
.pf-name { font-size: 21px; font-weight: 900; color: var(--t1); line-height: 1.3; }
.pf-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 160, 23, 0.35);
  background: rgba(212, 160, 23, 0.08);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}
.pf-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; }
.pf-fact { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--t2); }
.pf-fact i { color: var(--t3); }
.pf-fact bdi { color: var(--t1); font-weight: 700; }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pf-section-hdr { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.pf-section-hdr h2 { font-size: 19px; font-weight: 900; color: var(--t1); }
.pf-section-hdr p { font-size: 13px; color: var(--t2); margin-top: 3px; }

.pf-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--b2);
  background: transparent;
  color: var(--t2);
  font-size: 12.5px;
  font-weight: 700;
}
.pf-chip b { font-weight: 800; color: var(--t1); }
.pf-chip:hover { border-color: var(--t3); color: var(--t1); }
.pf-chip[aria-pressed="true"] { background: var(--card); border-color: var(--gold); color: var(--gold); }
.pf-chip[aria-pressed="true"] b { color: var(--gold); }

.pf-list { display: flex; flex-direction: column; gap: 14px; }

/* One request */
.rq {
  --rq-c: var(--gold);
  background: var(--card);
  border: 1px solid var(--b1);
  border-inline-start: 4px solid var(--rq-c);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rq-approved { --rq-c: var(--green); }
.rq-rejected { --rq-c: var(--red); }
.rq-more { --rq-c: var(--blue); }
.rq-top { display: flex; align-items: center; gap: 14px; }
.rq-ico {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--s);
  border: 1px solid var(--b1);
  color: var(--rq-c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.rq-title { min-width: 0; flex: 1; }
.rq-title h3 { font-size: 16px; font-weight: 800; color: var(--t1); overflow-wrap: anywhere; }
.rq-title span { font-size: 12px; color: var(--t3); }
.rq-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--rq-c);
  color: var(--rq-c);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}
.rq-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12.5px; color: var(--t3); }
.rq-meta b { color: var(--t2); font-weight: 700; }

/* 3-step progress: received -> under review -> decision */
.rq-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.rq-steps li {
  position: relative;
  padding-top: 20px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--t3);
}
.rq-steps li::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  translate: -50% 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--b2);
  z-index: 1;
}
.rq-steps li::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--b2);
}
.rq-steps li:first-child::after { display: none; }
.rq-steps li.done { color: var(--t2); }
.rq-steps li.done::before, .rq-steps li.done::after { background: var(--rq-c); }
.rq-steps li.now { color: var(--rq-c); }
.rq-steps li.now::before { background: var(--rq-c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--rq-c) 22%, transparent); }
.rq-steps li.now::after { background: var(--rq-c); }

/* Decision note: rejection reason / requested information / approval */
.rq-note {
  border: 1px solid color-mix(in srgb, var(--rq-c) 40%, transparent);
  background: color-mix(in srgb, var(--rq-c) 8%, var(--card));
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--t1);
}
.rq-note strong { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--rq-c); font-size: 13px; font-weight: 800; }
.rq-note p { white-space: pre-line; overflow-wrap: anywhere; }
.rq-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pf-empty {
  text-align: center;
  padding: 44px 20px;
  background: var(--card);
  border: 1px dashed var(--b2);
  border-radius: 14px;
  color: var(--t2);
}
.pf-empty i { font-size: 30px; color: var(--gold); margin-bottom: 12px; display: block; }
.pf-empty h3 { font-size: 16px; color: var(--t1); margin-bottom: 6px; }
.pf-empty p { font-size: 13px; margin-bottom: 16px; }

@media (max-width: 640px) {
  .pf-ava { width: 68px; height: 68px; }
}
