/* site.css: los estilos de toda la página, sin estilos inline (CSP style-src
   'self'). La fuente self-hosted es JetBrains Mono, subset latin: se usa solo para
   texto ASCII (etiquetas, el id). El nombre del titular puede traer cualquier
   letra (Latin Extended, griego, cirílico), así que va en la pila del sistema,
   que la cubre entera. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122;
}

:root {
  --bg: #08080c;
  --panel: #101017;
  --panel-2: #17171f;
  --line: #262632;
  --text: #ececf1;
  --muted: #a3a3b0;
  --faint: #767684;
  --brand: #ff3b57;
  --brand-strong: #e62e49;
  --valid: #3ddc84;
  --valid-bg: rgba(61, 220, 132, 0.12);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "Liberation Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(255, 59, 87, 0.09), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

/* ===== header y footer ===== */
.top {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; }
.brand img { display: block; height: 36px; width: auto; }
.top-tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.foot {
  margin-top: auto;
  padding: 28px 24px 34px;
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}
.foot a { color: var(--faint); text-decoration: none; }
.foot a:hover { color: var(--muted); text-decoration: underline; }

.mock-banner {
  margin: 0;
  padding: 6px 12px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #3a2f00;
  color: #ffd75e;
}

/* ===== contenido ===== */
.page {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 14px;
  padding: 32px;
}

/* páginas soft (home, 404, 410, 502) */
.page-soft { flex: 1; justify-content: center; max-width: 680px; }
.soft-title { margin: 0 0 12px; font-size: clamp(1.6rem, 4.5vw, 2.2rem); line-height: 1.2; }
.soft-body { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* el certificado */
.status { margin: 0 0 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.badge-valid {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 12px;
  border: 1px solid rgba(61, 220, 132, 0.45);
  border-radius: 999px;
  background: var(--valid-bg);
  color: var(--valid);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.18em;
}
/* el tilde, dibujado con bordes: no depende de un glifo de la fuente */
.badge-valid::before {
  content: "";
  width: 6px;
  height: 11px;
  margin: -2px 1px 0 2px;
  border: solid currentColor;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.status-text { color: var(--muted); font-size: 15px; }

.label {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.holder {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 5.5vw, 2.9rem);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.cert-title { margin: 0 0 26px; font-size: 1.2rem; color: var(--text); overflow-wrap: anywhere; }

.facts {
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.fact-id { grid-column: 1 / -1; }
.fact dt {
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.fact dd { margin: 0; }
/* el id completo se selecciona de un clic */
.cert-id {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 14px;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-secondary { background: transparent; color: var(--text); }
.btn-secondary:hover { border-color: var(--muted); background: var(--panel-2); }

.cert-figure { margin: 0; }
.cert-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.cert-unavailable {
  margin: 0;
  padding: 16px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 15px;
}

.notes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 14px;
}
.notes p { margin: 0; }
.notes strong { color: var(--text); }

@media (max-width: 560px) {
  .top { padding: 16px; }
  .brand img { height: 30px; }
  .top-tag { display: none; }
  .page { padding: 4px 16px 16px; }
  .card { padding: 24px 20px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .cert-id { font-size: 12.5px; padding: 4px 6px; }
  .actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Impresa, la página es una constancia legible en papel blanco. */
@media print {
  body { background: #fff; color: #000; }
  .card { border-color: #999; background: #fff; }
  .badge-valid { color: #0a7a3c; border-color: #0a7a3c; background: none; }
  .label, .fact dt, .status-text, .notes, .top-tag { color: #333; }
  .notes strong { color: #000; }
  .cert-id { background: none; border-color: #999; }
  .brand img { filter: invert(1); }
  .actions, .mock-banner { display: none; }
}
