/* 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%; }

/* Native cursor assets keep precise tracking and browser fallbacks without a JS follower. */
@media (hover: hover) and (pointer: fine) {
  :root {
    --cursor-default: url('/assets/cursor-default.svg?v=2') 3 2, auto;
    --cursor-action: url('/assets/cursor-action.svg?v=2') 3 2, pointer;
  }
}
@media (forced-colors: active) {
  :root { --cursor-default: auto; --cursor-action: pointer; }
}

body {
  background: var(--surface-canvas);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  font-synthesis-weight: none;
  overflow-x: hidden;
  cursor: var(--cursor-default, auto);
}
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: var(--cursor-action, pointer); text-align: inherit; }
a { color: inherit; text-decoration: none; }
:where(a[href], [role="button"]) { cursor: var(--cursor-action, pointer); }
/* Text entry and semantic states retain their native cursors. Later component rules still own grab/resize. */
:where(input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="image"]):not([type="hidden"]), textarea, [contenteditable]:not([contenteditable="false"])) { cursor: text; }
:disabled, [aria-disabled="true"], .is-disabled { cursor: not-allowed; }
[aria-busy="true"], .is-busy { cursor: progress; }
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.01em; color: var(--ink-1); text-wrap: balance; }
h1 { font-size: var(--fs-title); letter-spacing: -0.018em; line-height: 1.2; }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
h4 { font-size: var(--fs-base); }
p { color: var(--ink-2); text-wrap: pretty; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--line-1); }
::selection { background: var(--selection); color: var(--ink-1); }
[hidden] { display: none !important; }

/* One focus language everywhere: an accent ring offset from the element. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
@media (forced-colors: active) { :focus-visible { outline-color: Highlight; } }

/* Theme switches repaint at once; transitions would cross-fade every surface. core/theme.js sets this for a frame. */
:root.is-theming *, :root.is-theming *::before, :root.is-theming *::after { transition: none !important; }

/* 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 transparent; background-clip: padding-box; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); background-clip: padding-box; }

/* Shared structural label. The legacy class name remains for existing templates. */
.label-caps { font-family: var(--label-font); font-size: var(--label-size); font-weight: var(--label-weight); letter-spacing: var(--label-tracking); text-transform: var(--label-transform); }

/* Text helpers */
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
.strong { color: var(--ink-1); font-weight: 500; }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; }
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.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(--danger-text); }
.text-green { color: var(--ok-text); }
.text-amber { color: var(--warn-text); }
.text-blue { color: var(--accent-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); }

/* Keep feedback visible while removing nonessential movement at the OS preference. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}
