/* Placeholder look, roughly the mockup: one grey card, blue buttons, a big password. */
:root {
  --bg: #f4f5f7;
  --card: #f5f5f5;
  --border: #999;
  --text: #1a1a1a;
  --muted: #555;
  --accent: #0a84ff;
  --accent-text: #fff;
  --error: #b00020;
  --ok: #1b7f3b;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  max-width: 560px;
  margin: 24px auto;
  padding: 24px;
}

h1 { font-size: 1.5rem; margin-top: 0; }
h2 { font-size: 1rem; font-weight: normal; margin-bottom: 8px; }

label { display: block; margin: 16px 0 6px; }

input, select, button, .button {
  font: inherit;
  padding: 10px 12px;
  border-radius: 6px;
}

input, select {
  width: 100%;
  border: 1px solid #ccc;
  background: #fff;
}

.row { display: flex; gap: 12px; margin-top: 12px; }
.row > * { flex: 1; min-width: 0; }
.row > button { flex: 0 0 auto; }

button, .button {
  background: var(--accent);
  color: var(--accent-text);
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

form > button { margin-top: 16px; }

.hint { color: var(--muted); font-size: 0.875rem; margin: 6px 0 0; }
/* The "I'm not a robot" widget (Cloudflare Turnstile), above the submit button */
.robot-check { margin-top: 16px; min-height: 65px; }
.error { color: var(--error); }

/* The reasons a chosen password was refused, right under the password box */
.field-error { color: var(--error); font-size: 0.875rem; margin: 6px 0 0; }
.field-error p { margin: 0; }
.field-error ul { margin: 4px 0 0; padding-left: 20px; }
input[aria-invalid="true"] { border-color: var(--error); }
.ok { color: var(--ok); }

.password, .big { font-size: 1.75rem; font-weight: 700; margin: 8px 0 16px; word-break: break-all; }
.unit { font-size: 1.125rem; font-weight: 600; margin: 0 0 12px; }
.big a { color: inherit; text-decoration: none; }

.support { margin-top: 24px; }

/* The contact button: the QR code on a white tile, inside the blue button, label below */
.contact-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
}
.contact-button:hover, .contact-button:focus-visible { filter: brightness(1.08); }
.contact-button .qr { background: #fff; border-radius: 4px; padding: 8px; display: block; }
.contact-button .qr svg { width: 180px; height: 180px; display: block; }
.contact-label { font-weight: 600; }

/* The waiting page's progress bar (activating.js moves it). The stripes drift so it looks
   alive even while the fill waits for the next access point. */
.progress {
  height: 18px;
  margin: 16px 0 8px;
  background: #e2e4e8;
  border-radius: 9px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 9px;
  background-color: var(--accent);
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.22) 25%, transparent 25%,
                                    transparent 50%, rgba(255, 255, 255, 0.22) 50%,
                                    rgba(255, 255, 255, 0.22) 75%, transparent 75%);
  background-size: 24px 24px;
  animation: progress-stripes 1s linear infinite;
  transition: width 0.4s ease-out;
}
@keyframes progress-stripes { to { background-position: 24px 0; } }
@media (prefers-reduced-motion: reduce) {
  .progress-fill { animation: none; transition: none; }
}
.progress-step { font-weight: 600; margin: 0 0 16px; min-height: 1.5em; }
/* The progress section on top of the done page, set apart from the rest of the page below it */
.pending { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #d6d8dc; }

/* ---- The staff troubleshooting page (admin.html) ---- */
.card.wide { max-width: 1100px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin-head h1 { margin: 0; }
.admin-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 20px 0; }
.admin-actions section { background: #fff; border: 1px solid #d6d8dc; border-radius: 8px; padding: 14px; }
.admin-actions h2 { margin-top: 0; font-weight: 600; }
.admin-actions form > button { margin-top: 10px; }
.admin-actions section.danger { border-color: var(--error); }
button.secondary, .button.secondary { background: #e2e4e8; color: var(--text); }
button.danger-button { background: var(--error); }
.admin-filter { max-width: 520px; margin-bottom: 8px; }
.table-scroll { overflow-x: auto; margin-bottom: 20px; }
table { border-collapse: collapse; width: 100%; font-size: 0.8125rem; background: #fff; }
th, td { border: 1px solid #d6d8dc; padding: 4px 6px; text-align: left; vertical-align: top; white-space: nowrap; }
td:nth-child(n) { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
th { background: #eef0f3; font-weight: 600; }
.admin-actions form.stacked input + input { margin-top: 8px; }
/* The jobs log's status cell: a progress ring (queued / running), a check, or a cross */
td.job-status { white-space: nowrap; }
td.job-status .ring { width: 18px; height: 18px; vertical-align: middle; transform: rotate(-90deg); margin-right: 6px; }
.ring-track { fill: none; stroke: #e2e4e8; stroke-width: 3; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
             stroke-dasharray: 50.27; transition: stroke-dashoffset 0.6s ease-out; }
.job-done, .job-failed { display: inline-block; width: 18px; margin-right: 6px; text-align: center; font-weight: 700; }
.job-done { color: var(--ok); }
.job-failed { color: var(--error); }
