@font-face {
  font-family: "NeoSansArabic";
  src: url("/assets/fonts/NeoSansArabicRegular.woff2") format("woff2"),
       url("/assets/fonts/NeoSansArabicRegular.woff") format("woff"),
       url("/assets/fonts/NeoSansArabicRegular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --portal-primary: #159b83;
  --portal-primary-dark: #11836f;
  --portal-accent: #1cae86;
  --portal-blue: #2563eb;
  --portal-blue-dark: #123b73;
  --portal-teal: #0d9488;
  --portal-ink: #172554;
  --portal-muted: #64748b;
  --portal-line: #dce8f6;
  --portal-bg: #f0f7ff;
  font-family: "Poppins", "NeoSansArabic", "Segoe UI", Tahoma, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body.tawjihi-app {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  color: var(--portal-ink);
  background:
    radial-gradient(ellipse at 10% 12%, rgba(56, 189, 248, .11), transparent 34rem),
    radial-gradient(ellipse at 94% 48%, rgba(13, 148, 136, .08), transparent 31rem),
    linear-gradient(180deg, #f7faff 0%, #f0f7ff 48%, #f8fbff 100%);
  font-size: 15px;
  line-height: 1.55;
}

body.tawjihi-app[dir="rtl"] { font-family: "NeoSansArabic", Tahoma, "Segoe UI", Arial, sans-serif; }
a { color: inherit; }
button, input, select { font: inherit; }
body.tawjihi-app a:focus-visible,
body.tawjihi-app button:focus-visible,
body.tawjihi-app select:focus-visible { outline: 3px solid #38bdf8; outline-offset: 3px; }

.portal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(220, 232, 246, .9);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 20px rgba(18, 59, 115, .055);
  backdrop-filter: blur(14px);
}

.portal-header-inner {
  display: flex;
  width: min(1200px, calc(100% - 38px));
  min-height: 72px;
  align-items: center;
  margin: 0 auto;
  gap: 32px;
}

.portal-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: var(--portal-ink);
  text-decoration: none;
}

.portal-brand img {
  display: block;
  width: 200px;
  height: 60px;
  object-fit: contain;
  object-position: center;
}

.portal-brand > span { display: grid; padding-inline-start: 12px; border-inline-start: 1px solid var(--portal-line); line-height: 1.35; }
.portal-brand strong { color: var(--portal-blue-dark); font-size: 15px; font-weight: 800; }
.portal-brand small { color: var(--portal-muted); font-size: 11px; }
.portal-nav { display: flex; height: 72px; align-items: center; gap: 9px; }
.portal-nav a { padding: 9px 13px; border-radius: 10px; color: #536782; font-size: 13px; font-weight: 600; text-decoration: none; transition: color .18s ease, background-color .18s ease; }
.portal-nav a:hover { color: var(--portal-blue-dark); background: #eff6ff; }
.portal-nav .portal-nav-active { color: #1d4ed8; background: #eff6ff; font-weight: 700; }
.portal-language { margin-inline-start: auto; padding: 8px 13px; border: 1px solid #dbeafe; border-radius: 10px; color: #1d4ed8; background: #fff; font-size: 12px; font-weight: 700; text-decoration: none; transition: border-color .18s ease, background-color .18s ease, color .18s ease; }
.portal-language:hover { border-color: #93c5fd; color: #123b73; background: #f8fbff; }

.portal-main { width: min(1160px, calc(100% - 36px)); min-height: calc(100vh - 146px); margin: 0 auto; padding: 22px 0 58px; }
.portal-breadcrumb { display: flex; align-items: center; gap: 10px; width: max-content; max-width: 100%; margin-bottom: 15px; padding: 6px 12px; border: 1px solid rgba(220, 232, 246, .8); border-radius: 999px; color: #71829a; background: rgba(255, 255, 255, .65); font-size: 11px; }
.portal-breadcrumb a { color: #2563eb; text-decoration: none; transition: color .18s ease; }
.portal-breadcrumb a:hover { color: var(--portal-blue-dark); }
.portal-breadcrumb [aria-current="page"] { color: #52647e; font-weight: 600; }

.portal-heading { position: relative; isolation: isolate; overflow: hidden; margin: 0 0 21px; padding: clamp(27px, 4vw, 43px) clamp(22px, 5vw, 54px); border: 1px solid rgba(191, 219, 254, .7); border-radius: 24px; background: radial-gradient(ellipse at 82% 18%, rgba(56, 189, 248, .16), transparent 22rem), radial-gradient(ellipse at 4% 100%, rgba(13, 148, 136, .09), transparent 19rem), linear-gradient(120deg, rgba(255, 255, 255, .97), rgba(241, 248, 255, .97)); box-shadow: 0 16px 38px rgba(18, 59, 115, .075); animation: portal-enter .55s ease both; }
.portal-heading::after { position: absolute; z-index: -1; top: -112px; inset-inline-end: 8%; width: 250px; height: 250px; border: 1px solid rgba(37, 99, 235, .09); border-radius: 50%; box-shadow: 0 0 0 23px rgba(37, 99, 235, .025), 0 0 0 48px rgba(13, 148, 136, .025); content: ""; pointer-events: none; }
.portal-heading-copy { max-width: 760px; }
.portal-heading-badge { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 12px; padding: 6px 11px; border: 1px solid #cceee9; border-radius: 999px; color: #0f766e; background: rgba(240, 253, 250, .88); font-size: 12px; font-weight: 700; }
.portal-heading-badge span { color: #0d9488; }
.portal-heading-copy h1 { max-width: 720px; margin: 0 0 9px; color: #172554; font-size: clamp(28px, 4vw, 43px); font-weight: 800; line-height: 1.27; letter-spacing: -.035em; }
.portal-heading-copy h1 span { color: #2563eb; background: linear-gradient(100deg, #2563eb, #0d9488); background-clip: text; -webkit-text-fill-color: transparent; }
.portal-heading-description { max-width: 670px; margin: 0; color: #536782; font-size: 15px; line-height: 1.8; }

.listing-tools { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr); align-items: center; gap: 14px; margin: 0 0 14px; padding: 16px; border: 1px solid #dce8f6; border-radius: 18px; background: rgba(255, 255, 255, .94); box-shadow: 0 10px 28px rgba(18, 59, 115, .07); }
.listing-search { display: flex; min-width: 0; min-height: 48px; align-items: center; padding: 0 13px; border: 1px solid #d7e3f2; border-radius: 12px; background: #fbfdff; gap: 10px; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.listing-search:focus-within { border-color: #60a5fa; background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.search-icon { color: #2563eb; font-size: 23px; line-height: 1; }
.listing-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--portal-ink); background: transparent; font-size: 13px; }
.listing-search input::placeholder { color: #8292a8; }
.listing-search kbd { flex: 0 0 auto; padding: 3px 7px; border: 1px solid #dce8f6; border-radius: 6px; color: #657892; background: #f3f7fc; font-family: inherit; font-size: 9px; line-height: 1.5; direction: ltr; unicode-bidi: isolate; }
.listing-filter-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 9px; }
.filter-select { display: grid; min-width: 0; gap: 4px; }
.filter-icon { display: none; }
.filter-select select { width: 100%; height: 44px; padding: 0 11px; border: 1px solid #d7e3f2; border-radius: 11px; outline: 0; color: #405675; background-color: #fff; cursor: pointer; font-size: 12px; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.filter-select select:hover { border-color: #a9c5e8; background-color: #fbfdff; }
.filter-select select:focus-visible { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.listing-summary { display: flex; align-items: center; justify-content: space-between; margin: 17px 2px 13px; color: #71829a; font-size: 11px; animation: portal-enter .45s .08s ease both; }
.listing-summary p { margin: 0; padding: 6px 11px; border: 1px solid #cceee9; border-radius: 999px; color: #0f766e; background: #f0fdfa; font-size: 12px; font-weight: 700; }
.listing-summary > span { display: inline-flex; align-items: center; gap: 7px; }
.listing-summary > span::before { width: 7px; height: 7px; border-radius: 50%; background: #0d9488; content: ""; }

@keyframes portal-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.announcement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 320px)); justify-content: center; align-items: stretch; gap: 14px; }
.announcement-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid #d5e4f6; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(18, 59, 115, .085); transition: border-color .18s ease, box-shadow .18s ease; }
.announcement-card:hover { border-color: #a9c5e8; box-shadow: 0 9px 24px rgba(18, 59, 115, .13); }
.announcement-card[hidden] { display: none; }

.announcement-image {
  display: flex;
  width: 100%;
  height: 116px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px 18px 8px;
  border-bottom: 1px solid #e8f0fa;
  background: linear-gradient(135deg, #f7fbff, #eff7ff);
}

.announcement-image img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: none;
  opacity: 1;
  mix-blend-mode: normal;
}

.announcement-placeholder { display: grid; width: 74px; height: 74px; place-items: center; border: 1px solid #cfe0f5; border-radius: 22px; color: #2563eb; background: linear-gradient(145deg, #fff, #eaf3ff); font-size: 30px; font-weight: 700; }
.announcement-card-body { display: flex; flex: 1; flex-direction: column; padding: 0 13px 12px; }
.announcement-card-header { margin: 0 -13px 9px; padding: 7px 11px; border-top: 0; border-bottom: 1px solid #e8f0fa; color: #1e4f91; background: #f4f8ff; font-size: 11px; font-weight: 700; text-align: start; }
.announcement-meta { display: flex; min-height: 24px; align-items: center; justify-content: space-between; gap: 7px; }
.announcement-year { color: #536782; font-size: 11px; font-weight: 700; }
.deadline-pill { padding: 3px 9px; border: 1px solid #a7f3d0; border-radius: 999px; color: #047857; background: #ecfdf5; font-size: 10px; font-weight: 700; }
.deadline-closed { border-color: #fecdd3; color: #be123c; background: #fff1f2; }
.announcement-card h2 { margin: 7px 0 5px; color: #172554; font-size: 15px; font-weight: 700; line-height: 1.55; text-align: center; }
.announcement-school-link { display: block; overflow-wrap: anywhere; margin: 0 0 7px; color: #2563eb; font-size: 11px; text-align: center; text-decoration: underline; text-underline-offset: 2px; }
.announcement-details { display: grid; gap: 0; }
.announcement-details p { display: flex; min-height: 30px; align-items: center; justify-content: space-between; margin: 0; padding: 5px 0; border-bottom: 1px solid #edf2f8; color: #405675; font-size: 11px; gap: 6px; }
.announcement-details p:last-child { border-bottom: 0; }
.announcement-details p > span:first-child { color: #647b98; font-size: 12px; }
.announcement-details strong { margin-inline-end: auto; color: #526984; font-size: 10px; font-weight: 500; }
.announcement-status-dot { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: #94a3b8; }
.announcement-status-dot.is-active { background: #0d9488; }
.announcement-type { padding: 3px 9px; border-radius: 999px; color: #fff; background: #64748b; font-size: 10px; }
.announcement-type[data-school-type="خصوصية"] { color: #075985; background: #e0f2fe; }
.announcement-type[data-school-type="عمومية"] { color: #047857; background: #dcfce7; }
.announcement-type[data-school-type="semi public"] { color: #1d4ed8; background: #dbeafe; }
.announcement-description { display: -webkit-box; overflow: hidden; margin: 7px 0 0; color: #536782; font-size: 11px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.announcement-actions { margin-top: auto; padding-top: 11px; }
.announcement-primary-link { display: block; width: 100%; padding: 9px 10px; border-radius: 9px; color: #fff; background: linear-gradient(100deg, #2563eb, #0d9488); box-shadow: 0 4px 10px rgba(37, 99, 235, .16); font-size: 13px; font-weight: 700; letter-spacing: .2px; text-align: center; text-decoration: none; transition: box-shadow .18s ease, transform .18s ease, background-position .18s ease; }
.announcement-primary-link:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 7px 15px rgba(37, 99, 235, .23); }

.access-panel { display: grid; width: min(880px, 100%); grid-template-columns: .9fr 1.1fr; overflow: hidden; margin: 28px auto 0; border: 1px solid #dce8f6; border-radius: 20px; background: #fff; box-shadow: 0 16px 38px rgba(18, 59, 115, .09); }
.access-panel-copy { position: relative; overflow: hidden; padding: 34px 28px; color: #fff; background: linear-gradient(135deg, #123b73, #2563eb 62%, #0d9488); }
.access-panel-copy::after { position: absolute; right: -60px; bottom: -82px; width: 210px; height: 210px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 22px rgba(255,255,255,.05), 0 0 0 45px rgba(255,255,255,.035); content: ""; }
.access-kicker { color: rgba(255,255,255,.88); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.access-panel-copy h2 { position: relative; z-index: 1; margin: 11px 0 8px; font-size: 21px; line-height: 1.45; }
.access-panel-copy > p { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.9); font-size: 12px; line-height: 1.8; }
.access-benefit { position: relative; z-index: 1; display: flex; align-items: center; margin-top: 15px; color: #fff; font-size: 11px; gap: 8px; }
.access-benefit span { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: #19886f; background: #fff; font-size: 11px; font-weight: 900; }
.access-form { display: grid; align-content: center; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 28px; gap: 14px; }
.portal-form-field { display: grid; min-width: 0; gap: 5px; }
.portal-form-field label { color: #59635f; font-size: 11px; font-weight: 700; }
.portal-form-field input { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #d7e3f2; border-radius: 9px; outline: 0; color: var(--portal-ink); background: #fbfdff; font-size: 13px; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.portal-form-field input:focus { border-color: #60a5fa; background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.field-wide { grid-column: 1 / -1; }
.portal-primary-button { display: flex; min-height: 45px; align-items: center; justify-content: center; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(100deg, #2563eb, #0d9488); box-shadow: 0 7px 16px rgba(37, 99, 235, .2); cursor: pointer; font-size: 13px; font-weight: 700; gap: 10px; transition: filter .18s ease, transform .18s ease, box-shadow .18s ease; }
.portal-primary-button:hover { transform: translateY(-1px); filter: saturate(1.08); box-shadow: 0 10px 20px rgba(37, 99, 235, .24); }
.portal-primary-button:focus-visible { outline: 3px solid #38bdf8; outline-offset: 3px; }
.portal-privacy { margin: -3px 0 0; color: #838b88; font-size: 10px; text-align: center; }
.portal-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.portal-honeypot input { position: absolute; left: -10000px; }

.portal-alert { width: min(850px, 100%); margin: 0 auto 15px; padding: 12px 15px; border: 1px solid; border-radius: 11px; font-size: 12px; }
.portal-alert-success { border-color: #b7e5d5; color: #23876c; background: #f1faf6; }
.portal-alert-error { border-color: #ebcccc; color: #a43e45; background: #fff5f5; }
.portal-empty { width: min(850px, 100%); margin: 20px auto; padding: 42px 20px; border: 1px solid #dce8f6; border-radius: 18px; color: #52647e; background: rgba(255, 255, 255, .9); box-shadow: 0 10px 28px rgba(18, 59, 115, .055); text-align: center; animation: portal-enter .4s ease both; }
.portal-empty-icon { display: block; margin-bottom: 7px; color: var(--portal-blue); font-size: 28px; }
.portal-empty h2 { margin: 0 0 5px; color: #172554; font-size: 18px; }
.portal-empty p { margin: 0; color: var(--portal-muted); font-size: 12px; }
.portal-empty[hidden], .announcement-grid[hidden] { display: none; }
.filter-empty { border-style: dashed; }

.portal-footer { display: flex; min-height: 66px; align-items: center; justify-content: center; border-top: 1px solid #dce8f6; color: #71829a; background: rgba(255, 255, 255, .82); font-size: 11px; gap: 10px; }
.portal-footer a { color: #2563eb; text-decoration: none; transition: color .18s ease; }
.portal-footer a:hover { color: #0d9488; }
.portal-footer-brand { font-size: 12px; font-weight: 800; }

html[dir="rtl"] .announcement-actions { direction: rtl; }
html[dir="rtl"] .portal-primary-button span { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 900px) {
  .listing-tools { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .portal-header-inner { width: calc(100% - 24px); min-height: 64px; gap: 12px; }
  .portal-brand { gap: 8px; }
  .portal-brand img { width: 145px; height: 46px; }
  .portal-brand > span { padding-inline-start: 8px; }
  .portal-brand strong { font-size: 12px; }
  .portal-brand small { font-size: 9px; }
  .portal-nav { height: 64px; gap: 4px; }
  .portal-nav a { padding: 8px 10px; }
  .portal-nav a { font-size: 11px; }
  .portal-language { padding: 7px 9px; font-size: 10px; }
  .portal-main { width: calc(100% - 24px); padding-top: 17px; }
  .portal-heading { border-radius: 19px; }
  .portal-heading-copy h1 { font-size: clamp(27px, 5vw, 36px); }
  .portal-heading-description { font-size: 14px; }
  .listing-filter-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .listing-summary { align-items: flex-start; gap: 9px; }
  .announcement-grid { grid-template-columns: repeat(auto-fit, minmax(270px, 320px)); gap: 12px; }
  .access-panel { grid-template-columns: 1fr; }
  .access-panel-copy { padding: 22px; }
  .access-form { padding: 20px; }
}

@media (max-width: 540px) {
  .portal-header-inner { width: calc(100% - 18px); gap: 8px; }
  .portal-brand img { width: 110px; height: 38px; }
  .portal-brand > span { padding-inline-start: 6px; }
  .portal-brand strong { font-size: 11px; }
  .portal-brand small { font-size: 8px; }
  .portal-nav { gap: 2px; }
  .portal-nav a { padding: 7px 7px; }
  .portal-nav a { font-size: 10px; }
  .portal-language { padding: 5px 6px; font-size: 9px; }
  .portal-main { width: calc(100% - 20px); }
  .portal-breadcrumb { margin-bottom: 12px; }
  .portal-heading { margin-bottom: 15px; padding: 26px 19px; }
  .portal-heading-copy h1 { font-size: clamp(25px, 7vw, 32px); }
  .portal-heading-description { font-size: 13px; }
  .listing-tools { padding: 12px; border-radius: 15px; }
  .listing-filter-row { grid-template-columns: 1fr; gap: 8px; }
  .filter-select select { height: 44px; }
  .listing-summary { flex-direction: column; margin: 14px 1px 12px; }
  .listing-search kbd { display: none; }
  .announcement-grid { grid-template-columns: minmax(0, 1fr); }
  .announcement-card { width: 100%; }
  .access-panel { margin-top: 18px; border-radius: 16px; }
  .access-panel-copy { padding: 22px 19px; }
  .access-form { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
  .portal-form-field, .field-wide { grid-column: 1; }
  .portal-footer { flex-wrap: wrap; padding: 12px; }
}
