@import url("https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Manrope:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --bg: #eef1f5; --surface: #ffffff; --ink: #18202e; --muted: #5d6779; --line: #d9dee7;
  --btn-bg: #e6ebf8; --btn-line: #9fb0e0;
  --accent: #2348c4; --accent-ink: #ffffff; --chip: #e6ebf8; --ok: #1d7a4c; --warn: #9a5b00; --err: #b3261e;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131b; --surface: #171d28; --ink: #e8ecf3; --muted: #9aa4b6; --line: #2a3242;
    --btn-bg: #26324d; --btn-line: #4a5d8c;
    --accent: #7d9bff; --accent-ink: #0f131b; --chip: #212b40; --ok: #5fd39a; --warn: #f0b45a; --err: #ff8a80;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  padding-inline: 16px; padding-block: 24px 48px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; text-wrap: balance; margin: 0; }
.label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.wrap { max-width: 1000px; margin: 0 auto; }
.btn { font: inherit; font-weight: 600; border: 1.5px solid var(--btn-line); background: var(--btn-bg); color: var(--ink);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.big { padding: 14px 18px; font-size: 1rem; border-radius: 12px; justify-content: center; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; }
input:disabled, textarea:disabled { opacity: .55; }
textarea { resize: vertical; min-height: 64px; }

/* Tarjeta pública */
.card { background: var(--card-bg, var(--surface)); color: var(--card-ink, var(--ink)); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; max-width: 420px; width: 100%; }
.card-head { background: var(--head-bg, var(--accent)); color: var(--head-ink, var(--accent-ink)); height: 128px; position: relative; }
/* La foto va a la izquierda (sobresale hacia el cuerpo) y el logo ocupa algo más de la mitad derecha. */
.card-head .logo { position: absolute; right: 16px; top: 16px; width: 56%; height: 96px; object-fit: contain;
  background: #ffffff; border-radius: 12px; padding: 8px 12px; }
.photo { width: 104px; height: 104px; border-radius: 50%; border: 4px solid var(--card-bg, var(--surface)); background: var(--chip);
  position: absolute; left: 24px; bottom: -52px; display: grid; place-items: center; overflow: hidden;
  font-family: var(--font-display); font-size: 2rem; color: var(--accent); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 64px 24px 24px; display: grid; gap: 18px; }
.who h2 { font-size: 1.45rem; overflow-wrap: anywhere; }
.who p { margin: 2px 0 0; opacity: .75; }
.rows { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px;
  background: var(--card-chip, var(--chip)); border-radius: 12px; color: inherit; text-decoration: none; }
.row .v { overflow-wrap: anywhere; font-weight: 500; }
.qr { background: #ffffff; padding: 12px; border-radius: 12px; line-height: 0; justify-self: center; }
.qr img { width: 200px; height: 200px; image-rendering: pixelated; }
.status { font-size: 13px; min-height: 1.2em; margin: 0; }
.status.ok { color: var(--ok); } .status.err { color: var(--err); }

/* Botones de la tarjeta pública con el color elegido por su dueño. */
.card .btn.primary { background: var(--btn-main, var(--accent)); border-color: var(--btn-main, var(--accent)); color: var(--btn-main-ink, var(--accent-ink)); }
.card .btn:not(.primary) { background: var(--card-chip, var(--btn-bg)); border-color: var(--btn-main, var(--btn-line)); color: inherit; }
.card .crear p { color: inherit; opacity: .75; }
input[type="color"] { width: 48px; height: 38px; padding: 2px; cursor: pointer; }

/* Marca: el logo oscuro de Trama Digital sobre su mismo fondo, arriba de la portada y del editor. */
.marca { display: flex; justify-content: center; background: #071226; border-radius: 14px; padding: 10px 16px; margin-bottom: 20px; }
.marca img { display: block; height: 56px; width: auto; max-width: 100%; }
