:root {
  --navy: #002454;
  --gold: #f4ac00;
  --ink: #0d1b33;
  --muted: #5d6b82;
  --line: #e4e9f1;
  --paper: #ffffff;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.mono { font-family: var(--mono); letter-spacing: 0.02em; }

/* ---------- Cabeçalho azul ---------- */
.head {
  padding: calc(env(safe-area-inset-top) + 20px) 20px 84px;
  background: var(--navy);
  color: #fff;
}

.head-row,
.head .eyebrow {
  max-width: 480px;
  margin: 0 auto;
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.brand-name { font-weight: 800; font-size: 26px; letter-spacing: -0.03em; }

.head .eyebrow {
  display: block;
  margin-top: 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--gold);
}

.status {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(23, 163, 74, .18);
  color: #7ff0a6;
  box-shadow: inset 0 0 0 1px rgba(127, 240, 166, .35);
}
.status.expired { background: rgba(217, 45, 32, .2); color: #ffb3ad; box-shadow: inset 0 0 0 1px rgba(255, 179, 173, .4); }

/* ---------- Conteúdo ---------- */
.content {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px calc(env(safe-area-inset-bottom) + 24px);
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: -68px;
  padding-bottom: 22px;
}

.photo {
  display: block;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--paper);
  outline: 3px solid var(--gold);
  background: var(--line);
}

.name {
  margin: 16px 0 4px;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.course {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.level {
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #fff6de;
  color: #8a5d00;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ---------- Campos ---------- */
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.field { background: var(--paper); padding: 12px 14px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }

.field dt {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

.field dd {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-wide dd { font-size: 19px; color: var(--navy); }

/* ---------- QR ---------- */
.qr-block {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: #f4f7fb;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.qr {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.qr svg, .qr-big svg { display: block; width: 100%; height: 100%; }

.qr-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qr-text strong { font-size: 14px; color: var(--navy); }
.qr-text span { font-size: 12px; line-height: 1.4; color: var(--muted); }
.qr-text .qr-hint { margin-top: 2px; font-weight: 700; color: #b37d00; }

.footnote {
  margin: 20px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- QR ampliado ---------- */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(0, 21, 53, .9);
}
.qr-modal[hidden] { display: none; }

.qr-modal-inner {
  width: 100%;
  max-width: 340px;
  padding: 24px;
  border-radius: 24px;
  background: #fff;
  text-align: center;
}

.qr-big { width: 100%; aspect-ratio: 1; }
.qr-modal-name { margin: 16px 0 2px; font-weight: 800; font-size: 17px; color: var(--navy); }
.qr-modal-sub { margin: 0; font-size: 13px; color: var(--muted); }

.qr-close {
  margin-top: 18px;
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
