/* ==========================================================================
   DynamicQR NFCSCR — páginas públicas (lo que ve quien escanea)
   Ligeras, pensadas para celular y para cargar rápido con datos móviles.
   ========================================================================== */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("../fonts/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("../fonts/montserrat-latin-700-normal.woff2") format("woff2"); }

:root {
  --accent: #73030D;
  --on-accent: #FFFFFF;
  --accent-soft: #F7EBEC;
  --ink: #0D0D0D;
  --muted: #555555;
  --line: #E2E2E2;
  --bg: #F2F2F2;
  --card: #FFFFFF;
  --r: 14px;
  --font-ui: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --font-brand: "Montserrat", "Barlow", system-ui, sans-serif;
}
.theme-dark {
  --ink: #F4F4F4;
  --muted: #B5B5B5;
  --line: #2C2C2C;
  --bg: #0D0D0D;
  --card: #171717;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; font-family: var(--font-ui); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 480px; margin: 0 auto; padding: 28px 18px 24px; flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.card + .card { margin-top: 14px; }

.logo { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; background: var(--card); border: 1px solid var(--line); margin: 0 auto 14px; }
.logo-square { border-radius: 18px; object-fit: contain; padding: 8px; }
.title { font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1.05; text-align: center; margin: 0 0 6px; letter-spacing: -.005em; overflow-wrap: anywhere; }
.subtitle { text-align: center; color: var(--muted); margin: 0 auto 22px; max-width: 34ch; white-space: pre-line; }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 17px/1.2 var(--font-ui); text-decoration: none; cursor: pointer; text-align: center; transition: transform .08s ease, background-color .12s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.985); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { filter: brightness(1.06); }
.btn-small { min-height: 40px; width: auto; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.btn-tile { flex-direction: column; gap: 6px; min-height: 74px; font-size: 13px; font-weight: 500; }
.btn-tile .icon { color: var(--accent); width: 22px; height: 22px; }
.theme-dark .btn-tile .icon { color: var(--ink); }

/* ---------------------------------------------------------------- Página de enlaces */
.links { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.links .btn { justify-content: flex-start; padding-left: 18px; }
.links .btn .icon { color: var(--accent); }
.theme-dark .links .btn .icon { color: var(--ink); }
.links .btn span { flex: 1; text-align: center; padding-right: 30px; }
.share { margin: 22px auto 0; display: flex; justify-content: center; }

/* ---------------------------------------------------------------- Wi-Fi */
.wifi-badge { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: var(--accent); color: var(--on-accent); }
.wifi-badge .icon { width: 36px; height: 36px; }
.cred { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.cred + .cred { margin-top: 10px; }
.cred-label { font-size: 13px; color: var(--muted); display: block; }
.cred-value { font-size: 20px; font-weight: 600; overflow-wrap: anywhere; letter-spacing: .01em; }
.cred-value.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 19px; }
.cred > div { flex: 1; min-width: 0; }
.copy-btn { flex: none; }
.copy-btn.is-done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.howto { margin-top: 16px; font-size: 15px; color: var(--muted); }
.howto summary { cursor: pointer; color: var(--ink); font-weight: 600; padding: 4px 0; }
.howto ol { padding-left: 20px; margin: 8px 0 0; }
.howto li { margin-bottom: 4px; }
.note-box { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 15px; white-space: pre-line; }

/* ---------------------------------------------------------------- Tarjeta de contacto */
.vcard-head { background: var(--accent); color: var(--on-accent); border-radius: var(--r) var(--r) 0 0; padding: 26px 22px 64px; text-align: center; }
.vcard-head .org { font-size: 14px; opacity: .85; margin: 0; }
.vcard-body { background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); padding: 0 22px 22px; text-align: center; }
.vcard-photo { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 4px solid var(--card); margin: -56px auto 10px; background: var(--card); }
.vcard-initials { width: 112px; height: 112px; border-radius: 50%; border: 4px solid var(--card); margin: -56px auto 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-display); font-size: 40px; font-weight: 600; }
.vcard-name { font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 1.05; margin: 0 0 2px; overflow-wrap: anywhere; }
.vcard-role { color: var(--muted); margin: 0 0 18px; }
.vcard-list { list-style: none; margin: 18px 0 0; padding: 0; text-align: left; border-top: 1px solid var(--line); }
.vcard-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.vcard-list .icon { color: var(--accent); margin-top: 2px; }
.vcard-list small { display: block; color: var(--muted); font-size: 13px; }
.vcard-list a { text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.vcard-note { color: var(--muted); margin: 16px 0 0; white-space: pre-line; text-align: left; }

/* ---------------------------------------------------------------- Menú */
.menu-head { text-align: center; margin-bottom: 18px; }
.menu-pages { display: grid; gap: 12px; }
.menu-page { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.menu-page img, .menu-page canvas { width: 100%; height: auto; display: block; }
.pdf-loading { padding: 40px 20px; text-align: center; color: var(--muted); }
.pdf-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.wrap-wide { max-width: 720px; }

/* ---------------------------------------------------------------- Estados */
.status { text-align: center; padding-top: 12vh; }
.status-mark { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; background: #73030D; color: #F2F2F2; display: grid; place-items: center; }
.status-mark svg { width: 24px; height: 36px; }
.status h1 { font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1.05; margin: 0 0 10px; }
.status p { color: var(--muted); max-width: 36ch; margin: 0 auto 22px; }
.status .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; color: var(--muted); }
.status .btn { max-width: 340px; margin: 0 auto 10px; }
.status-whatsapp { --accent: #73030D; }

/* ---------------------------------------------------------------- Inicio */
.home { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 32px 20px; background: #0D0D0D; color: #F2F2F2; }
.home-inner { max-width: 520px; }
.home .wordmark { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.home .wordmark svg { width: 24px; height: 36px; color: #F2F2F2; }
.home .wordmark span { font-family: var(--font-brand); font-size: 28px; }
.home .wordmark b { font-weight: 700; }
.home h1 { font-family: var(--font-display); font-weight: 600; font-size: 42px; line-height: 1.04; margin: 0 0 14px; }
.home p { color: #BDBDBD; margin: 0 auto 26px; max-width: 42ch; }
.home .btn { background: #73030D; border-color: #73030D; color: #fff; max-width: 320px; margin: 0 auto 10px; }
.home .btn-outline { background: transparent; border-color: #3A3A3A; color: #F2F2F2; }
.home .made { margin-top: 30px; font-size: 13px; color: #8A8A8A; }
.home .made svg { height: 11px; width: auto; display: inline-block; vertical-align: -1px; color: #BDBDBD; }

/* ---------------------------------------------------------------- Pie de marca */
.made-by { text-align: center; padding: 18px 16px 26px; font-size: 13px; color: var(--muted); }
.made-by a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.made-by svg { height: 10px; width: auto; color: var(--ink); opacity: .75; }

/* Vista previa embebida (iframe del panel) */
.is-preview .wrap { padding-top: 34px; }
.preview-redirect { text-align: center; padding-top: 18vh; }
.preview-redirect .url { font-weight: 600; overflow-wrap: anywhere; margin: 8px 0 20px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
