/*
 * MapLeads design system — same tokens and components as XNEXT
 * (application/views/site/default/index.php in the xerovidd repo):
 * ink/navy surfaces, violet→blue gradient, 18px radius, system font.
 * Shared by the landing page, the auth pages and the dashboard.
 * Direction-agnostic: logical properties only, so dir="rtl" (Arabic) works.
 */
:root {
  --ink: #0B1220;
  --navy: #0F172A;
  --navy-2: #1E293B;
  --vio: #7C3AED;
  --vio-soft: #EDE9FE;
  --blu: #2563EB;
  --grad: linear-gradient(135deg, #7C3AED, #2563EB);

  --bg: #F4F5FB;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --line: #E5E7EB;
  --line-strong: #CBD5E1;
  --text: #0B1220;
  --text-2: #475569;
  --text-3: #64748B;

  --ok: #059669;
  --ok-soft: #D1FAE5;
  --warn: #B45309;
  --warn-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --info-soft: #DBEAFE;

  --radius: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-cta: 0 10px 30px rgba(124, 58, 237, .35);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}
[dir="rtl"] body { font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, var(--font); }
a { color: var(--vio); }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(124, 58, 237, .45); outline-offset: 2px; }

/* ---------------------------------------------------------------- brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { width: 34px; height: 34px; }
.brand-name { font-weight: 800; letter-spacing: .04em; font-size: 1.15rem; }
.brand-name b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* -------------------------------------------------------------- buttons */
.btn-x {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: var(--radius-md); border: 1px solid transparent;
  font: 600 .95rem/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-x:disabled { opacity: .55; cursor: not-allowed; }
.btn-x-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-cta); }
.btn-x-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-x-outline { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-x-outline:hover { border-color: var(--vio); color: var(--vio); }
.btn-x-ghost-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-x-ghost-dark:hover { border-color: #fff; }
.btn-x-block { width: 100%; }
.btn-x-sm { min-height: 36px; padding: 0 14px; font-size: .88rem; }

/* ------------------------------------------------------- pills & badges */
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--vio-soft); color: var(--vio);
  font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.pill-dark { background: rgba(124, 58, 237, .18); color: #C4B5FD; border: 1px solid rgba(167, 139, 250, .35); }
[dir="rtl"] .pill { letter-spacing: 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-info { background: var(--info-soft); color: var(--blu); }
.tag-muted { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- cards */
.card-x { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ------------------------------------------------------- language switch */
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.lang-switch button {
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  min-width: 36px; min-height: 28px; padding: 0 10px; border-radius: 999px; font: 700 .78rem/1 var(--font);
}
.lang-switch button[aria-pressed="true"] { background: var(--grad); color: #fff; }
.lang-switch-dark { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); }
.lang-switch-dark button { color: #CBD5E1; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; margin-block-end: 16px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.input-x {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 400 1rem var(--font);
}
.input-x:focus { border-color: var(--vio); outline: 3px solid rgba(124, 58, 237, .18); }
.alert-x { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .92rem; margin-block-end: 16px; }
.alert-x-error { background: var(--danger-soft); color: #991B1B; }
.alert-x-ok { background: var(--ok-soft); color: #065F46; }
.alert-x-info { background: var(--info-soft); color: #1E3A8A; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
