:root {
  --page: #e6e9ee;
  --panel: #ffffff;
  --ink: #1f2a3a;
  --muted: #5a6577;
  --policy: #2b5c9e;
  --fail: #b3261e;
  --fail-bg: #fbeceb;
  --pass: #2e7d4f;
  --pass-bg: #e9f4ed;
  --token-body: #203864;
  --lcd: #9be37a;
  --font: "Public Sans", "Segoe UI", Arial, sans-serif;
  --lcd-font: "Share Tech Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
}

.mobile-warning { display: none; }

@media (max-width: 820px) {
  .mobile-warning {
    display: block;
    margin: 0;
    padding: 0.8rem 1rem;
    background: var(--warn-bg, #fff6e6);
    border-bottom: 3px solid #8a5a00;
    color: #8a5a00;
    font-size: 0.95rem;
    line-height: 1.4;
  }
}

.portal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  background: var(--policy);
  color: #fff;
  font-size: 0.9rem;
}
.portal-name { font-weight: 800; }
.note { opacity: 0.85; }

.page {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

h1 {
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.lede { color: var(--muted); margin: 0 0 2rem; max-width: 34rem; }

.field-label { display: block; font-weight: 600; margin-bottom: 0.4rem; }

.field-wrap { position: relative; }

#pw {
  width: 100%;
  min-height: 3.5rem;
  resize: vertical;
  padding: 0.85rem 3.5rem 0.85rem 0.9rem;
  border: 2px solid #9aa5b5;
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink);
  font: 400 1.25rem/1.4 var(--font);
  word-break: break-all;
}
#pw:focus { outline: 3px solid var(--policy); outline-offset: 2px; border-color: var(--policy); }

.count {
  position: absolute;
  right: 0.8rem;
  top: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}
.count.over { color: var(--fail); }

/* The one memorable object: a hardware token */
.token {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin: 1.25rem 0 0;
  padding: 0.6rem 2rem;
  background: var(--token-body);
  border-radius: 25px 45px 45px 25px;
  color: #c9ced6;
}
.token[hidden] { display: none; }

.token-main {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
}

.token-code {
  font-family: var(--lcd-font);
  font-size: 2.2rem;
  line-height: 1.2rem;
  letter-spacing: 0.18em;
  color: var(--lcd);
  background: #0f1a12;
  padding: 1rem 0.4rem;
  border-radius: 3px;
}
.token-bar { width: 100%; height: 6px; background: #444b55; border-radius: 3px; overflow: hidden; }
.token-fill { display: block; height: 100%; width: 100%; background: var(--lcd); transition: width 1s linear; }

.rules { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0.75rem; }

.rule {
  background: var(--panel);
  border-left: 6px solid var(--fail);
  border-radius: 0 3px 3px 0;
  overflow: hidden;
}
.rule-head {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--fail-bg);
  color: var(--fail);
}
.rule-body { padding: 0.7rem 0.9rem 0.85rem; }
.rule-hint { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.9rem; }

.rule.pass { border-left-color: var(--pass); }
.rule.pass .rule-head { background: var(--pass-bg); color: var(--pass); }
.rule.pass .rule-body { color: var(--muted); }

.rule.new { animation: arrive 0.35s ease-out; }
@keyframes arrive { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

.success {
  margin-top: 2rem;
  padding: 1.25rem 1.25rem 1.4rem;
  background: var(--panel);
  border-top: 6px solid var(--pass);
}
.success h2 { margin: 0 0 0.3rem; font-size: 1.6rem; }
.success p { margin: 0 0 1rem; color: var(--muted); }

button {
  font: 600 1rem var(--font);
  padding: 0.6rem 1.1rem;
  border: 0;
  border-radius: 3px;
  background: var(--policy);
  color: #fff;
  cursor: pointer;
}
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .rule.new { animation: none; }
  .token-fill { transition: none; }
}

.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  border-top: 1px solid var(--line, #d3d9e2);
  font-size: 0.9rem;
}
.site-footer a {
  color: var(--policy, #2b5c9e);
  font-weight: 600;
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
.footer-sub {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted, #5a6577);
  font-size: 0.82rem;
}