:root {
  --frame-color: #3a3a3a;
  --wrapper-background: #f7f8f9;
  --text: #2f2f2f;
  --muted: #9a9a9a;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.38);
  --shadow: 0 0.25rem 1rem rgba(48, 55, 66, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    "Noto Sans", sans-serif;
  background-color: var(--frame-color);
  color: var(--text);
}

/* SpyGuard-like frame + centered content */
.wrapper {
  width: 100%;
  min-height: 100vh;
  border: 5px solid var(--frame-color);
  border-radius: 0.8em;
  box-shadow: 0 0 0 0.6em var(--frame-color);
  background-color: var(--wrapper-background);
  overflow: auto;
  position: relative;
  padding-bottom: 72px;
}

/* Subtle “crystal” background */
.wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(1200px 600px at 15% 20%, rgba(58, 58, 58, 0.10), transparent 55%),
    radial-gradient(900px 450px at 85% 15%, rgba(120, 120, 120, 0.10), transparent 60%),
    radial-gradient(900px 450px at 70% 85%, rgba(58, 58, 58, 0.08), transparent 60%);
  pointer-events: none;
}

.center {
  width: min(560px, 92vw);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 16px;
}

.apcard-frame {
  padding: 5px;
  border: 3px solid #fff;
  background-color: #fff;
  border-radius: 12px;
  box-sizing: border-box;
  box-shadow: var(--shadow);
}

.card.apcard {
  width: 100%;
  border-radius: 5px;
  padding: 22px 22px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(155%);
  -webkit-backdrop-filter: blur(14px) saturate(155%);
}

.title {
  margin: 0 0 12px 0;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 1.2rem;
}

.legend {
  color: var(--muted);
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  line-height: 1.35rem;
}

.code-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}

.code-box {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: 5px;
  border: 1px solid rgba(48, 55, 66, 0.2);
  background: rgba(255, 255, 255, 0.75);
  color: #111;
  outline: none;
  box-shadow: 0 0.05rem 0.3rem rgba(48, 55, 66, 0.06);
  text-transform: lowercase;
}

.code-box:focus {
  border-color: rgba(17, 17, 17, 0.38);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12);
}

.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn {
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.2s ease,
    border-color 0.2s ease;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: #111;
  border-color: #111;
  color: #fff;
  min-width: 220px;
}

.btn-primary:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
}

.btn-primary:disabled {
  opacity: 0.75;
  cursor: default;
}

.btn-light {
  background: rgba(255, 255, 255, 0.7);
  color: #111;
}

.error {
  display: none;
  margin-top: 10px;
  color: #b00020;
  font-size: 0.95rem;
}

@media (max-width: 420px) {
  .code-box {
    width: 40px;
    height: 50px;
  }
  .btn-primary {
    min-width: 180px;
  }
}

.page-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  z-index: 2;
}

.footer-link {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
}

