:root {
  --violet: #3c2066;
  --violet-deep: #24143d;
  --violet-soft: #5c418c;
  --ink: #1c1428;
  --muted: #65597a;
  --cream: #f3ecdf;
  --paper: #fffdf8;
  --gold: #c6a15a;
  --gold-bright: #e7d3a1;
  --red: #d3202e;
  --red-deep: #a81824;
  --line: rgba(36, 20, 61, 0.12);
  --teal: #1f8f86;
  --ok: #1d7a46;
  --warn: #9a6412;
  --shadow: 0 24px 60px rgba(36, 20, 61, 0.16);
  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Tajawal", "Geeza Pro", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(198, 161, 90, 0.16), transparent 28%),
    linear-gradient(180deg, #f7f2e8 0%, var(--cream) 40%, #efe4d2 100%);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; }
button, input, select { font: inherit; }
a { color: var(--violet); }

html[lang="en"] .lang-ar { display: none !important; }
html[lang="ar"] .lang-en { display: none !important; }

.brandbar {
  width: min(1040px, calc(100% - 32px));
  margin: 20px auto 0;
  direction: ltr;
  background: #fff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 18px 28px;
  box-shadow: 0 8px 24px rgba(36, 20, 61, 0.06);
}
.brandbar img { width: auto; display: block; }
.brandbar .uaeu { height: 72px; }
.brandbar .fair { height: 78px; }

.when {
  width: min(1040px, calc(100% - 32px));
  margin: 18px auto 0;
  text-align: center;
}
.when-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--violet);
}
.when-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 16px;
}
.lang-switch {
  display: inline-flex;
  margin-top: 14px;
  background: white;
  border: 1px solid rgba(60, 32, 102, 0.12);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--violet);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 700;
}
.lang-switch button.is-on {
  background: var(--violet);
  color: white;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  background: white;
  border: 1px solid rgba(60, 32, 102, 0.12);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  color: var(--violet);
}
.venue {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.sheet {
  width: min(760px, calc(100% - 32px));
  margin: 18px auto 40px;
  position: relative;
  z-index: 2;
}

.ticket {
  background: var(--paper);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(60, 32, 102, 0.08);
}

.ticket-main { padding: 28px 28px 24px; }
.ticket-main h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
}
.ticket-main h2 small {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  color: var(--muted);
  margin-top: 2px;
}
.lede { color: var(--muted); margin: 8px 0 18px; }

.alert {
  background: #fff4f4;
  border: 1px solid #f0c2c6;
  color: #8d1c28;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.alert ul { margin: 0; padding-inline-start: 18px; }
.note {
  background: #f4fbf6;
  border: 1px solid #cfe6d6;
  color: #1d5c36;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.note.warn {
  background: #fff8ec;
  border-color: #ead7b0;
  color: #6d4b12;
}

.types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.type-card {
  position: relative;
  display: block;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 14px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.type-card:hover { transform: translateY(-1px); }
.type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.type-card strong { display: block; font-size: 18px; }
.type-card em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}
.type-card:has(input:checked),
.type-card.is-on {
  border-color: var(--violet);
  box-shadow: inset 0 0 0 1px var(--violet);
  background: linear-gradient(180deg, #fff, #f7f2ff);
}
.type-card:has(input:focus-visible) { outline: 2px solid var(--gold); }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label .lang-en,
.field label .lang-ar {
  display: block;
  font-weight: 700;
}
.req { color: var(--red); }
input[type="text"], input[type="email"], input[type="tel"], select {
  width: 100%;
  border: 1.5px solid #e4d9c8;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus {
  border-color: var(--violet-soft);
  box-shadow: 0 0 0 4px rgba(92, 65, 140, 0.12);
}
.phone,
.ltr-value,
.pass-code,
.contact,
.num {
  direction: ltr;
  unicode-bidi: isolate;
}
.phone {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
}
.dial {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f6f0e6;
  color: var(--violet);
  font-weight: 700;
  border: 1.5px solid #e4d9c8;
}
.only-student, .only-faculty { display: none; }
form.is-student .only-student.field,
form.is-faculty .only-faculty.field,
form:has(input[value="Student/Graduate"]:checked) .only-student.field,
form:has(input[value="Faculty/Staff"]:checked) .only-faculty.field { display: flex; }
.honeypot { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.actions { margin-top: 8px; }
.submit {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  background: var(--red);
  color: white;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.01em;
}
.submit:hover { background: var(--red-deep); }
.submit:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px }
.legal {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.pass-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pass-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.14em;
  font-size: 13px;
  color: var(--muted);
}
.qr-wrap {
  margin: 18px auto 8px;
  background: white;
  border: 1px solid #eadfcd;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  width: fit-content;
  max-width: 100%;
}
.qr-wrap img.qr { width: 220px; height: 220px; }
.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 14px 0 0;
  padding: 0;
}
.meta div { border-top: 1px solid var(--line); padding-top: 8px; }
.meta dt { color: var(--muted); font-size: 13px; }
.meta dd { margin: 2px 0 0; font-weight: 700; }
.print-btn, .text-btn {
  display: inline-block;
  margin-top: 14px;
  background: transparent;
  color: var(--violet);
  border: 1.5px solid var(--violet);
  border-radius: 999px;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.foot {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto 36px;
  text-align: center;
}
.partners {
  background: white;
  border-radius: 16px;
  padding: 14px 18px 10px;
  box-shadow: 0 8px 24px rgba(36, 20, 61, 0.06);
}
.partners p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.partners .lang-en {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}
.partners img { width: min(680px, 100%); }
.contact {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}
.contact a { color: inherit; }

.desk { background: #f6f1e8; min-height: 100vh; }
.desk-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0;
}
.desk-nav nav { display: flex; flex-wrap: wrap; gap: 8px; }
.desk-nav a, .desk-nav button {
  color: var(--violet);
  text-decoration: none;
  font-weight: 700;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
}
.desk-wrap { width: min(1100px, calc(100% - 28px)); margin: 0 auto 40px; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat {
  background: white;
  border-radius: 16px;
  padding: 16px;
  border-top: 4px solid var(--violet);
}
.stat b { display: block; font-family: var(--serif); font-size: 32px; font-weight: 560; }
.stat span { color: var(--muted); font-size: 13px; }
.panel {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
}
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 72px 1fr 36px; gap: 8px; align-items: center; font-size: 13px; }
.bar { height: 8px; background: #f0e7da; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--teal)); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters input, .filters select { width: auto; }
.pill {
  display: inline-block;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 12px;
  background: #efe8f8;
}
.pill.on { background: #e5f6ea; color: var(--ok); }

.gate { background: #1a102c; color: white; min-height: 100vh; }
.gate a { color: var(--gold-bright); }
.gate-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
}
.scan-box, .gate-card {
  width: min(520px, calc(100% - 24px));
  margin: 0 auto 24px;
  background: white;
  color: var(--ink);
  border-radius: 18px;
  padding: 16px;
}
.scan-input {
  width: 100%;
  font-size: 22px;
  text-align: center;
  letter-spacing: 0.08em;
  border-radius: 12px;
  border: 2px solid var(--violet);
  padding: 14px;
}
.result { text-align: center; padding: 8px 8px 4px; }
.result h2 { margin: 8px 0 4px; font-size: 28px; }
.result.ok h2 { color: var(--ok); }
.result.dup h2 { color: var(--warn); }
.result.bad h2 { color: var(--red); }
.login-card {
  width: min(420px, calc(100% - 32px));
  margin: 10vh auto;
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

@media (max-width: 800px) {
  .brandbar { flex-direction: column; align-items: center; gap: 16px; padding: 16px; }
  .brandbar .uaeu, .brandbar .fair { height: 58px; }
  .types, .grid, .meta, .stats { grid-template-columns: 1fr; }
  .ticket-main { padding: 22px 16px 18px; }
  .pass-head { flex-direction: column; }
  table.data { display: block; overflow-x: auto; }
}

@media print {
  body { background: white; }
  .brandbar, .when, .foot, .print-btn { display: none !important; }
  .sheet { width: 100%; margin: 0; }
  .ticket { box-shadow: none; display: block; }
}
