/* ============================================================
   QueckBiz Design System v2 — layered refinement
   Loads AFTER inline page styles and overrides tokens/components.
   EN: Sora (display) + Inter (body) · AR: IBM Plex Sans Arabic
   ============================================================ */

:root {
  --bg: #f5f7fc;
  --surface: #ffffff;
  --text: #0d1526;
  --text2: #4b5875;
  --text-secondary: #4b5875;
  --primary: #2b50e2;
  --primary2: #1f3fc4;
  --primary-hover: #1f3fc4;
  --accent: #0e9f6e;
  --border: #e2e8f4;
  --ring: rgba(43, 80, 226, 0.18);
  --shadow: 0 1px 2px rgba(13, 21, 38, 0.05), 0 2px 8px rgba(13, 21, 38, 0.05);
  --shadow-lg: 0 4px 12px rgba(13, 21, 38, 0.07), 0 12px 32px rgba(13, 21, 38, 0.09);
  --radius: 10px;
  --radius-lg: 14px;
  --footer-bg: #0d1526;
  --footer-border: #1d2a44;
  --footer-text: #9aa8c7;
  --footer-heading: #f2f5fb;
  --footer-muted: #67759a;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Sora', 'Inter', -apple-system, sans-serif;
}
[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #121b2f;
  --text: #edf1fa;
  --text2: #9db;
  --text2: #94a3c4;
  --text-secondary: #94a3c4;
  --primary: #6690ff;
  --primary2: #85a7ff;
  --primary-hover: #85a7ff;
  --accent: #2fbf8f;
  --border: #24314e;
  --ring: rgba(102, 144, 255, 0.25);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
  --footer-bg: #080d18;
  --footer-border: #1a2440;
  --footer-text: #94a3c4;
  --footer-heading: #edf1fa;
  --footer-muted: #5d6c92;
}

/* Arabic pages: one type family across all roles */
html[lang="ar"] {
  --font-body: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
  --font-display: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
}

body {
  font-family: var(--font-body);
  letter-spacing: 0.005em;
}
h1, h2, h3, h4, .logo, .footer-logo {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
html[lang="ar"] body,
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 {
  letter-spacing: 0;
}

/* Signature: the "ledger rule" — the double line under an invoice total */
main > h1 {
  position: relative;
  padding-bottom: 0.85rem;
  margin-bottom: 1.75rem;
}
main > h1::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 72px;
  height: 4px;
  border-top: 3px solid var(--primary);
  border-bottom: 1px solid var(--accent);
}
.hero h1 { padding-bottom: 1rem; position: relative; }
.hero h1::after {
  content: '';
  position: absolute;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 88px;
  height: 4px;
  border-top: 3px solid var(--primary);
  border-bottom: 1px solid var(--accent);
}
html[dir="rtl"] .hero h1::after { transform: translateX(50%); }

/* Header */
header {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.logo { letter-spacing: -0.03em; }

/* Buttons */
.btn, button.btn {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(13, 21, 38, 0.12);
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(13, 21, 38, 0.16); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(13, 21, 38, 0.12); }
.btn-secondary { box-shadow: none; }
.btn:focus-visible, a:focus-visible, .theme-btn:focus-visible, .theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Forms */
label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text2);
  margin-bottom: 0.3rem;
}
input, textarea, select {
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--ring);
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--text2) 55%, transparent); }
input[type="number"] { font-variant-numeric: tabular-nums; }

/* Cards */
.card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}
.tool-card, .tool-grid a, .blog-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tool-card:hover, .tool-grid a:hover, .blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

/* Document preview: money columns aligned like a real ledger */
.doc-preview { font-variant-numeric: tabular-nums; border-radius: 10px; }
.preview-area { border-radius: var(--radius-lg); }

/* Content typography (blog + tool descriptions) */
article p, .content p, main p { line-height: 1.75; }
article h2, .content h2 { margin-top: 2.25rem; }

/* RTL refinements */
html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .row input { text-align: right; }
html[dir="rtl"] input[type="number"],
html[dir="rtl"] .doc-preview td:last-child { direction: ltr; text-align: left; }
html[dir="rtl"] .lang-select {
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  background-position: left 0.5rem center;
}

/* Language switch pill in header */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-display);
  transition: border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.lang-switch:hover { border-color: var(--primary); color: var(--primary); }

/* Footer — deep navy in both themes for a grounded, professional close */
.site-footer { background: var(--footer-bg); }
.footer-col a:hover { color: #8fb0ff; }

/* Quality floor */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:hover, .tool-card:hover, .tool-grid a:hover { transform: none; }
}
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }
