/* Cairo (Arabic + Latin), self-hosted */
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/cairo-arabic.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/cairo-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* VOLCANO review site: light, minimal */
:root {
  --bg: #ffffff;
  --soft: #f6f5f2;
  --line: #e3e1dc;
  --text: #1d1c1a;
  --muted: #5f5b55;
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --accent-soft: #fff1e8;
  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --bad: #b91c1c;
  --bad-bg: #fef2f2;
  --focus: #1d4ed8;
  --font: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--text); background: var(--bg); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(32px, 6vw, 44px); margin-bottom: 14px; }
h2 { font-size: 24px; margin-bottom: 12px; }
h3 { font-size: 18px; margin-bottom: 4px; }
h2[tabindex="-1"]:focus { outline: none; }
p + p { margin-top: 10px; }
.container { width: min(760px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 12px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 3px; text-decoration: none; color: var(--text); }
.brand img { display: block; width: 36px; height: 36px; border-radius: 8px; }
.brand:hover { color: var(--accent); }
.bar nav { display: flex; gap: 20px; }
.bar nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 16px; padding: 6px 0; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--text); }
.bar nav a[aria-current="page"] { border-bottom: 2px solid var(--accent); }

/* sections */
section { padding: 40px 0; }
section + section { border-top: 1px solid var(--line); }
.hero { padding: 56px 0 44px; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.lead { font-size: 19px; color: var(--muted); max-width: 640px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 700; font-size: 16px; min-height: 46px; padding: 10px 22px; border-radius: 8px; border: 1.5px solid var(--text); background: #fff; color: var(--text); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--soft); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* steps */
.steps { list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps > li { counter-increment: s; position: relative; padding-left: 52px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; display: grid; place-items: center; }

/* table */
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 16px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 14px; color: var(--muted); font-weight: 700; background: var(--soft); }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 800; border-bottom: 0; }

/* forms */
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 24px; background: #fff; }
.field { margin-bottom: 18px; }
.field label.lbl { display: block; font-weight: 700; margin-bottom: 6px; }
.input { width: 100%; font: inherit; color: var(--text); background: #fff; border: 1.5px solid #bdb9b1; border-radius: 8px; padding: 10px 12px; min-height: 46px; }
.input:focus { border-color: var(--accent); outline: 3px solid rgba(194, 65, 12, .25); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.hint { color: var(--muted); font-size: 14px; margin-top: 4px; }
.err-msg { color: var(--bad); font-size: 14px; margin-top: 4px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--muted); cursor: pointer; }
.check input { margin-top: 5px; width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { border: 1.5px solid #d97706; background: #fffbeb; color: #78350f; border-radius: 8px; padding: 10px 14px; font-size: 15px; margin-bottom: 16px; }
.alert { border: 1.5px solid var(--bad); background: var(--bad-bg); color: #7f1d1d; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.done h2 { margin-bottom: 8px; }
.form-wrap { max-width: 520px; }
.link-line { margin-top: 16px; font-size: 14px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 15px; }

/* ===== practice page ===== */
.start-block { margin-bottom: 28px; }
.start-block h2 { font-size: 20px; margin-bottom: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.qr { display: inline-block; line-height: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: 12px; }
.qr svg { width: 150px; height: 150px; }
.modes { display: grid; gap: 10px; margin-top: 10px; }
.mode { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; }
.mode input { margin-top: 5px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.mode:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mode b { display: block; }
.mode .d { color: var(--muted); font-size: 15px; }

.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 6px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.tab { flex: none; font: inherit; font-weight: 600; font-size: 15px; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); padding: 10px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 800; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #a39e95; }
.dot.done { background: var(--ok); border-color: var(--ok); }
.tools { display: flex; gap: 8px; align-items: center; }
.timer { font-family: var(--mono); font-weight: 700; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; min-width: 76px; text-align: center; background: var(--soft); }
.timer.low { color: var(--bad); border-color: var(--bad); }

.sec-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.tag { font-size: 14px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; background: var(--soft); white-space: nowrap; }
.intro { color: var(--muted); margin-bottom: 16px; }
.note { background: var(--accent-soft); border: 1px solid #fed7aa; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 16px; }

.q { border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; background: #fff; }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.qno { font-weight: 800; }
.qtext { font-weight: 600; margin-bottom: 10px; }
.blank-no { font-family: var(--mono); font-weight: 800; color: var(--accent-dark); }
pre.code { font-family: var(--mono); font-size: 14px; line-height: 1.55; background: #f4f3ef; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; white-space: pre; margin: 8px 0 12px; tab-size: 4; }
pre.code .ln { color: #8a857c; user-select: none; display: inline-block; width: 2.2em; text-align: right; margin-right: 1em; }
pre.code .ln.sel { color: var(--accent-dark); font-weight: 800; }
pre.sample { margin: 6px 0 0; background: #fff; }
.sub { font-weight: 700; margin: 12px 0 6px; font-size: 15px; color: var(--muted); }
textarea.input { font-family: var(--mono); font-size: 14px; min-height: 190px; resize: vertical; line-height: 1.55; }
input.code-input { font-family: var(--mono); font-size: 14px; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 8px; padding: 9px 12px; cursor: pointer; background: #fff; }
.opt input { margin-top: 5px; accent-color: var(--accent); flex: none; width: 18px; height: 18px; }
.opt code { font-family: var(--mono); font-size: 13.5px; white-space: pre-wrap; word-break: break-word; flex: 1 1 200px; min-width: 0; }
.opt:not(.right):not(.wrong):has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.badge { flex: none; margin-left: auto; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-radius: 4px; padding: 1px 6px; color: #fff; }
.right > .badge { background: var(--ok); }
.wrong > .badge { background: var(--bad); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.lpick { font-family: var(--mono); border: 1.5px solid var(--line); border-radius: 6px; padding: 5px 12px; cursor: pointer; background: #fff; font-weight: 700; position: relative; }
.lpick input { position: absolute; opacity: 0; pointer-events: none; }
.lpick:not(.right):not(.wrong):has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.lpick:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.lpick.right { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.lpick.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.tf { display: flex; gap: 10px; }
.tf .opt { flex: 1; justify-content: center; align-items: center; font-weight: 700; }

.fb { margin-top: 12px; border-radius: 8px; padding: 12px 14px; border: 1px solid; border-left-width: 5px; }
.fb.ok { border-color: var(--ok); background: var(--ok-bg); }
.fb.bad { border-color: var(--bad); background: var(--bad-bg); }
.fb .t { display: block; font-weight: 800; margin-bottom: 4px; }
.fb .ref { font-size: 14px; color: var(--muted); margin-top: 6px; }
.fb .more { margin-top: 6px; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.diff h4 { font-size: 13px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.diff pre { font-family: var(--mono); font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow-x: auto; line-height: 1.5; }
.l-ok { color: var(--ok); }
.l-bad { color: var(--bad); font-weight: 700; }
.qactions { margin-top: 12px; }
.navrow { display: flex; justify-content: space-between; gap: 10px; margin: 22px 0 8px; flex-wrap: wrap; }

.score { font-size: clamp(48px, 10vw, 80px); font-weight: 800; line-height: 1.1; color: var(--accent-dark); }
.bars { display: grid; gap: 12px; margin-top: 18px; }
.pbar .meta { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.pbar .track { height: 10px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.pbar .fill { height: 100%; width: 0; background: var(--accent); transition: width .5s ease; }
.review-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.review-item .txt { flex: 1 1 260px; font-size: 16px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding-top: 36px; }
  .diff { grid-template-columns: 1fr; }
  .bar nav { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
#start .lead { margin-bottom: 28px; }

/* ===== RTL (Arabic site) with LTR English questions ===== */
.skip { left: auto; inset-inline-start: -999px; }
.skip:focus { left: auto; inset-inline-start: 12px; }
.hp { left: auto; inset-inline-start: -9999px; }
th, td { text-align: start; }
td.num, th.num { text-align: end; }
.steps > li { padding-left: 0; padding-inline-start: 52px; }
.steps > li::before { left: auto; inset-inline-start: 0; }
.review-item { border-left: 1px solid var(--line); border-inline-start: 4px solid var(--bad); }
.ltr, .timer { direction: ltr; text-align: left; }
.input.ltr::placeholder { text-align: left; }
/* English question cards: LTR. Arabic feedback inside them: RTL. */
.q { direction: ltr; text-align: left; }
.q .fb, .q .note { direction: rtl; text-align: right; }
.q .fb { border-left-width: 1px; border-right-width: 5px; }
.q .qactions { text-align: left; }
.q .sub { color: var(--muted); }
pre.code, .diff pre { direction: ltr; text-align: left; }
.badge { margin-left: auto; }
.q .opt { text-align: left; }
.sec-title .tag, .qhead .tag { direction: rtl; }
.qhead .tag { direction: ltr; }

/* ---- access gate + exam picker ---- */
.code-field { letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.code-field::placeholder { letter-spacing: .08em; font-weight: 400; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent-dark); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--accent); }
.exam-list { display: grid; gap: 14px; margin: 18px 0 8px; }
.exam-card { border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: #fff; }
.exam-card h2 { font-size: 20px; margin: 0; }
.ec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.exam-card .parts { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; }
.exam-card .parts li { font-size: 13.5px; font-weight: 700; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; background: var(--soft); }
.ec-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* multi-line output options */
.opt pre.optpre { font-family: var(--mono); font-size: 13.5px; line-height: 1.5; margin: 0; white-space: pre-wrap; word-break: break-word; flex: 1 1 200px; min-width: 0; }
.qtext code { font-family: var(--mono); font-size: .92em; background: var(--soft); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
