/* Tarjeta digital de Eldwin Olivo.
   Colores, medidas y composición tomados de maqueta/tarjeta-digital-CEO-demo.html. */

:root {
  --gold: #ffcc38;
  --gold2: #e8a912;
  --bg: #080d11;
  --muted: #aeb8be;
  --paper: #131b21;
  --white: #fff;
  --link-bg: #1c262b;
  --link-borde: #344047;
  --icon-bg: #263339;
  --texto-claro: #d3d5d0;
  --fuentes: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --fuentes-zh: 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC', system-ui, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--fuentes);
  color: var(--white);
  background: radial-gradient(ellipse at 85% 0, #252820 0%, transparent 44%), var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html:lang(zh-Hans),
html:lang(zh-Hans) body { font-family: var(--fuentes-zh); }

body {
  min-height: 100vh;
  padding: max(20px, env(safe-area-inset-top)) max(13px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(13px, env(safe-area-inset-left));
}

/* Evita mostrar la tarjeta en el idioma equivocado durante un instante.
   Si el JavaScript fallara, la animación la muestra igualmente pasado un momento. */
.cargando .outer {
  opacity: 0;
  animation: aparecer 0s linear 1.5s forwards;
}
@keyframes aparecer { to { opacity: 1; } }

.outer { max-width: 450px; margin: 0 auto; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icono {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

/* Aviso superior y selector de idioma */
.preview {
  font-size: 11px;
  letter-spacing: .115em;
  color: #0e1012;
  background: var(--gold);
  display: table;
  margin: 0 auto 17px;
  padding: 6px 13px;
  border-radius: 30px;
  font-weight: 800;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}
.toolbar button {
  font: inherit;
  background: #141c20;
  color: #ccd1d4;
  border: 1px solid #323e44;
  padding: 8px 14px;
  min-height: 40px;
  min-width: 64px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
}
.toolbar button[lang='zh-Hans'] { font-family: var(--fuentes-zh); }
.toolbar button[aria-pressed='true'] {
  background: var(--gold);
  color: #131313;
  border-color: var(--gold);
  font-weight: 700;
}

/* Tarjeta */
.card {
  overflow: hidden;
  position: relative;
  border: 1px solid #353530;
  border-radius: 24px;
  box-shadow: 0 20px 68px #0009;
  background: linear-gradient(156deg, #1e2324, #0c1013 34%, #11191d 100%);
}
.card::before {
  content: '';
  height: 6px;
  position: absolute;
  inset: 0 0 auto;
  background: linear-gradient(90deg, var(--gold), #b77f00, var(--gold));
}

.top {
  padding: 30px 26px 18px;
  text-align: center;
  background: radial-gradient(ellipse at 100% 0%, #332a10 0%, transparent 62%);
}

.brand {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.7px;
  color: var(--white);
  margin: 0 0 15px;
  font-family: var(--fuentes);
}
.brand span { color: var(--gold); }

.avatar {
  display: block;
  margin: 0 auto 14px;
  width: 144px;
  height: 144px;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe37a, #a66a00, var(--gold));
  box-shadow: 0 6px 24px #0007;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: 50%;
  border: 3px solid #111918;
  display: block;
}

h1 {
  font-size: 30px;
  letter-spacing: -.9px;
  line-height: 1.1;
  margin: 3px 0 11px;
  font-weight: 850;
  font-family: var(--fuentes);
}

.role {
  display: flex;
  flex-direction: column;
  margin: 0 auto 13px;
  padding: 11px 15px 12px;
  max-width: 290px;
  background: linear-gradient(90deg, #272b27, #1c292d);
  border: 1px solid #66572b;
  border-radius: 13px;
}
.role .rolelead {
  display: block;
  font-size: 12px;
  color: #e7edf0;
  font-weight: 650;
  line-height: 1.45;
}
.role .rolecompany {
  display: block;
  font-size: 16px;
  color: #ffce46;
  font-weight: 800;
  letter-spacing: .1px;
  line-height: 1.55;
  font-family: var(--fuentes);
}

.subtitle {
  color: #bec4c4;
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0;
}

.divider {
  width: 58px;
  height: 3px;
  border-radius: 3px;
  background: var(--gold);
  margin: 17px auto 0;
}

.bottom { padding: 5px 23px 23px; }

.intro {
  text-align: center;
  color: var(--texto-claro);
  font-size: 14px;
  line-height: 1.5;
  margin: 16px 0 19px;
}

/* Botones de contacto */
.links {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contacto { position: relative; }

.link {
  width: 100%;
  display: flex;
  gap: 13px;
  align-items: center;
  text-align: left;
  border-radius: 13px;
  padding: 13px 14px;
  background: var(--link-bg);
  color: var(--white);
  text-decoration: none;
  border: 1px solid var(--link-borde);
  box-shadow: 0 3px 8px #0002;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  min-height: 56px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.link:hover { border-color: #4d5c63; }
.link:active { transform: translateY(1px); }
.contacto.con-copia .link { padding-right: 62px; }

.link .icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--icon-bg);
  font-size: 17px;
  flex: 0 0 30px;
}
.link .textos { min-width: 0; }
.link .titulo { display: block; overflow-wrap: break-word; }
.link small {
  display: block;
  color: #b7c3c8;
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
  overflow-wrap: break-word;
}

.link.primary {
  color: #15191b;
  background: linear-gradient(105deg, #ffdb64, #ffc322);
  border: none;
}
.link.primary .icon { background: #0002; }
.link.primary small { color: #4d441e; }
.link.primary:hover { filter: brightness(1.04); }
/* Botón sin icono (página 404). */
.link.centrado { justify-content: center; text-align: center; }

.copiar {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: #c9d3d7;
  font-size: 18px;
  cursor: pointer;
}
.copiar:hover { background: #ffffff12; }
.primary + .copiar { color: #2a2b20; }
.primary + .copiar:hover { background: #0000001a; }
/* Sobre fondo dorado, el anillo de foco dorado no se vería: se usa uno oscuro. */
.primary + .copiar:focus-visible { outline-color: #15191b; outline-offset: -3px; }

.externo {
  margin-left: auto;
  color: #8e9a9e;
  font-size: 14px;
}
.primary .externo { color: #5a4f1e; }
/* Con botón de copiar al lado, la flecha sobra visualmente (el aviso para lectores de pantalla se mantiene). */
.con-copia .externo { position: absolute; }
.con-copia .externo .icono { display: none; }

/* Secciones inferiores */
.separator {
  color: #9aa7ad;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .15em;
  margin: 23px 0 13px;
  text-transform: uppercase;
}
html:lang(zh-Hans) .separator { letter-spacing: .3em; }

.acciones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.acciones .accion { font-size: 14px; min-height: 52px; padding: 11px 12px; gap: 10px; }
/* tarjeta.js indica cuántas acciones hay visibles: con 1 ocupa todo el ancho; con 3, la última. */
.acciones[data-visibles='1'] .accion,
.acciones[data-visibles='3'] .accion:last-child { grid-column: 1 / -1; }

.footer {
  text-align: center;
  color: #9aa7ab;
  font-size: 11.5px;
  line-height: 1.6;
  margin: 17px 0 0;
}

/* Diálogos */
.dialogo {
  width: min(100% - 32px, 380px);
  max-height: calc(100% - 32px);
  padding: 26px 20px 20px;
  border: 1px solid #66572b;
  border-radius: 20px;
  background: #11181c;
  color: var(--white);
  box-shadow: 0 24px 80px #000c;
  text-align: center;
}
.dialogo::backdrop { background: #000000c4; }
.dialogo h2 {
  font-size: 18px;
  margin: 0 36px 14px;
  line-height: 1.3;
}
.dialogo-texto {
  color: var(--texto-claro);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 12px 0 0;
}

.cerrar {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #ffffff14;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
}

.qr-imagen {
  display: block;
  /* También limitado por la altura, para que en horizontal el código quepa entero. */
  width: min(100%, 240px, calc(100vh - 150px));
  width: min(100%, 240px, calc(100dvh - 150px));
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto;
  background: #fff;
  border: 4px solid #dba715;
  border-radius: 14px;
  image-rendering: pixelated;
  /* En WeChat, mantener pulsada la imagen debe ofrecer «识别图中二维码». */
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}
.qr-wechat {
  width: min(100%, clamp(140px, calc(100vh - 270px), 240px));
  width: min(100%, clamp(140px, calc(100dvh - 270px), 240px));
}

.dato-copiable {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  margin-top: 16px;
  padding: 12px 12px 12px 14px;
  background: var(--link-bg);
  border: 1px solid var(--link-borde);
  border-radius: 13px;
  text-align: left;
}
.dato-etiqueta { grid-column: 1; font-size: 11px; color: #b7c3c8; }
.dato-valor {
  grid-column: 1;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}
.dato-copiable .boton-secundario { grid-column: 2; grid-row: 1 / span 2; }

.boton-secundario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid #66572b;
  background: #272b27;
  color: #ffce46;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.dialogo > .boton-secundario { margin-top: 18px; }

/* Mensaje breve («Copiado», «Enlace copiado») */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  margin: 0;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--gold);
  color: #131313;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px #0008;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Con un diálogo abierto, el aviso se muestra dentro de él, debajo de su contenido
   (fuera del recuadro quedaría recortado y tapado por el fondo oscuro). */
.dialogo > .toast {
  position: static;
  transform: none;
  display: table;
  margin: 14px auto 0;
  max-width: 100%;
  box-shadow: none;
}
.dialogo > .toast:not(.visible) { display: none; }

@media (max-width: 350px) {
  .top { padding-left: 14px; padding-right: 14px; }
  .bottom { padding: 3px 14px 19px; }
  .acciones { grid-template-columns: 1fr; }
  .acciones .accion { grid-column: auto; }
}

/* Pantallas muy estrechas (p. ej. móvil con zoom del 150 % o más): menos espacio reservado
   para que nombres y números no se partan. */
@media (max-width: 300px) {
  .contacto.con-copia .link { padding-right: 52px; }
  .link { gap: 10px; padding-left: 12px; }
  .copiar { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { transition: none !important; animation-duration: 0s !important; }
  .link:active { transform: none; }
}
