/* Royal College of Polytechnic Studies — public site stylesheet
   Palette, type and assets from the College asset kit (brand/tokens.css). */

:root {
  --navy: #101e43;
  --navy-deep: #0a132e;
  --navy-soft: #1c2f5e;
  --gold: #bd963f;
  --gold-light: #d4b368;
  --crimson: #ac2037;
  --ivory: #f4f1e9;
  --ivory-deep: #eae5d8;
  --white: #ffffff;
  --ink: #16203a;
  --muted: #5c6480;
  --line: #ded7c6;
  --font-en: Inter, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-ar: "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(16, 30, 67, .06), 0 2px 8px rgba(16, 30, 67, .05);
  --shadow-md: 0 10px 30px rgba(16, 30, 67, .1);
  --radius: 14px;
  --shell: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  font-family: var(--font-en);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] textarea,
html[lang="ar"] button,
html[lang="ar"] .btn { font-family: var(--font-ar); }

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.shell { max-width: var(--shell); margin: 0 auto; padding-inline: 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; inset-block-start: 10px; inset-inline-start: 10px; z-index: 60;
  background: var(--white); color: var(--navy); padding: 12px 16px;
  border: 2px solid var(--gold); border-radius: 8px; transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- header ---------- */

.site-header {
  position: sticky; inset-block-start: 0; z-index: 40;
  background: var(--navy);
  border-block-end: 1px solid rgba(189, 150, 63, .35);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 78px; padding-block: 10px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark {
  flex: 0 0 auto; background: var(--ivory); border: 1px solid rgba(189, 150, 63, .55);
  border-radius: 8px; padding: 5px 7px; line-height: 0;
}
.brand-mark img { height: 42px; width: auto; }
.brand-text { min-width: 0; }
.brand-text .en {
  display: block; color: var(--ivory); font-size: 12.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; line-height: 1.35;
}
.brand-text .ar {
  display: block; color: var(--gold-light); font-family: var(--font-ar);
  font-size: 12.5px; margin-block-start: 3px; line-height: 1.45; font-weight: 500;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a.nav-link {
  color: rgba(244, 241, 233, .82); font-size: 14px; font-weight: 500;
  padding: 10px 14px; border-radius: 8px; min-height: 44px;
  display: inline-flex; align-items: center; transition: color .18s ease, background-color .18s ease;
}
.nav a.nav-link:hover { color: var(--white); background: rgba(255, 255, 255, .07); }
.lang-switch {
  display: inline-flex; align-items: center; border: 1px solid rgba(244, 241, 233, .3);
  border-radius: 8px; overflow: hidden; direction: ltr; margin-inline-start: 6px;
}
.lang-switch a {
  min-width: 46px; min-height: 40px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 600; color: rgba(244, 241, 233, .75);
}
.lang-switch a[aria-current="true"] { background: var(--gold); color: var(--navy-deep); }
.lang-switch a + a { border-inline-start: 1px solid rgba(244, 241, 233, .3); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 50px; padding: 14px 26px; border: 1px solid transparent;
  border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: var(--gold-light); }
.btn-navy { background: var(--navy); color: var(--ivory); }
.btn-navy:hover { background: var(--navy-soft); }
.btn-ghost { background: transparent; color: var(--ivory); border-color: rgba(244, 241, 233, .45); }
.btn-ghost:hover { background: rgba(244, 241, 233, .1); border-color: var(--ivory); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--navy); }
.btn.header-cta { min-height: 44px; padding: 10px 18px; font-size: 14px; }
.btn .arrow { transition: transform .18s ease; }
.btn:hover .arrow { transform: translateX(3px); }
html[dir="rtl"] .btn:hover .arrow { transform: translateX(-3px); }
html[dir="rtl"] .arrow { display: inline-block; transform: scaleX(-1); }

/* ---------- hero ---------- */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--navy-deep); color: var(--ivory);
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 60% center; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(100deg, rgba(10, 19, 46, .97) 0%, rgba(10, 19, 46, .94) 34%, rgba(10, 19, 46, .72) 58%, rgba(10, 19, 46, .28) 82%, rgba(10, 19, 46, .1) 100%);
}
html[dir="rtl"] .hero-media::after {
  background:
    linear-gradient(260deg, rgba(10, 19, 46, .97) 0%, rgba(10, 19, 46, .94) 34%, rgba(10, 19, 46, .72) 58%, rgba(10, 19, 46, .28) 82%, rgba(10, 19, 46, .1) 100%);
}
.hero .inner { padding-block: clamp(64px, 9vw, 132px); max-width: 660px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-size: 12px;
  letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--gold-light);
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--gold); }
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 13px; }
.hero h1 {
  font-size: clamp(30px, 4.6vw, 54px); line-height: 1.12; font-weight: 700;
  letter-spacing: -.015em; margin-block: 18px 20px; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--gold-light); }
.hero p.lead {
  font-size: clamp(15px, 1.7vw, 17.5px); color: rgba(244, 241, 233, .92);
  max-width: 480px; text-wrap: pretty; text-shadow: 0 1px 3px rgba(6, 12, 30, .55);
}
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 30px; }
html[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.35; }
html[lang="ar"] .hero p.lead { line-height: 1.95; }

/* ---------- sections ---------- */

.section { padding-block: clamp(56px, 7vw, 96px); }
.section-paper { background: var(--ivory); }
.section-white { background: var(--white); }
.section-navy { background: var(--navy); color: var(--ivory); }
.rule { height: 3px; background: linear-gradient(90deg, var(--gold), rgba(189, 150, 63, .15)); }

.section-head { max-width: 720px; margin-block-end: 44px; }
.section-head h2 {
  font-size: clamp(24px, 3.2vw, 36px); line-height: 1.2; font-weight: 700;
  letter-spacing: -.01em; margin-block: 12px 12px; color: var(--navy);
  text-wrap: balance;
}
.section-head p { color: var(--muted); font-size: 16px; text-wrap: pretty; }
.section-navy .section-head h2 { color: var(--ivory); }
.section-navy .section-head p { color: rgba(244, 241, 233, .78); }
html[lang="ar"] .section-head h2 { letter-spacing: 0; line-height: 1.45; }
html[lang="ar"] .section-head p { line-height: 1.95; }

/* ---------- about ---------- */

.about-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.about-copy p { color: var(--muted); font-size: 16px; margin-block-end: 18px; text-wrap: pretty; }
.about-copy p:first-of-type { color: var(--ink); font-size: 17px; }
.facts { display: grid; gap: 12px; margin-block: 26px 30px; }
.facts li {
  display: flex; align-items: flex-start; gap: 12px; font-size: 15px; color: var(--ink);
}
.facts li::before {
  content: ""; flex: 0 0 auto; width: 9px; height: 9px; margin-block-start: 7px;
  background: var(--gold); transform: rotate(45deg);
}
.about-visual { position: relative; }
.crest-panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: clamp(28px, 4vw, 46px) clamp(22px, 3vw, 38px);
  text-align: center; position: relative;
}
.crest-panel::before {
  content: ""; position: absolute; inset: 12px; border: 1px solid rgba(189, 150, 63, .35);
  border-radius: 8px; pointer-events: none;
}
.crest-panel img.crest { height: clamp(120px, 16vw, 168px); width: auto; margin: 0 auto 22px; }
.crest-panel .name-en {
  font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--navy); line-height: 1.6;
}
.crest-panel .rule-gold { width: 54px; height: 2px; background: var(--gold); margin: 14px auto; }
.crest-panel .name-ar {
  font-family: var(--font-ar); font-size: clamp(16px, 2vw, 19px); color: var(--navy);
  line-height: 1.7; font-weight: 600;
}
.crest-panel .name-line { font-size: 12.5px; color: var(--muted); margin-block-start: 6px; }
html[lang="ar"] .about-copy p { line-height: 1.95; }

/* ---------- programs ---------- */

.program-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.pcard {
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(189, 150, 63, .6); }
.pcard .shot { position: relative; aspect-ratio: 4 / 3; background: var(--navy); overflow: hidden; }
.pcard .shot img { width: 100%; height: 100%; object-fit: cover; }
.pcard .icon-chip {
  position: absolute; inset-block-end: 10px; inset-inline-start: 10px;
  width: 38px; height: 38px; border-radius: 9px; background: var(--ivory);
  border: 1px solid rgba(189, 150, 63, .55); color: var(--navy);
  display: grid; place-items: center;
}
.pcard .icon-chip svg { width: 20px; height: 20px; }
.pcard .body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.pcard h3 { font-size: 16px; line-height: 1.35; color: var(--navy); font-weight: 600; letter-spacing: -.005em; min-height: 2.7em; }
.pcard .ar-name {
  font-family: var(--font-ar); font-size: 12.5px; color: var(--gold);
  margin-block-start: 6px; line-height: 1.6; min-height: 3.2em;
}
html[lang="en"] .pcard .ar-name { text-align: left; }
html[lang="en"] .brand-text .ar,
html[lang="en"] .footer-brand span[lang="ar"] { text-align: left; }
.pcard p { font-size: 13.5px; color: var(--muted); margin-block-start: 10px; flex: 1; }
.pcard .go {
  margin-block-start: 16px; font-size: 13px; font-weight: 600; color: var(--navy);
  display: inline-flex; align-items: center; gap: 6px;
}
.pcard .go::after { content: "\2192"; transition: transform .18s ease; }
html[dir="rtl"] .pcard .go::after { content: "\2190"; }
.pcard:hover .go::after { transform: translateX(3px); }
html[dir="rtl"] .pcard:hover .go::after { transform: translateX(-3px); }
html[lang="ar"] .pcard h3 { line-height: 1.6; }
html[lang="ar"] .pcard p { line-height: 1.85; }

/* ---------- steps ---------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step {
  background: rgba(244, 241, 233, .06); border: 1px solid rgba(189, 150, 63, .3);
  border-radius: var(--radius); padding: 26px 24px 28px;
}
.step .n {
  font-size: 13px; font-weight: 700; color: var(--navy-deep); background: var(--gold);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  margin-block-end: 16px;
}
.step h3 { font-size: 16.5px; color: var(--ivory); font-weight: 600; margin-block-end: 8px; }
.step p { font-size: 14px; color: rgba(244, 241, 233, .75); }
html[lang="ar"] .step p { line-height: 1.9; }
.section-navy .actions { margin-block-start: 34px; }

/* ---------- cta band ---------- */

.cta-band { background: var(--crimson); color: var(--ivory); }
.cta-band .inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; padding-block: clamp(40px, 5vw, 60px); flex-wrap: wrap;
}
.cta-band h2 { font-size: clamp(22px, 2.8vw, 30px); line-height: 1.25; font-weight: 700; text-wrap: balance; }
.cta-band p { color: rgba(244, 241, 233, .88); font-size: 15px; margin-block-start: 8px; max-width: 560px; }
html[lang="ar"] .cta-band h2 { line-height: 1.5; }
html[lang="ar"] .cta-band p { line-height: 1.9; }

/* ---------- footer ---------- */

.site-footer { background: var(--navy-deep); color: rgba(244, 241, 233, .72); padding-block: 46px 30px; }
.footer-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 32px; flex-wrap: wrap; padding-block-end: 26px;
  border-block-end: 1px solid rgba(189, 150, 63, .25);
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand .brand-mark img { height: 46px; }
.footer-brand b { display: block; color: var(--ivory); font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.footer-brand span { display: block; font-size: 12.5px; color: rgba(244, 241, 233, .6); }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { font-size: 13.5px; color: rgba(244, 241, 233, .75); }
.footer-links a:hover { color: var(--gold-light); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-block-start: 18px; font-size: 12.5px;
}
.footer-bottom a { color: rgba(244, 241, 233, .75); border-block-end: 1px solid rgba(189, 150, 63, .5); }
.footer-bottom a:hover { color: var(--gold-light); }

/* ---------- request form ---------- */

.page-head { background: var(--navy); color: var(--ivory); padding-block: clamp(38px, 5vw, 62px); }
.page-head h1 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.2; font-weight: 700; margin-block: 14px 10px; letter-spacing: -.01em; }
.page-head p { color: rgba(244, 241, 233, .82); font-size: 15.5px; max-width: 620px; }
html[lang="ar"] .page-head h1 { letter-spacing: 0; line-height: 1.5; }
html[lang="ar"] .page-head p { line-height: 1.95; }

.form-layout { display: grid; grid-template-columns: 1.35fr .65fr; gap: clamp(26px, 4vw, 48px); align-items: start; }
.formcard {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 3vw, 34px); box-shadow: var(--shadow-sm);
}
.field { margin-block-end: 18px; }
.field:last-of-type { margin-block-end: 0; }
.field label {
  display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--navy); font-weight: 700; margin-block-end: 7px;
}
html[lang="ar"] .field label { font-size: 13px; letter-spacing: 0; text-transform: none; }
.field label .req { color: var(--crimson); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border: 1px solid #c8c0ab; border-radius: 10px;
  font-size: 16px; font-family: var(--font-en); background: var(--ivory); color: var(--ink);
}
.field input::placeholder, .field textarea::placeholder { color: #837c6b; opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid rgba(189, 150, 63, .45); outline-offset: 1px;
  border-color: var(--navy); background: var(--white);
}
.field input[type="tel"], .field input[type="email"] { direction: ltr; text-align: start; }
.hint { font-size: 12.5px; color: var(--muted); margin-block-start: 6px; }
.submit-row { margin-block-start: 26px; }
.submit-row .btn { width: 100%; }
.form-note {
  background: var(--ivory); border-inline-start: 3px solid var(--gold);
  border-radius: 8px; padding: 14px 16px; font-size: 13px; color: var(--muted);
  margin-block-start: 18px;
}
.alert {
  background: #fbeef0; border: 1px solid #d9a3ad; color: #7d1622;
  border-radius: 10px; padding: 13px 15px; font-size: 14px; margin-block-end: 20px;
}
.aside-card {
  background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; position: sticky; inset-block-start: 100px;
}
.aside-card .crest { height: 78px; width: auto; margin-block-end: 16px; }
.aside-card h2 { font-size: 15px; color: var(--navy); margin-block-end: 10px; }
.aside-card p { font-size: 13.5px; color: var(--muted); }
.aside-card .facts { margin-block: 16px 0; }
.aside-card .facts li { font-size: 13.5px; }
html[lang="ar"] .aside-card p, html[lang="ar"] .aside-card .facts li { line-height: 1.9; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px;
  font-weight: 600; color: var(--navy); margin-block-end: 18px;
}
.back-link:hover { color: var(--crimson); }

/* ---------- thanks ---------- */

.thanks-wrap { display: grid; place-items: center; padding-block: clamp(48px, 7vw, 90px); }
.thanks-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(30px, 4vw, 46px); max-width: 560px; width: 100%; text-align: center;
  box-shadow: var(--shadow-md);
}
.thanks-badge {
  width: 68px; height: 68px; border-radius: 50%; background: var(--navy);
  display: grid; place-items: center; margin: 0 auto 20px;
  border: 2px solid var(--gold);
}
.thanks-badge svg { width: 32px; height: 32px; stroke: var(--gold-light); }
.thanks-card h1 { font-size: 25px; color: var(--navy); margin-block-end: 12px; }
.thanks-card p { color: var(--muted); font-size: 15px; }
.ref-chip {
  display: inline-block; background: var(--ivory); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 18px; font-weight: 700; color: var(--navy);
  margin-block: 18px; font-variant-numeric: tabular-nums;
}
html[lang="ar"] .thanks-card h1 { line-height: 1.5; }
html[lang="ar"] .thanks-card p { line-height: 1.95; }

/* ---------- focus / motion ---------- */

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .pcard, .skip-link { transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 1040px) {
  .program-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .site-header .bar { flex-wrap: wrap; justify-content: center; row-gap: 8px; }
  .brand { width: 100%; justify-content: center; }
  .brand-text { text-align: center; }
  .nav { justify-content: center; flex-wrap: wrap; }
  .about-grid, .form-layout { grid-template-columns: 1fr; }
  .about-visual { order: -1; }
  .steps { grid-template-columns: 1fr; }
  .aside-card { position: static; }
  .hero .inner { max-width: none; }
  .hero-media img { object-position: 68% center; }
  .hero-media::after {
    background: linear-gradient(180deg, rgba(10, 19, 46, .9) 0%, rgba(10, 19, 46, .84) 55%, rgba(10, 19, 46, .55) 100%);
  }
}
@media (max-width: 620px) {
  .program-grid { grid-template-columns: 1fr; }
  .brand-mark img { height: 36px; }
  .brand-text .en { font-size: 11px; letter-spacing: .1em; }
  .nav a.nav-link { padding: 8px 10px; font-size: 13px; }
  .btn.header-cta { display: none; }
  .cta-band .inner { flex-direction: column; align-items: flex-start; }
  .shell { padding-inline: 18px; }
}
