:root {
  --bg: #07111f;
  --surface: #0d1a2d;
  --surface-2: #12223a;
  --surface-3: #172b47;
  --line: rgba(148, 163, 184, .18);
  --text: #f8fafc;
  --muted: #a8b5c7;
  --primary: #0ea5e9;
  --primary-dark: #0369a1;
  --accent: #f59e0b;
  --success: #22c55e;
  --danger: #f43f5e;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Tajawal", Arial, sans-serif;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 10px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 31, .94);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: max-content; }
.brand span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 12px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 24px;
  font-weight: 800;
}
.brand-avatar {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(125, 211, 252, .72);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .13);
}
.main-nav { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.main-nav a {
  padding: 9px 11px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: .2s ease;
}
.main-nav a:is(:hover, .active) { background: rgba(14,165,233,.12); color: #7dd3fc; }
.header-actions { display: flex; gap: 8px; }

.button, .text-button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 15px;
  color: white;
  font-weight: 700;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.button:hover, .text-button:hover { transform: translateY(-2px); }
.button.primary { background: var(--primary); }
.button.primary:hover { background: #0284c7; }
.button.accent { background: var(--accent); color: #291800; }
.button.ghost { border-color: var(--line); background: transparent; }
.button.glass { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }
.button.large { padding: 13px 20px; }
.button.wide { width: 100%; }
.text-button { padding-inline: 0; background: transparent; color: #7dd3fc; }
.icon-button { border: 0; background: transparent; color: white; font-size: 24px; }
.menu-toggle { display: none; }

.view { display: none; }
.view.active { display: block; }
.hero {
  position: relative;
  min-height: clamp(520px, 76vh, 700px);
  overflow: hidden;
  isolation: isolate;
}
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 28%; filter: brightness(1.32) contrast(1.04); }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7,17,31,0), rgba(7,17,31,.18) 42%, rgba(7,17,31,.72) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  min-height: inherit;
  width: min(1180px, calc(100% - 36px));
  margin: auto;
}
.eyebrow {
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 800;
}
.hero h1 { max-width: 730px; margin: 12px 0; font-size: clamp(42px, 6vw, 76px); line-height: 1.12; text-shadow: 0 3px 18px rgba(0, 0, 0, .55); }
.hero h1 em { color: #fbbf24; font-style: normal; }
.hero p { max-width: 600px; margin: 0 0 24px; color: #d5e0ed; font-size: 19px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stat {
  position: absolute;
  bottom: 28px;
  left: max(18px, calc((100% - 1180px) / 2));
  display: grid;
  gap: 2px;
  padding: 13px 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  background: rgba(7,17,31,.65);
  backdrop-filter: blur(10px);
}
.hero-stat span { color: var(--muted); font-size: 13px; }
.hero-stat strong { color: #fbbf24; }

.quick-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(1180px, calc(100% - 36px));
  margin: -30px auto 0;
  position: relative;
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.quick-strip article { display: flex; gap: 12px; padding: 20px; border-inline-end: 1px solid var(--line); }
.quick-strip article:last-child { border: 0; }
.quick-strip div { display: grid; gap: 3px; }
.quick-strip small { color: var(--muted); }
.feature-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 8px; background: rgba(14,165,233,.14); color: #7dd3fc; font-size: 20px; }

.section-shell { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }
.split-section { display: grid; grid-template-columns: 1.45fr .75fr; gap: 20px; padding: 78px 0; }
.section-heading, .row-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1, h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 14px; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.news-grid.compact { grid-template-columns: repeat(2, 1fr); }
.news-card, .info-card, .exam-card, .panel, .info-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.news-card, .info-card, .exam-card { padding: 18px; transition: .2s ease; }
.news-card:hover, .info-card:hover, .exam-card:hover { border-color: rgba(14,165,233,.55); transform: translateY(-3px); }
.news-card time { color: #7dd3fc; font-size: 12px; }
.news-card h3 { margin: 10px 0 8px; }
.news-card p, .info-card p, .exam-card p, .info-panel p, .page-heading p { color: var(--muted); line-height: 1.75; }
.info-panel { padding: 24px; border-top: 3px solid var(--accent); }
.info-panel h2 { margin-top: 10px; line-height: 1.55; }

.page-view { min-height: 72vh; padding: 56px 0 80px; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { margin: 10px 0 4px; font-size: clamp(30px, 4vw, 46px); }
.exams-profile-banner {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.exams-profile-banner img {
  width: 190px;
  height: 190px;
  object-fit: cover;
  object-position: center 20%;
}
.exams-profile-banner div { padding: 18px 18px 18px 0; }
.exams-profile-banner h1 { margin: 8px 0 4px; font-size: clamp(28px, 4vw, 44px); }
.exams-profile-banner p { margin: 0; color: var(--muted); line-height: 1.75; }
.info-grid, .exam-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-card .info-icon { color: #fbbf24; font-size: 24px; }
.about-layout {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) 1.3fr;
  gap: 20px;
  margin-bottom: 26px;
}
.about-photo {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  object-position: center 24%;
  box-shadow: var(--shadow);
}
.about-content {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.about-content h2 { margin: 10px 0; font-size: clamp(28px, 4vw, 42px); }
.about-content > p { color: var(--muted); font-size: 17px; line-height: 1.9; }
.about-highlights { display: grid; gap: 9px; margin-top: 20px; }
.about-highlights article { display: grid; gap: 4px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: #091629; }
.about-highlights span { color: var(--muted); line-height: 1.7; }
.credentials-section { margin-top: 20px; }
.credentials-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.credentials-grid article { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.credentials-grid span { color: #fbbf24; font-size: 23px; }
.credentials-grid strong { display: block; margin-top: 8px; }
.credentials-grid p { margin: 7px 0 0; color: var(--muted); line-height: 1.75; }
.filter-row { margin-bottom: 18px; }
select, input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #071426;
  color: white;
  outline: 0;
}
select:focus, input:focus, textarea:focus { border-color: var(--primary); }
.filter-row select { width: min(300px, 100%); }
.exam-card { display: grid; gap: 14px; }
.exam-card .exam-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 8px; border-radius: 20px; background: rgba(14,165,233,.12); color: #7dd3fc; font-size: 12px; }
.chip.warning { background: rgba(245,158,11,.14); color: #fbbf24; }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin-top: 6px; color: #7dd3fc; font-size: 28px; }
.student-avatar { display: grid; width: 70px; height: 70px; place-items: center; border-radius: 50%; background: rgba(14,165,233,.18); color: #7dd3fc; font-size: 32px; font-weight: 800; }
.panel { padding: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: right; }
th { color: #7dd3fc; font-size: 13px; }
td { color: #d7e0ec; }

.exam-room { width: min(1100px, calc(100% - 36px)); min-height: calc(100vh - 100px); margin: auto; padding: 34px 0; }
.exam-room-header, .exam-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timer-box { min-width: 130px; padding: 10px 14px; border: 1px solid rgba(245,158,11,.34); border-radius: var(--radius); background: rgba(245,158,11,.1); text-align: center; }
.timer-box span { display: block; color: #fde68a; font-size: 12px; }
.timer-box strong { color: #fbbf24; font-size: 26px; }
.exam-progress { height: 5px; margin: 22px 0; overflow: hidden; border-radius: 9px; background: var(--surface); }
.exam-progress span { display: block; height: 100%; background: var(--primary); transition: width .2s ease; }
.exam-layout { display: grid; grid-template-columns: 180px 1fr; gap: 14px; }
.question-nav { display: grid; grid-template-columns: repeat(4, 1fr); align-content: start; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.question-nav button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: white; }
.question-nav button:is(.active, .answered) { border-color: var(--primary); background: rgba(14,165,233,.2); }
.question-card { min-height: 330px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.question-card h2 { line-height: 1.75; }
.option { display: flex; gap: 9px; margin: 9px 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #091629; }
.option:hover { border-color: var(--primary); }
.option input { width: auto; }
.exam-footer { margin-top: 16px; }

.admin-tabs { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.admin-tabs button { min-width: max-content; border: 1px solid var(--line); border-radius: 6px; padding: 9px 13px; background: var(--surface); color: var(--muted); }
.admin-tabs button.active { border-color: var(--primary); color: #7dd3fc; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin-list { display: grid; gap: 8px; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.admin-row small { color: var(--muted); }
.admin-actions { display: flex; gap: 5px; }
.admin-actions button { border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; background: transparent; color: white; }
.admin-actions .danger { color: #fda4af; }

.modal {
  width: min(520px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  color: white;
  box-shadow: var(--shadow);
}
.wide-modal { width: min(680px, calc(100% - 28px)); }
.modal::backdrop { background: rgba(1,7,16,.74); backdrop-filter: blur(3px); }
.modal-close { float: left; border: 0; background: transparent; color: var(--muted); font-size: 28px; }
.modal-heading h2 { margin: 9px 0 4px; }
.modal-heading p { color: var(--muted); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 6px; background: #071426; }
.segmented button { border: 0; border-radius: 4px; padding: 9px; background: transparent; color: var(--muted); }
.segmented button.active { background: var(--surface-3); color: white; }
form { display: grid; gap: 12px; margin-top: 15px; }
label { display: grid; gap: 6px; color: #d7e0ec; font-size: 14px; }
.signup-fields { display: grid; gap: 12px; }
.form-message { min-height: 18px; margin: 0; color: #fda4af; font-size: 13px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 24px clamp(18px, 5vw, 72px); border-top: 1px solid var(--line); background: #050d18; color: var(--muted); }

@media (max-width: 900px) {
  .menu-toggle { display: block; margin-inline-start: auto; }
  .main-nav { position: absolute; top: 72px; inset-inline: 14px; display: none; align-items: stretch; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
  .main-nav.open { display: grid; }
  .header-actions .button { padding: 8px 10px; font-size: 13px; }
  .split-section { grid-template-columns: 1fr; }
  .news-grid, .info-grid, .exam-grid { grid-template-columns: repeat(2, 1fr); }
  .credentials-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .site-header { gap: 8px; padding-inline: 12px; }
  .brand strong { font-size: 13px; }
  .brand small { display: none; }
  .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .brand-avatar { width: 39px; height: 39px; }
  .header-actions { gap: 4px; }
  .header-actions .button { padding: 8px; font-size: 12px; }
  .hero { min-height: 600px; }
  .hero-overlay { background: linear-gradient(0deg, rgba(7,17,31,.76) 0%, rgba(7,17,31,.24) 60%, rgba(7,17,31,0) 100%); }
  .hero-content { align-content: end; padding-bottom: 100px; }
  .hero h1 { font-size: 44px; }
  .hero p { font-size: 16px; }
  .hero-stat { display: none; }
  .quick-strip { grid-template-columns: 1fr; margin-top: -18px; }
  .quick-strip article { padding: 14px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .news-grid, .news-grid.compact, .info-grid, .exam-grid { grid-template-columns: 1fr; }
  .about-layout { grid-template-columns: 1fr; }
  .about-photo { max-height: 430px; min-height: 330px; }
  .credentials-grid { grid-template-columns: 1fr; }
  .page-view { padding-top: 36px; }
  .exams-profile-banner { grid-template-columns: 110px 1fr; gap: 10px; }
  .exams-profile-banner img { width: 110px; height: 150px; }
  .exams-profile-banner div { padding: 12px 8px 12px 0; }
  .exams-profile-banner h1 { font-size: 25px; }
  .exams-profile-banner p { font-size: 13px; }
  .exam-room-header { align-items: flex-start; }
  .exam-layout { grid-template-columns: 1fr; }
  .question-nav { grid-template-columns: repeat(8, 1fr); order: 2; }
  .exam-footer { flex-wrap: wrap; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}
