/* خط Tajawal مضمَّن مع المشروع (يعمل بدون إنترنت) */
@font-face { font-family: "Tajawal"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/Tajawal-Regular.ttf") format("truetype"); }
@font-face { font-family: "Tajawal"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/Tajawal-Medium.ttf") format("truetype"); }
@font-face { font-family: "Tajawal"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/Tajawal-Bold.ttf") format("truetype"); }
@font-face { font-family: "Tajawal"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/Tajawal-ExtraBold.ttf") format("truetype"); }

:root {
  --ink: #2c2a6e;        /* نيلي الشعار */
  --ink-soft: #46439a;
  --accent: #7b3fa0;     /* بنفسجي الشعار */
  --bg: #faf9fd;
  --card: #ffffff;
  --line: #e6e4f0;
  --muted: #6b6a85;
  --danger: #b3261e;
  --ok: #1b7a43;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(44, 42, 110, .06), 0 6px 20px rgba(44, 42, 110, .06);
  --font: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: #1d1c3a;
  font-family: var(--font);
  font-size: 17px;   /* Tajawal أصغر بصرياً من Cairo فنكبّره قليلاً */
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* رؤوس الصفحات */
.brand { text-align: center; padding: 22px 16px 6px; }
.brand img { height: 84px; width: auto; margin: 0 auto; }

/* أزرار */
.btn {
  appearance: none;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  min-height: 44px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .05s, opacity .15s;
}
.btn:hover { background: var(--ink-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: #efeef9; }
.btn.danger { background: transparent; border-color: #e5b9b6; color: var(--danger); }
.btn.danger:hover { background: #fdeceb; }
.btn.small { min-height: 36px; padding: 4px 14px; font-size: 14px; border-radius: 10px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(123, 63, 160, .45);
  outline-offset: 2px;
}

/* حقول */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label { font-weight: 700; font-size: 14px; color: var(--ink); }
.input {
  width: 100%;
  min-height: 46px;
  padding: 9px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(123, 63, 160, .15); }
.ltr { direction: ltr; text-align: right; unicode-bidi: plaintext; }
.error-text { color: var(--danger); font-size: 14px; min-height: 22px; margin: 0; }

.muted { color: var(--muted); }
.toast {
  position: fixed; inset-inline: 0; bottom: 22px; margin: 0 auto; width: fit-content; max-width: 90vw;
  background: #1d1c3a; color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 15px;
  box-shadow: var(--shadow); z-index: 100; opacity: 0; transform: translateY(10px);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--danger); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
