@import url("https://fonts.googleapis.com/css2?family=Alexandria:wght@500;700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;600&display=swap");

:root {
  --green: #08b67c;
  --green-deep: #05875c;
  --green-soft: #e2f6ec;
  --ink: #0a2620;
  --ink-2: #123a31;
  --paper: #f5f9f6;
  --card: #ffffff;
  --text: #17302a;
  --muted: #5b7068;
  --line: #d9e6df;
  --danger: #b3261e;
  --radius: 16px;
  --display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "IBM Plex Sans Arabic", system-ui, "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.35; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border: 2px solid transparent; border-radius: 999px;
  font: 700 16px var(--display); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #ffd166; outline-offset: 3px; }
.btn-primary { background: var(--green); color: #04261b; }
.btn-primary:hover { background: #12c98b; }
.btn-ghost { border-color: rgba(255, 255, 255, .35); color: #fff; background: transparent; }
.btn-ghost:hover { border-color: #fff; }
.btn-outline { border-color: var(--line); color: var(--text); background: var(--card); }
.btn-outline:hover { border-color: var(--green); }
.btn-sm { min-height: 44px; padding: 0 20px; font-size: 14px; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Header ---------- */
.site-header { background: var(--ink); color: #fff; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-inline-end: auto; }
.brand img { width: 46px; height: 46px; border-radius: 13px; }
.brand b { font: 800 20px var(--display); display: block; line-height: 1.2; }
.brand small { font-size: 12.5px; color: #a8c4ba; display: block; line-height: 1.3; }
.nav { display: flex; gap: 26px; font-size: 15px; }
.nav a { text-decoration: none; color: #cfe1da; }
.nav a:hover { color: #fff; }

/* ---------- Hero ---------- */
.hero { background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; padding-block: 72px 250px; }
.eyebrow {
  display: inline-block; font: 700 14px var(--display); color: var(--green);
  border: 1px solid rgba(8, 182, 124, .45); border-radius: 999px; padding: 6px 16px; margin-bottom: 22px;
}
.hero h1 { font-size: clamp(34px, 6vw, 64px); font-weight: 800; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--green); }
.hero .lead { margin-top: 20px; max-width: 54ch; color: #c5d8d0; font-size: 18.5px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-note { margin-top: 16px; font-size: 14.5px; color: #8fb0a4; }
.hero-art { position: absolute; inset: auto 0 0 0; width: 100%; height: 300px; z-index: 0; }

/* ---------- Sections ---------- */
section { padding-block: 84px; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; color: var(--ink); }
.section-head p { margin-top: 12px; color: var(--muted); }

/* Method (نحلّل، نخطّط، ننمّي) */
.method { background: var(--card); border-block: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.step { padding: 8px 32px 8px 24px; border-inline-start: 1px solid var(--line); }
.step:first-child { border-inline-start: 0; padding-inline-start: 0; }
.step .num { font: 800 15px var(--display); color: var(--green-deep); letter-spacing: .04em; }
.step h3 { font-size: 34px; font-weight: 800; color: var(--ink); margin: 6px 0 10px; }
.step p { color: var(--muted); }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.service {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; border-top: 4px solid var(--green);
}
.service h3 { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.service p { font-size: 15.5px; color: var(--muted); line-height: 1.75; }

/* Analysis explainer */
.explain { background: var(--green-soft); }
.explain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.explain h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; color: var(--ink); }
.explain .text p { margin-top: 14px; color: #33524a; }
.explain .cta-row { margin-top: 28px; }
.stage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: stage; }
.stage-list li {
  counter-increment: stage; background: var(--card); border-radius: var(--radius); padding: 18px 20px;
  display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start;
}
.stage-list li::before {
  content: counter(stage); width: 42px; height: 42px; border-radius: 50%;
  background: var(--ink); color: #fff; font: 800 17px var(--display);
  display: grid; place-items: center;
}
.stage-list b { font: 700 17px var(--display); color: var(--ink); display: block; }
.stage-list span { font-size: 15px; color: var(--muted); }

/* Final CTA */
.final { background: var(--ink); color: #fff; text-align: center; }
.final h2 { font-size: clamp(28px, 4.4vw, 46px); font-weight: 800; }
.final p { color: #c5d8d0; margin: 14px auto 0; max-width: 52ch; }
.final .cta-row { justify-content: center; }

/* Footer */
.site-footer { background: #071b17; color: #a8c4ba; font-size: 14.5px; padding-block: 36px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 48px; justify-content: space-between; align-items: flex-start; }
.site-footer b { color: #fff; font-family: var(--display); font-weight: 700; }
.site-footer dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 2px 16px; }
.site-footer dt { color: #7f9d92; }
.site-footer dd { margin: 0; color: #dbe9e3; direction: ltr; text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- Analysis page ---------- */
.quiz-page { min-height: 100vh; display: flex; flex-direction: column; }
.quiz-main { flex: 1; padding-block: 40px 72px; }
.quiz-shell { width: min(760px, 100% - 32px); margin-inline: auto; }
.quiz-intro h1 { font-size: clamp(26px, 4.4vw, 38px); font-weight: 800; color: var(--ink); }
.quiz-intro p { margin-top: 10px; color: var(--muted); }

.progress { margin: 30px 0 22px; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14.5px; color: var(--muted); margin-bottom: 10px; }
.progress-top b { font: 700 15px var(--display); color: var(--green-deep); }
.track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.track i { height: 8px; border-radius: 99px; background: var(--line); transition: background-color .25s ease; }
.track i.done { background: var(--green); }
.track i.now { background: var(--ink); }

.stage-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 32px; }
.stage-card > h2 { font-size: 25px; font-weight: 800; color: var(--ink); }
.stage-card > .goal { color: var(--muted); margin-top: 4px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }

.field { margin-top: 28px; border: 0; padding: 0; min-width: 0; }
.field[hidden] { display: none; }
.field > .q, .field > legend {
  font: 700 17.5px var(--display); color: var(--ink); padding: 0; margin-bottom: 4px; display: block; line-height: 1.6;
}
.field .opt-tag { font: 500 13px var(--body); color: var(--muted); margin-inline-start: 8px; }
.field .hint { font-size: 14.5px; color: var(--muted); margin-bottom: 8px; }
.field input[type="text"], .field input[type="tel"] {
  width: 100%; min-height: 52px; margin-top: 8px; padding: 10px 16px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper);
  font: 500 16.5px var(--body); color: var(--text);
}
.field input[type="text"]:focus, .field input[type="tel"]:focus { outline: none; border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(8, 182, 124, .16); }
.field input[type="tel"] { direction: ltr; text-align: right; }

.opts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 18px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper);
  font-weight: 500; font-size: 16px; transition: border-color .12s ease, background-color .12s ease;
}
.opt span::before {
  content: ""; width: 18px; height: 18px; flex: none; border: 2px solid #9db5ab; background: #fff;
  border-radius: 50%; transition: all .12s ease;
}
.opt input[type="checkbox"] + span::before { border-radius: 5px; }
.opt:hover span { border-color: var(--green); }
.opt input:checked + span { border-color: var(--green-deep); background: var(--green-soft); color: var(--ink); font-weight: 600; }
.opt input:checked + span::before { border-color: var(--green-deep); background: var(--green-deep); box-shadow: inset 0 0 0 3px #fff; }
.opt input:focus-visible + span { outline: 3px solid #ffd166; outline-offset: 2px; }

.links-grid { display: grid; gap: 10px; margin-top: 8px; }
.links-grid label { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; font-size: 15px; color: var(--muted); }
.links-grid input { margin-top: 0 !important; direction: ltr; text-align: right; }

.error { display: none; color: var(--danger); font-size: 14.5px; font-weight: 600; margin-top: 8px; }
.field.invalid .error { display: block; }
.field.invalid input[type="text"], .field.invalid input[type="tel"] { border-color: var(--danger); }

.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.quiz-nav .btn-primary { margin-inline-start: auto; }
.send-note { font-size: 14px; color: var(--muted); margin-top: 14px; text-align: center; }

.thanks { text-align: center; padding: 48px 28px; }
.thanks img { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 22px; }
.thanks h2 { font-size: 30px; font-weight: 800; color: var(--ink); }
.thanks p { color: var(--muted); max-width: 50ch; margin: 14px auto 0; }
.thanks .tagline { font: 700 18px var(--display); color: var(--green-deep); margin-top: 26px; }
.thanks .cta-row { justify-content: center; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .steps { grid-template-columns: 1fr; }
  .step { border-inline-start: 0; border-top: 1px solid var(--line); padding: 22px 0; }
  .step:first-child { border-top: 0; padding-top: 0; }
  .explain-grid { grid-template-columns: 1fr; gap: 32px; }
  section { padding-block: 60px; }
  .hero .wrap { padding-block: 48px 190px; }
  .hero-art { height: 200px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .brand small { display: none; }
  .site-header .btn { padding: 0 16px; }
  .cta-row .btn { width: 100%; }
  .stage-card { padding: 22px 18px; border-radius: 18px; }
  .opts { flex-direction: column; }
  .opt span { width: 100%; }
  .links-grid label { grid-template-columns: 1fr; gap: 2px; }
  .quiz-nav .btn { flex: 1; padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
