/* =========================================================
   IGEC Global — Modern Minimal Redesign
   ========================================================= */

:root {
  /* Brand colors sampled from the real IGEC logo & site (logo orange + charcoal wordmark,
     plus the purple/pink/orange gradient used across the original site's buttons). */
  --color-bg: #ffffff;
  --color-bg-alt: #f8f7f5;
  --color-text: #262323;
  --color-text-muted: #6b6462;
  --color-border: #ece7e2;
  --color-primary: #f7941d;       /* IGEC logo orange */
  --color-primary-dark: #d97b0a;
  --color-primary-light: #fef1de;
  --color-charcoal: #4d4846;      /* logo wordmark gray */
  --color-accent: #8d0b93;        /* magenta-purple from brand gradient */
  --color-accent-2: #ff0066;      /* pink from brand gradient */
  --color-accent-3: #321575;      /* deep purple from brand gradient */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.12);
  --font-ar: 'Tajawal', 'Segoe UI', sans-serif;
  --font-en: 'Inter', 'Segoe UI', sans-serif;
  --container: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ar);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[lang="en"] body { font-family: var(--font-en); }

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--color-text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(120deg, var(--color-accent-3) 0%, var(--color-accent) 55%, var(--color-accent-2) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: var(--shadow-md); }

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-lg { padding: 15px 30px; font-size: 16px; border-radius: var(--radius-sm); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.logo-img { height: 46px; width: auto; display: block; }
.footer-logo {
  background: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: inline-flex;
}
.footer-logo .logo-img { height: 36px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text-muted);
  transition: color .15s ease;
}
.main-nav a:hover { color: var(--color-primary); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.lang-toggle {
  border: 1.5px solid var(--color-border);
  background: #fff;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.lang-toggle:hover { border-color: var(--color-primary); color: var(--color-primary); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 80px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 12% -8%, var(--color-primary-light), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, rgba(141, 11, 147, 0.08), transparent 60%),
    var(--color-bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 48px;
  align-items: start;
}

.eyebrow {
  display: inline-block;
  color: var(--color-primary);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(34px, 4.4vw, 54px);
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 17px;
  max-width: 46ch;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 28px 0 28px; }

.hero-highlights {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.hero-highlight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}
.hero-highlight .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

.hero-stats {
  display: flex;
  gap: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 26px; font-weight: 900; color: var(--color-text); }
.hero-stats span { font-size: 13px; color: var(--color-text-muted); font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--color-bg-alt); }

.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); }
.section-sub { font-size: 16px; }

/* ---------- Events ---------- */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}

.event-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: box-shadow .2s ease, transform .2s ease;
  /* Flex column so the "Register" link always sits at the same spot at the
     bottom of the card, no matter how much venue/address text a given city
     has above it (see .event-body / .event-link below). */
  display: flex;
  flex-direction: column;
}
.event-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.event-date { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.event-day {
  font-size: 30px;
  font-weight: 900;
  color: var(--color-primary);
}
.event-month { font-size: 13px; color: var(--color-text-muted); font-weight: 600; }

.event-city { font-size: 20px; margin-bottom: 6px; }

/* Grows to fill available space so every card's footer link lines up,
   and safely wraps/clamps very long hotel addresses instead of breaking
   the card's width or pushing neighbouring cards out of alignment. */
.event-body { flex: 1 0 auto; margin-bottom: 18px; }

.event-venue-name {
  font-size: 14px;
  margin-bottom: 2px;
  color: var(--color-text);
  font-weight: 700;
}

/* The full street address can run long (street, district, postal code,
   country) — clamp it to 3 lines with an ellipsis and expose the full text
   via the title tooltip, so one city's long address never stretches a card
   taller than its neighbours or pushes the "Register" link out of line. */
.event-venue {
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--color-text-muted);
  font-weight: 500;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-time { font-size: 13px; margin-bottom: 0; }

.event-link {
  display: inline-block;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-primary);
  border-bottom: 2px solid transparent;
  transition: border-color .15s ease;
  margin-top: auto;
  align-self: flex-start;
}
html[dir="rtl"] .event-link { align-self: flex-end; }
.event-link:hover { border-color: var(--color-primary); }

/* ---------- Universities ---------- */
.countries-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}
.country-tab {
  border: 1.5px solid var(--color-border);
  background: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all .15s ease;
}
.country-tab:hover { border-color: var(--color-primary); color: var(--color-primary); }
.country-tab.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.country-panel { display: none; }
.country-panel.is-active { display: block; animation: fadeIn .25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.uni-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.uni-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
  font-size: 15px;
  background: #fff;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
}

.uni-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.uni-card p { margin: 0; font-weight: 700; color: var(--color-text); font-size: 14.5px; }

.uni-badge {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}

.uni-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.uni-logo img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

/* ---------- Event Experience ---------- */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.experience-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.experience-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.experience-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.experience-card h3 { font-size: 17px; margin-bottom: 8px; }
.experience-card p { font-size: 14.5px; margin-bottom: 0; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 130px;
  gap: 14px;
}
.gallery-item {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  transition: transform .3s ease;
}
.gallery-item:hover { transform: scale(1.03); }
.gallery-item-lg {
  grid-column: span 2;
  grid-row: span 2;
}

@media (max-width: 720px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 110px; }
  .gallery-item-lg { grid-column: span 2; grid-row: span 1; }
}

/* ---------- Registration ---------- */
.register-section { background: var(--color-bg-alt); }

.register-top {
  padding-top: 48px;
  padding-bottom: 56px;
  background:
    radial-gradient(800px 360px at 100% -20%, var(--color-primary-light), transparent 60%),
    var(--color-bg-alt);
}

.register-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.register-points { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.register-points li {
  position: relative;
  padding-inline-start: 28px;
  font-weight: 600;
  color: var(--color-text);
  font-size: 15px;
}
.register-points li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  color: var(--color-accent);
  font-weight: 900;
}

.hero-form-wrap { position: relative; z-index: 1; }

.register-form {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.register-form > .eyebrow { margin-bottom: 4px; }
.register-form-title {
  font-size: 20px;
  margin-bottom: 10px;
}

.form-row { margin-bottom: 8px; }
.form-row label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--color-text);
}
.form-row input,
.form-row select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Phone numbers are always displayed/typed left-to-right, even on the Arabic
   (RTL) page, so the intl-tel-input widget is force-wrapped in a dir="ltr"
   container. This keeps the flag/dial-code prefix and caret behaving
   correctly regardless of the page's overall text direction. */
.phone-input-wrap { direction: ltr; }
.phone-input-wrap .iti { width: 100%; display: block; }
.phone-input-wrap input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.phone-input-wrap input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.phone-input-wrap .iti__selected-flag { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

.field-error {
  display: block;
  color: #d92d20;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 2px;
  min-height: 0;
}
.field-error:empty { margin-top: 0; }

.form-status {
  margin: 16px 0 0;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
}
.form-status.success { color: #067647; }
.form-status.error { color: #d92d20; }

/* ---------- Footer ---------- */
.site-footer {
  background: #0c1526;
  color: #cbd3e1;
  padding: 64px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-footer .logo { color: #fff; }
.site-footer p { color: #97a1b5; font-size: 14.5px; margin-top: 14px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.site-footer ul { display: flex; flex-direction: column; gap: 10px; }
.site-footer a { color: #b7c0d3; font-size: 14.5px; transition: color .15s ease; }
.site-footer a:hover { color: #fff; }
.contact-list li { display: flex; align-items: center; gap: 8px; }

.footer-bottom {
  padding: 22px 0;
  text-align: center;
  font-size: 13px;
  color: #6b7488;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .register-grid { grid-template-columns: 1fr; }
  .main-nav {
    display: none;
    position: absolute;
    top: 76px;
    inset-inline: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 16px;
    box-shadow: var(--shadow-md);
  }
  .main-nav.is-open { display: flex; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero { padding: 64px 0 56px; }
  .section { padding: 60px 0; }
  .hero-stats { flex-wrap: wrap; gap: 24px; }
  .form-row-split { grid-template-columns: 1fr; gap: 0; }
}
