/* Tokens taken from adu.ac.ae (navy #0c2340, red #ee2737, Noto Sans, the 0/32px cut corner)
   and campusiq.replit.app (HSL surface/border scale, 4px radius, soft shadows). */
:root {
  --navy: #0c2340;
  --navy-deep: #0d1b35;
  --red: #ee2737;
  --red-dark: #d21c2b;
  --red-tint: #fef0f1;
  --bg: hsl(210 20% 98%);
  --card: #fff;
  --text: hsl(214 68% 15%);
  --muted: hsl(214 20% 42%);
  --border: hsl(214 18% 88%);
  --input: hsl(214 18% 80%);
  --surface: hsl(214 18% 95%);
  --radius: 4px;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .08);
  --shadow-md: 0 4px 8px -2px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .06);
  --font: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
h1, h2, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: var(--navy); color: #fff; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.site-header__logo { display: inline-flex; }
.site-header__logo img { display: block; height: 40px; width: auto; }
.site-header__tag {
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: rgb(255 255 255 / .75); text-align: right;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 36px 0 104px;
  border-top: 1px solid rgb(255 255 255 / .1);
  position: relative;
  overflow: hidden;
}
.hero::after { /* ADU's diagonal logo stroke, as a quiet background mark */
  content: "";
  position: absolute; right: -60px; top: -40px; width: 300px; height: 420px;
  background: var(--red);
  clip-path: polygon(62% 0, 100% 0, 38% 100%, 0 100%);
  opacity: .9;
}
.hero .wrap { position: relative; z-index: 1; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #ff8a93; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); font-weight: 800; line-height: 1.08; letter-spacing: -.01em; margin-top: 10px; max-width: 14ch; }
.hero__lead { margin-top: 16px; max-width: 46ch; font-size: 1.05rem; color: rgb(255 255 255 / .85); }
.hero__facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 24px; }
.hero__facts li { font-weight: 600; }
.hero__facts span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .6); }

/* Main */
.main { flex: 1; margin-top: -64px; padding-bottom: 56px; position: relative; z-index: 2; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border: 1px solid var(--border); border-bottom: 0; border-radius: 0 32px 0 0; overflow: hidden; }
.steps__item { display: flex; align-items: center; gap: 10px; padding: 14px 20px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid var(--border); }
.steps__num { font-family: var(--mono); font-size: 13px; }
.steps__item.is-current { color: var(--navy); border-bottom-color: var(--red); }
.steps__item.is-current .steps__num { color: var(--red); }
.steps__item.is-done { color: var(--navy); border-bottom-color: var(--navy); }

.card { background: var(--card); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 0 32px; box-shadow: var(--shadow-md); padding: 32px; }
.card h2 { font-size: 1.3rem; font-weight: 700; line-height: 1.25; color: var(--navy); }
.card h2:focus { outline: none; }
.hint { font-size: 14px; color: var(--muted); margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.field label, .member label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input, select {
  width: 100%; height: 44px; padding: 0 12px;
  font: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--input); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: hsl(214 15% 62%); }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgb(12 35 64 / .18); }
input[aria-invalid="true"] { border-color: var(--red); }
input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px rgb(238 39 55 / .2); }
.field__error { font-size: 13px; font-weight: 500; color: #c2182a; margin-top: 6px; }
.field__error:empty { display: none; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border); }
.count { flex: none; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius); background: var(--surface); color: var(--muted); }

.members { margin-top: 16px; display: grid; gap: 10px; }
.members:empty { display: none; }
.member { display: grid; grid-template-columns: 1fr 170px auto; gap: 12px; align-items: end; padding: 14px; background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--navy); border-radius: var(--radius); }
.member .field__error { grid-column: 1 / -1; margin-top: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  font: inherit; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn:focus-visible { outline: 3px solid rgb(12 35 64 / .35); outline-offset: 2px; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: #14335c; }
.btn--accent { background: var(--red); color: #fff; }
.btn--accent:hover { background: var(--red-dark); }
.btn--outline { background: #fff; color: var(--navy); border-color: var(--input); }
.btn--outline:hover { border-color: var(--navy); background: var(--bg); }
.btn--ghost { background: transparent; color: var(--muted); padding: 0 12px; }
.btn--ghost:hover { color: #c2182a; background: var(--red-tint); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
#add-member { margin-top: 14px; }

.actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 32px; }
.actions--split { justify-content: space-between; }

/* Review */
.summary { display: grid; grid-template-columns: 1fr auto; gap: 16px; margin-top: 20px; padding: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.summary dt { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.summary dd { font-weight: 600; overflow-wrap: anywhere; }

.attendees { margin-top: 16px; border-top: 2px solid var(--navy); }
.attendee { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.attendee__num { font-family: var(--mono); font-size: 13px; color: var(--red); }
.attendee__name { font-weight: 600; overflow-wrap: anywhere; }
.attendee__role { font-size: 13px; color: var(--muted); }
.attendee__btns { display: flex; gap: 4px; }
.attendee__edit { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr 170px auto; gap: 10px; align-items: start; }
.attendee__edit .field__error { grid-column: 1 / -1; margin-top: 0; }

.alert { margin-top: 20px; padding: 12px 14px; font-size: 14px; font-weight: 500; color: #a01322; background: var(--red-tint); border: 1px solid #f7c2c7; border-left: 3px solid var(--red); border-radius: var(--radius); }

.alert--action { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--text); }
.alert--action p { font-weight: 400; margin-top: 2px; }
.alert--action .btn { flex: none; }
@media (max-width: 640px) { .alert--action { flex-direction: column; align-items: flex-start; } }

/* Done */
.card--done { text-align: center; padding: 48px 32px; }
.card--done > p { max-width: 52ch; margin-left: auto; margin-right: auto; }
.card--done #done-text { margin-top: 10px; font-size: 1.05rem; }
.card--done .hint { margin-top: 14px; }
.print-note { margin-top: 16px; padding: 12px 16px; font-weight: 600; color: var(--navy); background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--red); border-radius: var(--radius); }
.card--done .actions { justify-content: center; }
.done__mark { width: 56px; height: 56px; margin: 0 auto 18px; display: grid; place-items: center; color: #fff; background: var(--navy); border-radius: 0 16px 0 16px; }
.note { margin-top: 18px; padding: 10px 14px; font-size: 13px; text-align: left; background: #fff8e6; border: 1px solid #f0d58a; border-radius: var(--radius); }
.note code { font-family: var(--mono); font-size: 12px; }
strong { font-weight: 700; overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: var(--navy); color: rgb(255 255 255 / .7); font-size: 13px; }
.site-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.site-footer img { display: block; height: 30px; width: auto; }

@media (max-width: 640px) {
  .site-header__inner { height: 60px; }
  .site-header__logo img { height: 32px; }
  .site-header__tag { display: none; }
  .hero { padding: 28px 0 92px; }
  .hero::after { width: 170px; right: -70px; opacity: .55; }
  .card { padding: 22px 18px; }
  .steps__item { padding: 12px 10px; justify-content: center; }
  .steps__label { display: none; }
  .steps__item.is-current .steps__label { display: inline; }
  .grid-2 { grid-template-columns: 1fr; }
  .member, .attendee__edit { grid-template-columns: 1fr; }
  .member .btn, .attendee__edit .btn { justify-self: start; }
  .attendee { grid-template-columns: auto 1fr; }
  .attendee__btns { grid-column: 2; }
  .attendee__edit { grid-column: 1 / -1; }
  .actions { flex-direction: column-reverse; }
  .actions .btn { width: 100%; }
  .site-footer__inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Staff ticket check (/staff) ---------- */
.staff__main { flex: 1; max-width: 520px; padding-top: 20px; padding-bottom: 40px; }
.staff__title { font-size: 1.3rem; font-weight: 700; color: var(--navy); line-height: 1.25; }
.staff__form { margin-top: 18px; display: grid; gap: 16px; }
.card--plain { border-top: 1px solid var(--border); border-radius: 0 32px 0 32px; padding: 24px 20px; }
.btn--block { width: 100%; }
.btn--lg { min-height: 56px; font-size: 17px; }
.btn--onnavy { background: transparent; color: #fff; border-color: rgb(255 255 255 / .4); }
.btn--onnavy:hover { background: rgb(255 255 255 / .12); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 14px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tally > div { background: var(--card); padding: 10px 8px; text-align: center; }
.tally__num { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--navy); font-variant-numeric: tabular-nums; }
.tally__label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

#entry .btn--lg { margin-top: 16px; }
.scanner { position: relative; margin-top: 16px; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner__frame { position: absolute; inset: 16%; border: 3px solid #fff; border-radius: 12px; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .35); }
.scanner__stop { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgb(0 0 0 / .55); }

.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; font-size: 13px; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.code-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.code-form input { height: 52px; font-family: var(--mono); font-size: 18px; letter-spacing: .06em; text-transform: uppercase; }
.code-form .btn { min-height: 52px; }

/* The result fills the screen with one colour so it can be read at arm's length. */
.result { padding: 32px 22px 24px; border-radius: 0 32px 0 32px; color: #fff; text-align: center; }
.result:focus { outline: none; }
.result--ok { background: #15803d; }
.result--already, .result--not_found { background: #c2182a; }
.result--undone { background: var(--navy); }
.result__status { font-size: 2rem; font-weight: 800; line-height: 1.1; text-transform: uppercase; letter-spacing: .02em; }
.result__name { margin-top: 18px; font-size: 1.5rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.result__name:empty { display: none; }
.result__detail { margin-top: 8px; font-size: 1rem; color: rgb(255 255 255 / .92); }
.result__code { margin-top: 14px; font-family: var(--mono); font-size: 1rem; letter-spacing: .08em; color: rgb(255 255 255 / .85); overflow-wrap: anywhere; }
.result__next { margin-top: 26px; background: #fff; color: var(--navy); }
.result__next:hover { background: #f0f1f3; }
.result__undo { margin-top: 14px; padding: 10px; background: none; border: 0; font: inherit; font-size: 14px; color: #fff; text-decoration: underline; cursor: pointer; }
