/* GHT-VPN portal.
   The one loud element is the enrolment ticket: a till receipt carrying the
   code to compare. Everything else stays plain so that it stands out. */

:root {
  --counter: #e6eaf0;   /* the shop counter: page background */
  --paper: #ffffff;
  --ink: #1b2a4a;       /* ballpoint navy */
  --ink-soft: #55627a;
  --rule: #cdd4df;
  --stamp: #2742c9;     /* the "accepted" stamp: primary actions, links */
  --online: #18794a;
  --pending: #9a5b00;
  --danger: #b3261e;

  --ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --receipt: "Cascadia Mono", Consolas, "DejaVu Sans Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  background: var(--counter);
  color: var(--ink);
  font: 1rem/1.5 var(--ui);
}

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 650; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.125rem; line-height: 1.3; font-weight: 650; margin: 0 0 .75rem; }
p { margin: 0 0 1rem; max-width: 65ch; }
section { margin-top: 2.5rem; }
section:first-child { margin-top: 0; }

a { color: var(--stamp); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; border-radius: 2px; }

.lead, .hint { color: var(--ink-soft); }
.hint { font-size: .9375rem; margin-bottom: .75rem; }
.mono { font-family: var(--receipt); font-size: .9375em; }
.wrap { overflow-wrap: anywhere; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- top bar ---- */

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 2rem;
  padding: .75rem 1.5rem;
  background: var(--ink);
  color: #fff;
}
.bar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; letter-spacing: .02em; }
.bar nav { display: flex; gap: 1.5rem; flex: 1; }
.bar nav a { padding: .25rem 0; border-bottom: 2px solid transparent; opacity: .8; }
.bar nav a:hover { opacity: 1; }
.bar nav a[aria-current] { border-bottom-color: #fff; opacity: 1; }
.bar :focus-visible { outline-color: #fff; }
.session { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin: 0; min-width: 0; }
.who { opacity: .8; font-size: .9375rem; overflow-wrap: anywhere; }

/* ---- messages ---- */

.notice {
  max-width: none;
  padding: .75rem 1rem;
  margin-bottom: 1.5rem;
  background: var(--paper);
  border-left: 4px solid var(--online);
}
.notice.problem { border-left-color: var(--danger); }

/* ---- forms and buttons ---- */

label { display: block; font-size: .9375rem; font-weight: 600; }
input {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .5rem .625rem;
  border: 1px solid #8793a8;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
.stack { display: grid; gap: .875rem; max-width: 22rem; }

button {
  font: inherit;
  font-weight: 600;
  padding: .5rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
button:hover { background: #f1f4f9; }
button.primary { background: var(--stamp); border-color: var(--stamp); color: #fff; }
button.primary:hover { background: #1c33a6; border-color: #1c33a6; }
button.danger { border-color: var(--danger); color: var(--danger); }
button.danger:hover { background: #fbeceb; }
button.quiet { border: 0; padding: .25rem 0; background: none; text-decoration: underline; text-underline-offset: .15em; font-weight: 400; }
.bar button.quiet { color: #fff; }
.bar button.quiet:hover { background: none; text-decoration-thickness: 2px; }

a.open {
  margin-left: auto;
  padding: .5rem 1rem;
  border-radius: 4px;
  background: var(--stamp);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
a.open:hover { background: #1c33a6; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- login ---- */

body[data-page="login"] main { max-width: 26rem; padding-top: 12vh; }
.door h1 { font-size: 2.25rem; }
.door .stack { margin-top: 1.5rem; max-width: none; }

/* ---- enrolment tickets ---- */

.tickets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 19rem));
  gap: 2rem 1.5rem;
  margin-top: 1.5rem;
  align-items: start;
}

.ticket {
  position: relative;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--paper);
  /* the shadow follows the torn edge drawn below */
  filter: drop-shadow(0 2px 3px rgba(27, 42, 74, .22));
}
.ticket::after {            /* torn bottom edge of the receipt */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: 9px;
  background:
    linear-gradient(135deg, var(--paper) 50%, transparent 50%),
    linear-gradient(225deg, var(--paper) 50%, transparent 50%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 0;
  background-repeat: repeat-x;
}

.ticket .code {
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px dashed var(--rule);
  font: 700 1.875rem/1.1 var(--receipt);
  letter-spacing: .08em;
  white-space: nowrap;
}
.ticket dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .25rem 1rem;
  margin: 0 0 1.25rem;
  font: .875rem/1.5 var(--receipt);
}
.ticket dt { color: var(--ink-soft); }
.ticket dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.ticket .stack { max-width: none; }
.ticket .primary { width: 100%; }
.ticket form + form { margin-top: .75rem; text-align: center; }

/* ---- list ---- */

.heading { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-bottom: 1rem; }
.heading h1, .heading h2 { margin: 0; }
.tally { margin: 0; color: var(--ink-soft); font-size: .9375rem; }
.tally .dot { margin-left: .75rem; }
.tally .dot:first-child { margin-left: 0; }
#filter { width: 18rem; max-width: 100%; margin: 0 0 0 auto; }

/* position: the visually hidden header label must stay inside the scroller */
.scroll { position: relative; overflow-x: auto; background: var(--paper); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { padding: .625rem 1rem; text-align: left; white-space: nowrap; }
th { font-weight: 600; color: var(--ink-soft); border-bottom: 1px solid var(--rule); }
td { border-bottom: 1px solid #e9edf3; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f6f8fb; }
th.num { text-align: right; }

.dot {
  display: inline-block;
  width: .625rem; height: .625rem;
  margin-right: .5rem;
  border-radius: 50%;
  background: #9aa4b5;
}
.dot.online { background: var(--online); }
.dot.pending { background: var(--pending); }
.dot.revoked { background: none; box-shadow: inset 0 0 0 2px var(--danger); }
.state { white-space: nowrap; }
.state.online { color: var(--online); font-weight: 600; }
.state.pending { color: var(--pending); font-weight: 600; }
.state.revoked { color: var(--danger); }
.state.offline { color: var(--ink-soft); }

.empty { padding: 1.5rem; background: var(--paper); border-radius: 4px; color: var(--ink-soft); max-width: none; }

/* ---- machine page ---- */

.crumb { margin-bottom: .5rem; font-size: .9375rem; }
.columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2.5rem; margin-top: 2rem; }
.columns > div > section:first-child { margin-top: 0; }
.columns section { margin-top: 2.5rem; }
.columns > section { margin-top: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 0; padding: 1.25rem; background: var(--paper); border-radius: 4px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; }
form + .hint { margin-top: 1.25rem; }

@media (max-width: 48rem) {
  main { padding: 1.5rem 1rem 3rem; }
  .bar { padding: .75rem 1rem; }
  .columns { grid-template-columns: 1fr; }
  .tickets { grid-template-columns: 1fr; }
  #filter { width: 100%; margin-left: 0; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: .625rem; }
}
