/* ==========================================================
   Colours and sizes. Change these to restyle the whole site.
   ========================================================== */
:root {
  --bg: #f5f5f3;            /* very light neutral grey */
  --surface: #ffffff;       /* cards and header */
  --text: #222629;
  --muted: #555b60;
  --primary: #4b5560;       /* soft slate grey */
  --primary-dark: #313840;
  --primary-soft: #ebecee;
  --urgent: #8c4a3c;        /* muted warm red, only for the emergency box */
  --urgent-soft: #f7f0ee;
  --border: #dcdddf;
  --note-bg: #f1f1ef;
  --note-border: #c9cacc;
  --radius: 14px;
  --wrap: 46rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Phones and computers already have good Arabic fonts, so nothing is downloaded. */
  --font-ar: "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
}

/* ---------- Basics ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.65;
}
:lang(ar) { font-family: var(--font-ar); line-height: 1.85; }
h1, h2, h3 { line-height: 1.25; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { line-height: 1.5; }
a { color: var(--primary-dark); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 1rem; }
/* Phone numbers always read left to right, also inside Arabic text. */
a[href^="tel:"] { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
/* Web addresses like 113.nl keep their own reading direction inside Arabic text. */
[dir="rtl"] .prose a:not([href^="tel:"]) { unicode-bidi: plaintext; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 48rem) { .wrap { padding-inline: 24px; } }

.icon { width: 1.4em; height: 1.4em; flex: none; }
/* Arrows point the other way in right-to-left languages. */
[dir="rtl"] .icon-arrow, [dir="rtl"] .icon-back, [dir="rtl"] .icon-exit { transform: scaleX(-1); }

.skip-link {
  position: absolute; top: -100px; inset-inline-start: 16px; z-index: 100;
  background: var(--primary-dark); color: #fff; padding: 0.6rem 1rem; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* ---------- Quick exit (always visible, bottom corner) ---------- */
.quick-exit {
  position: fixed; bottom: 16px; inset-inline-end: 16px; z-index: 50;
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--text); color: #fff; text-decoration: none; font-weight: 600; font-size: 1rem;
  padding: 0.75rem 1.1rem; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.quick-exit:hover { background: #000; }

/* ---------- Demo notice ---------- */
.demo-notice {
  background: var(--note-bg); border-bottom: 1px solid var(--note-border);
  color: var(--muted); font-size: 0.95rem; padding-block: 0.6rem;
}
.demo-notice p { margin: 0; }
.demo-notice p + p { margin-top: 0.3rem; }

/* ---------- Start page ---------- */
.start { background: linear-gradient(180deg, var(--primary-soft), var(--bg) 22rem); padding-block: 2rem 3rem; }
.start-header { text-align: center; }
.start-logo {
  display: grid; place-items: center; width: 4.5rem; height: 4.5rem; margin: 0 auto 0.75rem;
  border-radius: 50%; background: var(--surface); color: var(--primary);
}
.start-logo .icon { width: 2.4rem; height: 2.4rem; }
.start h1 {
  display: flex; flex-direction: column; gap: 0.1rem; margin: 0 0 1.5rem;
  font-size: clamp(1.5rem, 5vw, 2rem); color: var(--primary-dark);
}

.welcome-list { display: grid; gap: 12px; }
.welcome {
  padding: 1.1rem 1.25rem; background: var(--surface);
  border: 1px solid var(--border); border-inline-start: 5px solid var(--primary); border-radius: var(--radius);
}
.welcome p { margin: 0 0 0.6rem; }
.welcome p:last-child { margin-bottom: 0; }
.welcome ul { margin: 0; padding-inline-start: 1.25rem; }
.welcome li { margin-block: 0.2rem; }

.choose-title {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  margin: 2.25rem 0 1rem; font-size: 1.2rem; color: var(--muted); text-align: center;
}
.guide-buttons { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 40rem) { .guide-buttons { grid-template-columns: repeat(3, 1fr); } }
.guide-buttons a {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem; min-height: 44px;
  padding: 1.1rem 1rem; text-align: center; text-decoration: none;
  background: var(--primary); color: #fff; border-radius: var(--radius);
  box-shadow: 0 3px 10px rgba(40, 46, 52, 0.18);
}
.guide-buttons a:hover { background: var(--primary-dark); }
.guide-lang { font-size: 1.45rem; font-weight: 700; }
.guide-open { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 1rem; opacity: 0.92; }

/* ---------- Guide header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; padding-block: 12px;
}
.site-name {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none;
}
.site-name .icon { color: var(--primary); width: 1.6em; height: 1.6em; }
.lang-switcher ul { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.lang-switcher a {
  display: block; min-height: 44px; padding: 0.45rem 0.85rem;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); text-decoration: none; font-size: 1rem; line-height: 1.6;
}
.lang-switcher a:hover { border-color: var(--primary); }
.lang-switcher a[aria-current] { background: var(--primary-soft); border-color: var(--primary); font-weight: 600; }

/* ---------- Guide page ---------- */
.guide { padding-block: 1rem 3rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 1rem; padding-block: 0.5rem; }
.guide-header { margin-block: 0.75rem 1.25rem; }
.guide h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); margin: 0 0 0.5rem; }
.lead { font-size: 1.2rem; color: var(--muted); margin: 0; }

.toc {
  margin-block: 1.25rem; padding: 1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.toc h2 { margin: 0 0 0.25rem; font-size: 1rem; color: var(--muted); }
.toc ul { margin: 0; padding-inline-start: 1.25rem; }
.toc li { margin-block: 0.3rem; }

.prose h2 {
  font-size: 1.4rem; margin: 2.25rem 0 0.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border); color: var(--primary-dark);
}
.prose h3 { font-size: 1.15rem; margin: 1.5rem 0 0.35rem; }
.prose ul { padding-inline-start: 1.25rem; }
.prose ul ul { margin-block: 0.25rem; }
.prose li { margin-block: 0.4rem; }

.urgent {
  display: flex; align-items: flex-start; gap: 0.85rem; margin-block: 1.25rem;
  padding: 1.1rem 1.25rem; background: var(--urgent-soft);
  border: 1px solid #e6d3ce; border-inline-start: 6px solid var(--urgent); border-radius: var(--radius);
}
.urgent-icon { color: var(--urgent); padding-top: 0.2rem; }
.urgent p { margin: 0 0 0.5rem; }
.urgent p:last-child { margin-bottom: 0; }

.note {
  margin-block: 1rem; padding: 0.75rem 1rem; font-size: 1rem;
  background: var(--note-bg); border: 1px dashed var(--note-border); border-radius: 10px;
}
.note p { margin: 0; }

.to-top { margin-top: 2.5rem; }
.to-top a { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: #3a4047; color: #eceeef; font-size: 0.95rem; padding-block: 1.75rem 6rem; }
.site-footer p { margin: 0 0 0.4rem; }
.footer-block + .footer-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.15); }
.footer-small { margin-top: 1.25rem !important; opacity: 0.8; font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
