/* EgyptAuth — reset, base typography and a deliberately small set of layout helpers. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img, svg, video, canvas { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; border-spacing: 0; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: -0.011em; color: var(--text); }
h1 { font-size: var(--fs-xl); letter-spacing: -0.018em; }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
h4 { font-size: var(--fs-base); }
p { color: var(--text-2); }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.95em; }
hr { border: 0; border-top: 1px solid var(--border); }
::selection { background: var(--selection); color: var(--text); }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border: 3px solid var(--bg); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* Text helpers */
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.strong { color: var(--text); font-weight: 500; }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
.ltr { direction: ltr; unicode-bidi: isolate; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; overflow-wrap: anywhere; }
.t-end { text-align: end; }
.t-center { text-align: center; }
.text-red { color: var(--red-text); }
.text-green { color: var(--green-text); }
.text-amber { color: var(--amber-text); }
.text-blue { color: var(--blue-text); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Layout helpers */
.row { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.row-top { display: flex; align-items: flex-start; gap: var(--s2); min-width: 0; }
.row.wrap, .row-top.wrap { flex-wrap: wrap; }
.row.gap-1 { gap: var(--s1); }
.row.gap-3 { gap: var(--s3); }
.row.gap-4 { gap: var(--s4); }
.stack { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.stack.gap-1 { gap: var(--s1); }
.stack.gap-2 { gap: var(--s2); }
.stack.gap-3 { gap: var(--s3); }
.stack.gap-6 { gap: var(--s6); }
.grow { flex: 1 1 auto; min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.ms-auto { margin-inline-start: auto; }
.between { justify-content: space-between; }

.grid { display: grid; gap: var(--s4); }
.grid-2 { display: grid; gap: var(--s4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: var(--s4); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: var(--s4); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { display: grid; gap: var(--s4); grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

@media (max-width: 1100px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
}
@media (max-width: 420px) {
  .grid-4, .grid-5 { grid-template-columns: minmax(0, 1fr); }
}

.mt-1 { margin-top: var(--s1); }
.mt-2 { margin-top: var(--s2); }
.mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); }
.mt-6 { margin-top: var(--s6); }
.mb-2 { margin-bottom: var(--s2); }
.mb-3 { margin-bottom: var(--s3); }
.mb-4 { margin-bottom: var(--s4); }
.mb-6 { margin-bottom: var(--s6); }

/* Directional icons mirror in RTL */
[dir="rtl"] .icon.flip-rtl { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
