:root {
  --ink: #182033;
  --muted: #5b6578;
  --line: #d8deea;
  --paper: #ffffff;
  --soft: #f5f7fb;
  --accent: #2453d6;
  --accent-dark: #183b9a;
  --warning: #fff3cc;
  --error: #ffe3e3;
  --ok: #e3f8eb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f8faff 0%, #eef3ff 100%);
}

body.has-cookie-banner {
  overflow: hidden;
}

a {
  color: var(--accent);
  font-weight: 700;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  margin-top: 3rem;
}

.brand {
  color: var(--ink);
  font-size: 1.15rem;
  text-decoration: none;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.main-nav a,
.link-button {
  color: var(--muted);
  text-decoration: none;
}

.link-button {
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.language-switch a {
  min-width: 2.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.language-switch a[aria-current="true"] {
  background: var(--accent);
  color: #fff;
}

.page {
  width: min(1160px, calc(100% - 2rem));
  margin: 2rem auto;
}

.hero,
.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.hero h1,
.page-heading h1 {
  margin: 0.25rem 0;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
}

.lead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 64ch;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel,
.card,
.hero-card,
.wallet-box,
.notice {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  box-shadow: 0 20px 50px rgba(24, 32, 51, 0.08);
  padding: 1.25rem;
}

.panel.narrow {
  max-width: 680px;
  margin: 0 auto;
}

.legal {
  line-height: 1.7;
}

.grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-head,
.print-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.actions,
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stack {
  flex-direction: column;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fff;
  color: var(--ink);
  padding: 0.6rem 1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.small {
  min-height: 2rem;
  border-radius: 0.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.button.danger {
  border-color: #d14343;
  color: #9f1d1d;
}

.wallet-box {
  text-align: center;
}

.wallet-box span,
.muted,
.list-item small {
  color: var(--muted);
}

.wallet-box strong {
  display: block;
  font-size: 2.6rem;
}

.course-notes {
  max-width: 70ch;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.75rem;
}

.form p {
  display: grid;
  gap: 0.35rem;
}

.form input,
.form textarea,
.form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.7rem;
  font: inherit;
}

.form .helptext {
  color: var(--muted);
  font-size: 0.85rem;
}

.messages {
  width: min(1160px, calc(100% - 2rem));
  margin: 1rem auto 0;
}

.message,
.notice {
  border-left: 4px solid var(--accent);
}

.message.error,
.notice.warning {
  background: var(--warning);
  border-left-color: #c48c00;
}

.list {
  display: grid;
  gap: 0.6rem;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.8rem;
  text-decoration: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem;
  text-align: left;
  vertical-align: top;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0;
}

.inline-form input[type="number"] {
  width: 5.2rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.45rem;
}

.token-list {
  display: grid;
  gap: 0.35rem;
}

.check-list {
  padding-left: 1.2rem;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.qr-card {
  background: #fff;
  border: 1px solid #111827;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  break-inside: avoid;
}

.qr-card img {
  width: 170px;
  height: 170px;
}

.qr-card small {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.68rem;
}

.generated-image {
  width: min(720px, 100%);
  border-radius: 0.8rem;
  border: 1px solid var(--line);
}

.cookie-banner {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  width: 100vw;
  min-height: 100vh;
  padding: 1rem;
  background: rgba(24, 32, 51, 0.36);
  backdrop-filter: blur(12px);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-card {
  width: min(560px, 100%);
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  box-shadow: 0 24px 70px rgba(24, 32, 51, 0.28);
}

.cookie-card p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-start;
  margin-top: 1rem;
}

@media (max-width: 820px) {
  .site-header,
  .site-footer,
  .hero,
  .page-heading,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .cookie-actions {
    justify-content: flex-start;
  }
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .site-footer,
  .messages,
  .print-actions .button {
    display: none;
  }

  .page {
    width: 100%;
    margin: 0;
  }

  .qr-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .qr-card {
    box-shadow: none;
    page-break-inside: avoid;
  }
}
