@font-face { font-family: 'Open Sans'; font-weight: 400; font-display: swap; src: url(/assets/fonts/open-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 600; font-display: swap; src: url(/assets/fonts/open-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 700; font-display: swap; src: url(/assets/fonts/open-sans-latin-700-normal.woff2) format('woff2'); }

:root {
  --page: #eceef1;
  --paper: #ffffff;
  --ink: #1f1f1f;
  --text: #4a4a4a;
  --rule: #dcdcdc;
  --band: #f5f5f5;
  --red: #c8161d;
  --link: #2f6fd6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--page);
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  line-height: 1.5;
}

.card {
  width: 100%;
  max-width: 520px;
  background: var(--paper);
  border: 1px solid var(--rule);
}

.card-narrow { max-width: 420px; }

.userbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 8px 32px;
  border-bottom: 1px solid var(--rule);
  background: var(--band);
  font-size: 0.85rem;
}
.userbar span { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.field { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.field input {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid #b9b9b9;
  background: #fff;
  color: var(--ink);
}
.field input:focus { outline: 2px solid var(--link); outline-offset: 1px; border-color: var(--ink); }

.history { padding: 0 32px 24px; }
.history h2 { margin: 0 0 8px; font-size: 0.95rem; color: var(--ink); }
.history ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.history li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 0.85rem;
}
.history .name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .meta { flex-shrink: 0; text-align: right; }
.history .failed { color: var(--red); }

.card-head {
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.card-head h1 { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.card-head p { margin: 8px 0 0; font-size: 0.9rem; font-style: italic; color: #7a7a7a; }

.card-body { padding: 28px 32px; display: grid; gap: 18px; }

.drops { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .drops { grid-template-columns: 1fr; } }

.drop-step {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin-bottom: 4px;
  border: 1.5px solid var(--ink); border-radius: 50%;
  font-size: 0.75rem; font-weight: 700; color: var(--ink);
}
.drop.has-file .drop-step { background: var(--ink); color: #fff; }

.card-foot code { font-size: 0.78rem; background: var(--band); padding: 1px 4px; }

.drop {
  position: relative;
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 22px 12px;
  border: 1.5px dashed #b9b9b9;
  background: var(--band);
  cursor: pointer;
  text-align: center;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
.drop.dragging { border-color: var(--ink); background: #ececec; }
.drop.has-file { border-style: solid; border-color: var(--ink); }
.drop-title { font-weight: 600; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-hint { font-size: 0.85rem; }

button, .download {
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
button:disabled { background: #bdbdbd; border-color: #bdbdbd; cursor: not-allowed; }
button:focus-visible, .download:focus-visible, a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Progress drawn as a barcode that fills in, echoing the admit card header */
.progress p { margin: 10px 0 0; font-weight: 600; color: var(--ink); text-align: center; }
.bars { display: flex; align-items: stretch; gap: 3px; height: 42px; }
.bars span { flex: 1; background: #e3e3e3; transition: background-color 0.2s; }
.bars span.w { flex: 2.4; }
.bars span.on { background: var(--ink); }
.bars.indeterminate span { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { background: #c9c9c9; } }

.result { display: grid; gap: 10px; }
.link-button {
  background: none; border: none; color: var(--link); font-weight: 400; padding: 4px;
}

.error { border-left: 4px solid var(--red); background: #fdf3f3; padding: 12px 16px; }
.error p { margin: 0; font-weight: 700; color: var(--red); }
.error ul { margin: 8px 0 0; padding-left: 18px; font-size: 0.88rem; }
.error li + li { margin-top: 4px; }

.card-foot {
  padding: 16px 32px 20px;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  text-align: center;
}
.card-foot a { color: var(--link); }

@media (max-width: 480px) {
  .card-head, .card-body, .card-foot, .history { padding-left: 20px; padding-right: 20px; }
  .userbar { padding-left: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .bars span { transition: none; }
  .bars.indeterminate span { animation: none; }
}
