@font-face {
  font-family: 'Villeroy Boch';
  src: url('../fonts/VilleroyBoch-Bold.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Brandon Grotesque';
  src: url('../fonts/BrandonGrotesque-MediumItalic.otf') format('opentype');
  font-weight: 500; font-style: italic; font-display: swap;
}
/* Only the medium italic cut was supplied, so map normal-style text to it too. */
@font-face {
  font-family: 'Brandon Grotesque';
  src: url('../fonts/BrandonGrotesque-MediumItalic.otf') format('opentype');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --bg: #07051a;
  /* White for titles and key text, a scale of cool grays for everything around it. */
  --ink: #ffffff;
  --ink-soft: #d3d3db;          /* body text */
  --ink-faint: #9e9eac;         /* labels, meta, hints */
  --silver: linear-gradient(180deg, #dcdce3 0%, #a7a7b3 100%);  /* buttons */
  --silver-solid: #c4c4ce;      /* selected borders, checks */
  --on-light: #22222b;          /* text on silver */
  --glass: rgba(18, 14, 40, 0.6);
  --glass-line: rgba(196, 196, 210, 0.26);
  --field: rgba(210, 210, 225, 0.08);
  --field-line: rgba(196, 196, 210, 0.3);
  --error: #ffb0b0;
  --radius: 22px;
  --font-display: 'Villeroy Boch', 'Times New Roman', serif;
  --font-body: 'Brandon Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-glyph: 'Noto Sans Symbols', 'Segoe UI Symbol', 'Apple Symbols', sans-serif;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* Arabic: Tajawal everywhere, and no letter-spacing / uppercase (they break Arabic letter joining). */
html[dir="rtl"] {
  --font-display: 'Tajawal', sans-serif;
  --font-body: 'Tajawal', sans-serif;
}
html[dir="rtl"] body * { letter-spacing: 0 !important; text-transform: none !important; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}

input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- Background ---------- */
/* The loop's first frame, shown until the loop video plays (and if it can't). */
.bg-image {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: #07051a url('../assets/video/background.jpg') center / cover no-repeat;
}
.bg-video { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-video video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.2s ease;
}
#bg-loop.playing { opacity: 1; }

/* ---------- Screens ---------- */
#app { position: fixed; inset: 0; z-index: 2; }
.screen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: max(84px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  visibility: hidden; pointer-events: none;
}
.screen.active {
  visibility: visible; pointer-events: auto;
}

/* ---------- Shared type / buttons ---------- */
/* The submit button: an outlined glass pill. */
.orb-btn {
  position: relative; display: block; flex: none; background: none; border: 0; padding: 0;
  border-radius: 999px;
}
.orb-btn:active .orb { transform: scale(.95); }
.orb-btn:disabled { opacity: .5; }
.orb {
  position: relative; border-radius: 999px; padding: 20px 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .22), rgba(196, 196, 210, .08) 55%, rgba(18, 14, 40, .35) 75%);
  border: 1.5px solid rgba(220, 220, 232, .7);
  box-shadow: 0 0 60px rgba(255, 255, 255, .18), inset 0 0 50px rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform .2s ease;
}
.orb-en {
  font-family: 'Villeroy Boch', serif; font-weight: 700; font-size: var(--orb-en, 24px); line-height: 1.15;
  color: var(--ink); text-shadow: 0 0 20px rgba(255, 255, 255, .4);
  letter-spacing: 0 !important; text-transform: none !important;
}
.orb-ar { font-family: 'Tajawal', sans-serif; font-size: var(--orb-ar, 20px); font-weight: 500; color: var(--ink-soft); }

.eyebrow {
  margin: 0 0 10px; color: var(--ink-faint); font-size: 15px;
  letter-spacing: 1px; text-transform: uppercase;
}
.splash-title, .form-title, .picker-title {
  font-family: var(--font-display); font-weight: 700; margin: 0; color: var(--ink);
  text-shadow: 0 0 28px rgba(255, 255, 255, .28), 0 2px 12px rgba(0, 0, 0, .55);
}
.btn-primary {
  border: 0; border-radius: 999px;
  background: var(--silver);
  color: var(--on-light); font-weight: 600; letter-spacing: .06em;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(0, 0, 0, .12);
  transition: transform .15s ease, opacity .2s ease, box-shadow .2s ease;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .4; box-shadow: none; }
.btn-xl { padding: 22px 56px; font-size: 22px; text-transform: uppercase; }
.btn-block { width: 100%; padding: 20px; font-size: 20px; text-transform: uppercase; margin-top: 8px; }
.submit-btn { margin: 18px auto 14px; --orb-en: 22px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--glass-line); border-radius: 999px;
  padding: 14px 40px; font-size: 18px; color: var(--ink-soft);
}
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.glyph { font-family: var(--font-glyph); line-height: 1; color: var(--ink); }

/* ---------- Form ---------- */
#screen-form { overflow-y: auto; overflow-x: hidden; align-items: center; }
/* No card: the fields float on the video. A soft dark halo keeps the text readable. */
.form-card { position: relative; width: min(680px, 100%); padding: 20px 8px; margin: auto; }
.form-card::before {
  content: ''; position: absolute; inset: -12% -18%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(7, 5, 26, .72), rgba(7, 5, 26, .4) 60%, transparent);
}

/* Marketing consent: optional checkbox above the submit button */
.consent { display: flex; align-items: center; gap: 14px; margin: 2px 0 22px; cursor: pointer; }
.consent input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.consent-box {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--field); border: 1px solid var(--field-line);
  transition: background .2s, border-color .2s;
}
.consent-box svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .15s; }
.consent input:checked + .consent-box { border: 1.5px solid rgba(220, 220, 232, .7); box-shadow: 0 0 14px rgba(255, 255, 255, .18); }
.consent input:checked + .consent-box svg { filter: drop-shadow(0 0 4px rgba(255, 255, 255, .5)); }
.consent input:checked + .consent-box svg { opacity: 1; }
.consent input:focus-visible + .consent-box { box-shadow: 0 0 0 4px rgba(196, 196, 210, .25); }
.consent-text { font-size: 17px; color: var(--ink-soft); line-height: 1.4; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }

.form-title { font-size: 42px; line-height: 1.15; text-align: center; }
.form-intro { text-align: center; color: var(--ink-soft); margin: 12px auto 0; max-width: 560px; font-size: 18px; line-height: 1.45; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.form-sub { text-align: center; color: var(--ink-faint); margin: 14px 0 28px; font-size: 15px; }
.req { color: var(--ink-soft); }
.row { display: grid; gap: 16px; }
.row.two { grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1.4fr 1.3fr; gap: 12px; }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 15px; letter-spacing: .04em; color: var(--ink-faint); margin-bottom: 8px; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.field input, .field select {
  width: 100%; height: 60px; padding: 0 18px;
  font: 500 20px var(--font-body); color: var(--ink);
  background: var(--field); border: 1px solid var(--field-line); border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  outline: none; transition: border-color .2s, background .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: rgba(255, 255, 255, .4); }
.field select {
  padding-right: 44px;
  background-image: var(--chevron);
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
}
.field select option { background: #1b1440; color: var(--ink); }
.field input:focus, .field select:focus {
  border-color: var(--silver-solid); background-color: rgba(210, 210, 225, .13);
  box-shadow: 0 0 0 4px rgba(196, 196, 210, .14);
}
.field input.invalid, .field select.invalid { border-color: var(--error); }
.phone { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.country-btn {
  height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 36px 0 16px;
  font: 500 20px var(--font-body); color: var(--ink); direction: ltr;
  background: var(--field) var(--chevron) no-repeat right 12px center / 18px;
  border: 1px solid var(--field-line); border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.flag { width: 30px; height: 22px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); flex: none; }
.err { display: block; min-height: 18px; margin-top: 6px; color: var(--error); font-size: 14px; }

html[dir="rtl"] .field select { padding: 0 18px 0 44px; background-position: left 14px center; }
html[dir="rtl"] .field input[name="mobile"] { text-align: right; }

/* ---------- Modals ---------- */
.modal {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(4, 2, 16, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }

.circle-btn {
  position: absolute; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(255, 255, 255, .6);
  transition: transform .15s ease, background .2s;
}
.circle-btn:active { transform: scale(.92); background: rgba(255, 255, 255, .18); }
.circle-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.close-btn { top: 18px; right: 18px; }
html[dir="rtl"] .close-btn { right: auto; left: 18px; }

/* ---------- Country picker ---------- */
.picker-title { font-size: 30px; margin: 0 50px 22px; text-align: center; }
.country-picker {
  position: relative; width: min(620px, 100%); height: min(760px, 88vh);
  padding: 40px 28px 24px; display: flex; flex-direction: column;
}
.country-search {
  width: 100%; height: 56px; padding: 0 18px; margin-bottom: 14px; flex: none;
  font: 500 19px var(--font-body); color: var(--ink);
  background: var(--field); border: 1px solid var(--field-line); border-radius: 14px; outline: none;
}
.country-search::placeholder { color: rgba(255, 255, 255, .45); }
.country-search:focus { border-color: var(--silver-solid); }
.country-list { overflow-y: auto; flex: 1; margin: 0 -8px; padding: 0 8px; -webkit-overflow-scrolling: touch; }
.country-list button {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 12px;
  background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .07);
  font-size: 19px; text-align: start; border-radius: 10px;
}
.country-list button:active, .country-list button.current { background: rgba(255, 255, 255, .12); }
.country-list .name { flex: 1; }
.country-list .code { color: var(--ink-faint); direction: ltr; }
.country-list .divider { height: 1px; background: var(--glass-line); margin: 8px 0; }
.country-list .empty { color: var(--ink-faint); text-align: center; padding: 30px; }

/* ---------- Thanks ---------- */
.thanks { text-align: center; max-width: 760px; }
.splash-title { font-size: clamp(44px, 7vw, 84px); line-height: 1.1; margin-bottom: 20px; }
.splash-sub { font-size: clamp(18px, 2.2vw, 24px); color: var(--ink-faint); margin: 0 0 44px; }
.thanks .splash-title + .splash-title { font-family: 'Tajawal', sans-serif; font-size: clamp(36px, 5.5vw, 64px); }

/* ---------- Responsive (portrait tablet / phones) ---------- */
@media (max-width: 600px) {
  .row.two { grid-template-columns: 1fr; gap: 0; }
  .row.three { grid-template-columns: 1fr 1.3fr; }
  .row.three select:last-child { grid-column: 1 / -1; }
  .phone { grid-template-columns: 130px 1fr; }
  .country-btn { font-size: 18px; padding-left: 12px; gap: 8px; }
  .btn-xl { padding: 18px 36px; font-size: 18px; }
}

