:root {
  --bg: #ffffff;
  --line: #d8e2ef;
  --text: #101a2a;
  --muted: #55637a;
  --accent: #1c5fb8;
  --deep: #123f85;
  --sky: #2e8be0;
  --yellow: #f2c230;
  --yellow-soft: #ffd24a;
  --red: #e03a34;
  --green: #6fb544;
  --paper: #eef4fb;
  --wrap: 1120px;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Tajawal", "Archivo", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.7;
}
html[lang="en"] body { font-family: "Archivo", system-ui, sans-serif; font-size: 17px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

/* Header */
header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 18px; height: 84px; }
.logo img { display: block; height: 68px; width: auto; }
nav { display: flex; gap: 18px; margin-inline-start: auto; font-size: 15px; font-weight: 500; color: var(--muted); }
nav a:hover { color: var(--accent); }
nav a.on { color: var(--accent); font-weight: 700; }
.lang {
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  background: none; color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px;
}
.lang:hover { border-color: var(--accent); color: var(--accent); }
.menu-btn {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 0 10px; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 10px;
}
.menu-btn span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

/* Buttons */
.btn {
  display: inline-block; padding: 13px 30px; border-radius: 999px;
  font-weight: 800; border: 2px solid transparent; transition: transform .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn.cta { background: var(--yellow); color: #1a1400; }
.btn.ghost { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn.line { border-color: var(--accent); color: var(--accent); }
.more { color: var(--accent); font-weight: 700; }
.more:hover { text-decoration: underline; }

/* Hero */
.hero, .page-hero {
  position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(135deg, var(--deep), var(--accent)); color: #fff;
}
.hero { padding-block: 96px 110px; }
.page-hero { padding-block: 60px 64px; }
.hero::before {
  content: "EIAST"; position: absolute; inset-block-end: -80px; inset-inline: 0;
  font-family: "Archivo", sans-serif; font-weight: 800; font-size: clamp(140px, 28vw, 380px);
  line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .14);
  direction: ltr; pointer-events: none;
}
.hero .wrap { position: relative; }
.eyebrow { display: inline-block; font-size: 15px; font-weight: 700; color: var(--yellow-soft); margin-bottom: 18px; }
h1 { font-size: clamp(36px, 6vw, 68px); line-height: 1.18; font-weight: 800; }
.page-hero h1 { font-size: clamp(32px, 5vw, 52px); }
h1 em { font-style: normal; color: var(--yellow-soft); }
.lead { margin: 22px auto 0; max-width: 62ch; color: rgba(255, 255, 255, .88); font-size: 1.1em; }
.page-hero .lead { margin-top: 14px; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 36px; }
.stripe {
  height: 6px;
  background: linear-gradient(90deg, var(--sky) 0 20%, var(--yellow) 20% 40%, #111 40% 60%, var(--red) 60% 80%, var(--green) 80%);
}

/* Sections */
section { padding-block: 80px; }
.tag { font-size: 14px; font-weight: 700; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; }
h2 { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.22; font-weight: 800; margin-top: 8px; }
.light { background: var(--paper); }
.intro { color: var(--muted); max-width: 64ch; margin-top: 14px; }
.prose { max-width: 72ch; }
.prose p { color: var(--muted); }
.prose p + p { margin-top: 16px; }

.about { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
.about p { color: var(--muted); }
.about p + p { margin-top: 16px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 44px; }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--sky); border-radius: 14px;
  padding: 28px 24px; transition: transform .2s;
}
.card:hover { transform: translateY(-3px); }
.card:nth-child(5n+2) { border-top-color: var(--yellow); }
.card:nth-child(5n+3) { border-top-color: var(--red); }
.card:nth-child(5n+4) { border-top-color: var(--green); }
.card:nth-child(5n+5) { border-top-color: #111; }
.num { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 15px; color: var(--accent); direction: ltr; display: block; }
.num[data-en] { direction: inherit; font-family: inherit; }
.card h3 { font-size: 21px; margin-block: 12px 8px; line-height: 1.3; }
.card p { color: var(--muted); font-size: .94em; }
.card .more { display: inline-block; margin-top: 14px; font-size: .94em; }

.card.media { padding: 0; overflow: hidden; }
.card.media img { display: block; width: 100%; aspect-ratio: 455 / 640; object-fit: cover; object-position: top; }
.card.media .body { padding: 16px 20px 20px; }
.card.media .body h3 { margin-top: 0; }
.card.media .num + h3 { margin-top: 8px; }
.card.media.wide { grid-column: 1 / -1; display: grid; grid-template-columns: 240px 1fr; align-items: center; }
.card.media.wide img { aspect-ratio: 360 / 455; object-position: center; }
.card.media.wide .body { padding: 24px; }

[hidden] { display: none !important; }
.btn.sm { padding: 9px 22px; font-size: 15px; margin-top: 16px; }
.meta { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 4px; font-size: .92em; color: var(--text); }
.meta li::before { content: "•"; color: var(--accent); margin-inline-end: 8px; }

.filters { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }
.filters + .cards { margin-top: 24px; }
.filters label, .reg label, .verify label { display: grid; gap: 4px; font-size: 15px; font-weight: 700; }
.filters input, .filters select, .reg input, .reg select, .reg textarea, .verify input {
  font: inherit; font-weight: 400; font-size: 16px; padding: 10px 14px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
}
.filters input, .filters select { min-width: 220px; }
.reg input:focus, .reg select:focus, .reg textarea:focus, .verify input:focus, .filters input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Enrollment dialog */
dialog#reg-dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); margin: auto; padding: 0;
  border: 0; border-radius: 18px; color: var(--text); box-shadow: 0 30px 80px rgba(16, 26, 42, .35);
}
dialog#reg-dialog::backdrop { background: rgba(16, 26, 42, .55); }
.reg { display: grid; gap: 12px; padding: 28px; }
.reg h2 { font-size: 26px; margin: 0; }
.reg .hint { color: var(--muted); }
.reg .check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.reg .check input { width: 20px; height: 20px; flex: none; margin-top: 4px; }
.reg .check a { color: var(--accent); text-decoration: underline; }
.reg .trap { position: absolute; inset-inline-start: -9999px; height: 0; overflow: hidden; }
.reg .status { color: var(--red); font-weight: 700; min-height: 1.4em; }
.reg .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.reg .btn { cursor: pointer; font: inherit; font-weight: 800; background: none; }
.reg .btn.cta { background: var(--yellow); }

/* Certificate check */
.verify { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 24px; max-width: 560px; }
.verify label { flex: 1; min-width: 220px; }
.verify .btn { cursor: pointer; font: inherit; font-weight: 800; }
.result { margin-top: 22px; padding: 22px 24px; border-radius: 14px; max-width: 560px; border: 2px solid; }
.result h3 { font-size: 21px; }
.result.good { border-color: var(--green); background: #f1f9ea; }
.result.bad { border-color: var(--red); background: #fdeeee; }
.result.warn { border-color: var(--yellow); background: #fff8e0; }

/* Contact icons */
.cicons { display: flex; flex-wrap: wrap; gap: 26px; }
.cicon { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.cicon i {
  display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
  background: var(--accent); color: #fff; transition: transform .15s;
}
.cicon:hover i { transform: translateY(-3px); }
.cicon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.enroll .cicon i { background: #fff; color: var(--accent); }
.addr { margin-top: 26px; color: var(--muted); }
.enroll .addr { color: rgba(255, 255, 255, .85); }
footer .cicons { gap: 10px; }
footer .cicon span { display: none; }
footer .cicon i { width: 40px; height: 40px; }
footer .cicon svg { width: 20px; height: 20px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 44px; }
.step { border-top: 3px solid var(--accent); padding-top: 20px; }
.step h3 { font-size: 22px; margin-bottom: 6px; }
.step p { color: var(--muted); }

.ticks { list-style: none; padding: 0; margin-top: 28px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 32px; }
.ticks li { position: relative; padding-inline-start: 34px; }
.ticks li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; top: 2px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 800; line-height: 24px; text-align: center;
}

.notice {
  margin-top: 36px; padding: 28px; border: 1px dashed var(--accent); border-radius: 14px;
  background: var(--paper); text-align: center;
}
.notice h3 { font-size: 22px; }
.notice p { color: var(--muted); margin-top: 6px; }
.notice .btn { margin-top: 18px; }

/* Contact band */
.enroll { background: linear-gradient(135deg, var(--deep), var(--accent)); color: #fff; }
.enroll .tag { color: var(--yellow-soft); }
.contact { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.contact p { color: rgba(255, 255, 255, .88); margin-top: 14px; max-width: 46ch; }
.contact .btn { margin-top: 28px; }
.info { list-style: none; padding: 0; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 16px; }
.info li { display: flex; justify-content: space-between; gap: 16px; padding: 18px 24px; }
.info li + li { border-top: 1px solid var(--line); }
.info span { color: var(--muted); }
.info a { color: var(--accent); font-weight: 700; }
.info a:hover { text-decoration: underline; }

footer { border-top: 1px solid var(--line); padding-block: 28px; color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; }
footer a:hover { color: var(--accent); }

@media (max-width: 1180px) {
  nav {
    display: none; position: absolute; top: 100%; inset-inline: 0;
    flex-direction: column; gap: 0; padding: 4px 20px 14px;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 16px 30px rgba(16, 26, 42, .1);
  }
  nav.open { display: flex; }
  nav a { padding: 12px 0; font-size: 17px; }
  nav a + a { border-top: 1px solid var(--line); }
  .menu-btn { display: inline-flex; margin-inline-start: auto; }
}
@media (max-width: 900px) {
  .about, .contact { grid-template-columns: 1fr; gap: 28px; }
  .cards, .cards.three { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .hero { padding-block: 64px 84px; }
  section { padding-block: 56px; }
}
@media (max-width: 560px) {
  .cards, .cards.two, .cards.three, .ticks { grid-template-columns: 1fr; }
  .logo img { height: 56px; }
  .card.media.wide { grid-template-columns: 1fr; }
  .cicons { gap: 18px; }
  .cicon i { width: 60px; height: 60px; }
  .info li { flex-direction: column; gap: 2px; }
}
