/* Clarity Insurance: shared site styles. A fictional insurer, for demonstration.
   Editorial and restrained: a white page, type does the work, 1px hairlines instead of shadows, one accent
   (Clarity blue) for the primary action, links and the current state. Status is a dot and a word. Geist for
   Latin, IBM Plex Sans Arabic for Arabic. Desktop keeps the working column on the left, so the right edge stays
   clear for the Clarity widget. */

:root {
  color-scheme: light;
  --ink: #0B0B0C;
  --ink-2: #2C2C30;
  --muted: #5E5E66;
  --faint: #8E8E93;
  --line: #E7E7EA;
  --line-2: #F0F0F2;
  --tint: #F6F6F7;
  --page: #FFFFFF;
  --accent: #344FB2;
  --accent-hi: #2A409A;
  --accent-tint: #344FB20F;
  --accent-ring: #344FB240;
  --ok: #1F9D55;
  --wait: #B7791F;
  --bad: #C0392B;

  --font: "Geist", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Geist", "Geeza Pro", "Noto Sans Arabic", Tahoma, sans-serif;
  --r: 10px;
  --r-lg: 12px;
  --soft: 0 1px 1px #0B0B0C08, 0 18px 40px -22px #0B0B0C38;
  --gutter: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "ss01"; }
[lang="ar"], html[dir="rtl"] body { font-family: var(--font-ar); }
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
::selection { background: #344FB226; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
.tnum, .rows b, .money { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* bilingual pairs: the h1 carries both, one shows */
.bi { display: inline; }
.bi > .ar { display: none; }
html[dir="rtl"] .bi > .ar { display: inline; }
html[dir="rtl"] .bi > .en { display: none; }

/* the riyal symbol, drawn inline (never the letters) */
.rs { display: inline-block; height: .72em; width: .56em; vertical-align: -0.02em; margin-inline-end: .18em; }
.rs path { fill: currentColor; }
bdi.money { white-space: nowrap; font: inherit; color: inherit; }

/* ---------- header ---------- */
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.topnav { position: sticky; top: 0; z-index: 50; background: #FFFFFFF2; backdrop-filter: saturate(1.2) blur(12px); -webkit-backdrop-filter: saturate(1.2) blur(12px); border-bottom: 1px solid var(--line); }
.topnav .in { display: flex; align-items: center; gap: 44px; height: 64px; }
.ci-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; white-space: nowrap; }
.ci-logo svg { width: 22px; height: 22px; flex: none; display: block; }
.ci-word { display: inline-flex; align-items: baseline; gap: 10px; }
.ci-word b { font-weight: 600; font-size: 17px; letter-spacing: -0.03em; color: var(--ink); }
.ci-word b .tk { font-weight: 400; color: var(--muted); }
.ci-word small { font-family: var(--font-ar); font-size: 12px; color: var(--faint); font-weight: 400; }
.mainlinks { display: flex; gap: 28px; align-items: stretch; height: 100%; }
.mainlinks a { display: flex; align-items: center; color: var(--muted); font-size: 15px; position: relative; text-decoration: none; }
.mainlinks a:hover { color: var(--ink); text-decoration: none; }
.mainlinks a.on { color: var(--ink); }
.mainlinks a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--ink); }
.navright { margin-inline-start: auto; display: flex; align-items: center; gap: 22px; }
.langbtn { border: 0; background: none; padding: 0; font-family: var(--font-ar); font-size: 15px; color: var(--muted); cursor: pointer; }
html[dir="rtl"] .langbtn { font-family: var(--font); }
.langbtn:hover { color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--ink); background: var(--tint); border: 1px solid var(--line); }

/* ---------- page head ---------- */
.page { padding-top: 40px; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--faint); font-size: 13.5px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs .sl { color: #C8C8CC; }
.phead { padding: 18px 0 40px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.phead h1 { font-size: 56px; line-height: 60px; letter-spacing: -0.03em; }
.phead .meta { color: var(--muted); font-size: 16px; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.phead .meta .sep { color: #C8C8CC; }
.kicker { font-size: 14px; color: var(--muted); margin-bottom: 14px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 72px; align-items: start; }
@media (max-width: 1080px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.main { min-width: 0; }
.sec { padding: 36px 0; border-top: 1px solid var(--line); }
.main > .sec:first-child, .side > .sec:first-child { border-top: 0; }
.sec > h2, .sh { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.sh .aside, .sec > h2 .aside { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.sec .lead { color: var(--muted); font-size: 16px; max-width: 58ch; }
.sec.tint { background: var(--tint); border-top: 0; border-radius: var(--r-lg); padding: 32px; margin: 8px 0; }
.side .sec { padding: 28px 0; }
.side .sec > h2 { font-size: 16px; margin-bottom: 10px; }
.note { color: var(--muted); font-size: 14.5px; }

/* definition rows: label left grey, value right ink */
.rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 13px 0; border-top: 1px solid var(--line-2); font-size: 15px; }
.rows > div:first-child { border-top: 0; }
.rows.ruled > div:first-child { border-top: 1px solid var(--line-2); }
.rows span { color: var(--muted); }
.rows b { font-weight: 500; text-align: end; color: var(--ink); }

/* status: a dot and a word */
.chip, .status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.chip::before, .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #C8C8CC; flex: none; }
.chip.ok::before, .status.ok::before { background: var(--ok); }
.chip.ok, .status.ok { color: var(--ink); }
.chip.warn::before, .status.warn::before { background: var(--wait); }
.chip.brand::before, .chip.teal::before, .status.now::before { background: var(--accent); }
.chip.brand, .status.now { color: var(--ink); }
.chip.bad::before { background: var(--bad); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: var(--r); border: 1px solid transparent; font-weight: 500; font-size: 15.5px; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn.primary, .btn.blue { background: var(--accent); color: #fff; }
.btn.primary:hover, .btn.blue:hover { background: var(--accent-hi); }
.btn.primary[disabled], .btn.blue[disabled] { background: var(--line-2); color: var(--faint); cursor: not-allowed; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: #CFCFD4; }
.btn.text { background: none; border: 0; padding: 0; height: auto; color: var(--accent); font-weight: 500; }
.btn.text:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn.block { width: 100%; }
.btn.sm { height: 38px; font-size: 14px; padding: 0 14px; }
.actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 24px; }
.tick { display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--ok); flex: none; }
.tick svg { width: 12px; height: 12px; }
.cross { display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--bad); flex: none; }
.cross svg { width: 10px; height: 10px; }
.arrow::after { content: "→"; margin-inline-start: 6px; }
html[dir="rtl"] .arrow::after { content: "←"; }

/* Talk to Sara: a quiet inline row near the action */
.talk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; color: var(--faint); }
.talk .wv { display: inline-flex; align-items: center; gap: 2px; height: 16px; color: var(--accent); }
.talk .wv i { display: block; width: 2px; border-radius: 2px; background: currentColor; }
.talk .wv i:nth-child(1) { height: 6px; } .talk .wv i:nth-child(2) { height: 12px; } .talk .wv i:nth-child(3) { height: 16px; } .talk .wv i:nth-child(4) { height: 10px; } .talk .wv i:nth-child(5) { height: 5px; }
.talk button { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; font-size: 15px; cursor: pointer; }
.talk button:hover { text-decoration: underline; text-underline-offset: 3px; }

/* fields */
.field { display: flex; flex-direction: column; gap: 8px; position: relative; min-width: 0; }
.field > label { font-size: 14px; color: var(--muted); }
.control { position: relative; display: flex; align-items: center; height: 56px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; transition: border-color .2s, box-shadow .2s; }
.control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.control input, .control select { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 16px; font: inherit; font-size: 17px; color: var(--ink); }
.control .state { margin-inline-end: 14px; display: none; }
.field.is-filled .control .state { display: inline-grid; }
.field .hint { font-size: 13px; color: var(--faint); display: flex; gap: 6px; align-items: center; min-height: 18px; }
.field .hint .by { color: var(--accent); font-weight: 500; }
.field.is-sara .control { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }

/* ---------- Sara on the page ---------- */
.sara-target { position: relative; }
[data-section], .sec, .field { scroll-margin-top: 96px; scroll-margin-bottom: 40px; }
.sara-focus { outline: 2px solid var(--accent) !important; outline-offset: 10px; border-radius: 6px; background-color: var(--accent-tint); transition: background-color .3s; }
.sara-tip { position: absolute; z-index: 30; top: -18px; inset-inline-end: 0; transform: translateY(-100%); width: max-content; max-width: min(340px, 82vw); background: var(--ink); color: #fff; border-radius: var(--r); padding: 11px 14px 12px; font-size: 14.5px; line-height: 1.45; box-shadow: 0 12px 30px -14px #0B0B0C80; animation: tipIn .3s cubic-bezier(.2,.9,.3,1.05); }
.sara-tip::after { content: ""; position: absolute; bottom: -5px; inset-inline-end: 24px; width: 10px; height: 10px; background: var(--ink); transform: rotate(45deg); border-radius: 1px; }
.sara-tip .h { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #B9BCC8; margin-bottom: 3px; }
.sara-tip .b.swap { animation: fadeSwap .3s; }
.orb { width: 6px; height: 6px; border-radius: 50%; background: #8FA2F0; flex: none; }
.orb.live { animation: orbPulse 1.6s ease-in-out infinite; }
@keyframes orbPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes tipIn { from { opacity: 0; transform: translateY(calc(-100% + 6px)); } to { opacity: 1; transform: translateY(-100%); } }
@keyframes fadeSwap { from { opacity: .25; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.consent { position: fixed; z-index: 70; left: calc(20px + env(safe-area-inset-left, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 5px 0 16px; border-radius: var(--r); background: var(--ink); color: #fff; font-size: 14px; animation: rise .3s; }
html[dir="rtl"] .consent { left: auto; right: calc(20px + env(safe-area-inset-right, 0px)); padding: 0 16px 0 5px; }
.consent .rec { width: 7px; height: 7px; border-radius: 50%; background: #8FA2F0; animation: orbPulse 1.6s infinite; }
.consent .sep { color: #6E6E73; }
.consent button { height: 32px; padding: 0 12px; border-radius: 7px; border: 0; background: #FFFFFF1A; color: #fff; font-weight: 500; cursor: pointer; }
.ask { position: fixed; z-index: 71; left: calc(20px + env(safe-area-inset-left, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); width: min(360px, calc(100vw - 40px)); background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--soft); padding: 18px; animation: rise .3s; }
html[dir="rtl"] .ask { left: auto; right: calc(20px + env(safe-area-inset-right, 0px)); }
.ask .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ask .who .orb { background: var(--accent); }
.ask .q { margin-top: 8px; font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.ask .fine { margin-top: 6px; font-size: 14px; color: var(--muted); }
.ask .row { display: flex; gap: 8px; margin-top: 16px; }
.ask .row .btn { flex: 1; height: 44px; }
.ask .btn.pressed { transform: scale(.98); }
.toast { position: fixed; z-index: 80; left: 50%; top: calc(80px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); font-size: 14px; animation: rise .25s; }
.by-sara { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--accent); margin-bottom: 18px; }
.by-sara .orb { background: var(--accent); }
.fresh { animation: rise .45s cubic-bezier(.2,.8,.3,1); }

/* ---------- Clarity widget slot ---------- */
#clarity-widget-slot { position: fixed; z-index: 65; right: calc(24px + env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); width: 400px; max-width: calc(100vw - 48px); height: min(640px, calc(100vh - 140px)); pointer-events: none; }
#clarity-widget-slot > * { pointer-events: auto; }
#clarity-widget-slot.show-slot { border: 1px dashed #CFCFD4; border-radius: var(--r-lg); display: grid; place-items: center; color: var(--faint); font-size: 13px; }
html[dir="rtl"] #clarity-widget-slot { right: auto; left: calc(24px + env(safe-area-inset-left, 0px)); }
.mockcall { position: absolute; inset: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--soft); display: flex; flex-direction: column; overflow: hidden; }
.mockcall .hd { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.mockcall .hd b { font-size: 14.5px; font-weight: 600; }
.mockcall .hd .live { margin-inline-start: auto; font-size: 12.5px; color: var(--ok); }
.mockcall .tx { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; }
.mockcall .ln { font-size: 14px; line-height: 1.45; }
.mockcall .ln b { color: var(--faint); font-size: 11.5px; display: block; font-weight: 500; }
.mockcall .ln.reem { color: var(--accent); }
.mockcall .ft { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
.mockcall .wave { display: flex; gap: 3px; align-items: center; height: 22px; flex: 1; }
.mockcall .wave i { width: 3px; border-radius: 2px; background: var(--accent); height: 30%; animation: wave 1s ease-in-out infinite; }
.mockcall .tm { font-size: 12.5px; color: var(--faint); }
.mockcall .end { height: 34px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--bad); color: #fff; font-weight: 500; font-size: 13px; }
@keyframes wave { 0%,100% { height: 25%; } 50% { height: 95%; } }

/* ---------- footer ---------- */
.sitefoot { margin-top: 96px; border-top: 1px solid var(--line); }
.sitefoot .in { padding-block: 26px 34px; display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--faint); }
.sitefoot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.sitefoot nav a { color: var(--muted); }
.sitefoot .ci-logo svg { width: 18px; height: 18px; }
.sitefoot .ci-word b { font-size: 14.5px; }
.sitefoot .ci-word small { display: none; }

/* ---------- phone ---------- */
@media (max-width: 820px) {
  :root { --gutter: 20px; }
  .topnav .in { height: 56px; gap: 16px; }
  .mainlinks { display: none; }
  .ci-word small { display: none; }
  .navright { gap: 18px; }
  .page { padding-top: 22px; }
  .phead { padding: 12px 0 26px; }
  .phead h1 { font-size: 34px; line-height: 40px; }
  .phead .meta { font-size: 15px; margin-top: 10px; gap: 4px 12px; }
  .phead .meta .sep { display: none; }
  .sec { padding: 28px 0; }
  .sec > h2, .sh { font-size: 20px; margin-bottom: 14px; }
  .sec.tint { padding: 24px 20px; margin-inline: -20px; border-radius: 0; }
  .grid2 { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .rows > div { font-size: 15px; }
  .sitefoot { margin-top: 56px; }
  .sitefoot .in { flex-direction: column; align-items: flex-start; }
  .consent { left: 12px; bottom: 12px; }
  .ask { left: 12px; right: 12px; width: auto; bottom: 64px; }
  #clarity-widget-slot { width: calc(100vw - 32px); right: 16px; height: min(560px, calc(100vh - 120px)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
