:root {
  --ink: #123553;
  --ink-strong: #0b2439;
  --ink-muted: #587083;
  --blue-soft: #eaf2f7;
  --surface: #fffdf8;
  --surface-alt: #f5f1e9;
  --line: #d8e0e3;
  --accent: #d46b2d;
  --accent-hover: #b95620;
  --whatsapp: #1d8d5a;
  --focus: #1f6fa6;
  --shadow: 0 20px 48px rgba(18, 53, 83, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 20rem;
  margin: 0;
  color: var(--ink);
  background: var(--surface-alt);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 0.9rem;
  color: #fff;
  background: var(--ink);
  border-radius: 0.5rem;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

/* Tarjeta principal */
.digital-card {
  width: 100%;
  overflow: hidden;
  background: var(--surface);
}

.card-header {
  position: relative;
  display: flex;
  min-height: 7.35rem;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem 2.2rem;
  overflow: hidden;
  background: linear-gradient(135deg, #0b2439 0%, #123553 65%, #1d587d 100%);
  border-top: 0.25rem solid var(--accent);
}

.card-header::before,
.card-header::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.card-header::before {
  width: 14rem;
  height: 14rem;
  top: -9.8rem;
  right: -4.5rem;
}

.card-header::after {
  width: 10rem;
  height: 10rem;
  bottom: -7.6rem;
  left: -3.5rem;
  border-color: rgba(212, 107, 45, 0.48);
}

.brand-logo-plaque {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(10rem, 50vw);
  min-height: 3.35rem;
  place-items: center;
  padding: 0.3rem 0.65rem;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.96);
  border-radius: 0.78rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.brand-logo { width: 100%; height: auto; }

.card-main { padding: 0 1.25rem 1.5rem; }

.card-identity {
  position: relative;
  z-index: 1;
  margin-top: -2.85rem;
  text-align: center;
}

.card-identity::before {
  position: absolute;
  top: 0.08rem;
  left: calc(50% + 1.35rem);
  width: 2rem;
  height: 1rem;
  border-top: 0.16rem solid var(--accent);
  border-radius: 50%;
  content: "";
  transform: rotate(48deg);
}

.profile-photo {
  width: clamp(6.75rem, 30vw, 7.75rem);
  aspect-ratio: 1;
  margin: 0 auto 0.75rem;
  object-fit: cover;
  object-position: center 28%;
  background: var(--surface);
  border: 0.23rem solid var(--surface);
  border-radius: 50%;
  outline: 0.2rem solid var(--ink);
  box-shadow: 0 10px 22px rgba(18, 53, 83, 0.22);
}

h1, h2, p { margin-top: 0; }
h1, h2 { color: var(--ink-strong); line-height: 1.16; }

h1 {
  margin-bottom: 0.28rem;
  font-size: clamp(1.72rem, 7.2vw, 2.05rem);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.descriptor {
  max-width: 21rem;
  margin: 0 auto;
  color: var(--ink-muted);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.35;
}

.identity-summary {
  margin: 0.55rem 0 1.1rem;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 750;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0.35rem;
  background: #f5f8fa;
  border-radius: 0.9rem;
}

.quick-actions a {
  display: grid;
  min-height: 3.45rem;
  place-items: center;
  gap: 0.17rem;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}

.quick-actions a:nth-child(2) { color: var(--whatsapp); }
.quick-actions svg { width: 1.85rem; height: 1.85rem; padding: 0.38rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; background: var(--surface); border-radius: 50%; }
.quick-actions a:nth-child(2) svg { fill: currentColor; stroke: none; }

.button {
  display: inline-flex;
  min-height: 3.2rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.82rem;
  font: inherit;
  font-weight: 750;
  line-height: 1.18;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover, .tool-action:hover { transform: translateY(-1px); }

.button--primary {
  width: 100%;
  margin-top: 1rem;
  padding: 0.68rem 0.85rem;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 9px 18px rgba(212, 107, 45, 0.24);
}

.button--primary:hover { background: var(--accent-hover); }
.button--primary span { min-width: 0; text-align: left; }
.button--primary strong, .button--primary small { display: block; }
.button--primary strong { font-size: 0.96rem; }
.button--primary small { margin-top: 0.12rem; font-size: 0.76rem; font-weight: 600; }
.button__icon { width: 1.28rem; height: 1.28rem; flex: 0 0 auto; color: #c5f5d8; fill: currentColor; }

.card-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 0.85rem;
  overflow: hidden;
  background: #f5f8fa;
  border: 1px solid var(--line);
  border-radius: 0.82rem;
}

.tool-action {
  display: inline-flex;
  min-height: 3.05rem;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.3rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.tool-action + .tool-action { border-left: 1px solid var(--line); }
.tool-action:hover { background: var(--blue-soft); }
.tool-action svg { width: 1.08rem; height: 1.08rem; flex: 0 0 auto; fill: currentColor; }
.tool-action:first-child svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.tool-action[disabled] { cursor: not-allowed; opacity: 0.6; }

.share-status { grid-column: 1 / -1; min-height: 1.15rem; margin: 0.3rem 0 0; color: var(--ink-muted); font-size: 0.76rem; text-align: center; }
.share-status:empty { display: none; }
.share-status.is-error { color: var(--ink-strong); }
.copy-buffer { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.card-section {
  margin-top: 1.5rem;
  padding-top: 0;
}

.area-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.9rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.area-grid li {
  display: flex;
  min-height: 2.65rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0;
  color: var(--ink);
  background: transparent;
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.area-grid li::before {
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0.18rem rgba(212, 107, 45, 0.14);
  content: "";
}

.area-grid li:nth-child(even)::before { background: #1d587d; box-shadow: 0 0 0 0.18rem rgba(29, 88, 125, 0.12); }

.card-contact {
  display: grid;
  gap: 0.2rem;
  margin: 0.9rem 0 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-style: normal;
  text-align: center;
}

.card-contact p { margin: 0; }
.card-contact a { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; text-underline-offset: 0.18em; }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: rgba(255, 255, 255, 0.76);
  background: var(--ink);
  border-top: 0;
  font-size: 0.76rem;
}

.card-footer p { margin: 0; font-weight: 750; }
.card-footer a { color: #fff; text-underline-offset: 0.18em; }

/* Aviso de privacidad */
.privacy-shell { width: min(100% - 2.5rem, 54rem); margin-inline: auto; padding: 0.8rem 0 4rem; }
.privacy-document { max-width: 48rem; margin-inline: auto; padding: clamp(1.15rem, 4vw, 2.75rem); background: var(--surface); }
.privacy-page .site-header { padding-top: 0.65rem; }
.privacy-page .site-header__inner { width: min(100% - 2.5rem, 48rem); margin-inline: auto; }
.privacy-page .brand-logo { width: clamp(8.5rem, 24vw, 11.5rem); }
.privacy-document__header { padding-bottom: 1.75rem; border-bottom: 3px solid var(--accent); }
.privacy-document__header h1 { margin-bottom: 0.75rem; }
.privacy-document__type, .privacy-document__updated { margin-bottom: 0.45rem; color: var(--ink-muted); }
.privacy-document__type { color: var(--ink); font-size: 0.82rem; font-weight: 800; letter-spacing: 0.07em; }
.privacy-document__return, .privacy-footer a { color: var(--ink); font-weight: 750; text-underline-offset: 0.22em; }
.privacy-document__return { display: inline-block; margin-top: 0.8rem; }
.privacy-toc { margin: 1.6rem 0 2rem; padding: 0.85rem 1rem; background: #f5f8fa; border-left: 0.18rem solid var(--ink); }
.privacy-toc h2 { margin-bottom: 0.5rem; font-size: 1rem; }
.privacy-toc ol { columns: 2; gap: 1.3rem; padding-left: 1.2rem; margin: 0; }
.privacy-toc li { break-inside: avoid; margin-bottom: 0.1rem; padding-left: 0.15rem; }
.privacy-toc a, .privacy-document a:not(.button) { color: var(--ink); overflow-wrap: anywhere; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.privacy-toc a { display: inline-block; padding: 0.18rem 0; }
.privacy-section { padding: 1.85rem 0; border-top: 1px solid var(--line); }
.privacy-section h2 { max-width: 38rem; margin-bottom: 1rem; font-size: clamp(1.3rem, 4vw, 1.75rem); }
.privacy-section h3 { margin: 1.15rem 0 0.4rem; color: var(--ink); font-size: 1rem; }
.privacy-section p, .privacy-contact p { max-width: 39rem; color: var(--ink-muted); }
.privacy-section p { margin-bottom: 0.9rem; }
.privacy-section ul, .privacy-section ol { max-width: 39rem; margin: 0.65rem 0 0.9rem; padding-left: 1.25rem; color: var(--ink-muted); }
.privacy-section li + li { margin-top: 0.35rem; }
.privacy-contact { max-width: 39rem; margin: 1.5rem 0; padding: 1rem 1.15rem; background: var(--surface-alt); border-left: 0.25rem solid var(--ink); font-style: normal; }
.privacy-contact p:last-child { margin-bottom: 0; }
.privacy-footer { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }

@media (min-width: 31rem) {
  .card-main { padding-inline: 1.5rem; }
  .card-footer { padding-inline: 1.5rem; }
}

@media (min-width: 48rem) {
  .card-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2.5rem 1.5rem;
    background:
      radial-gradient(circle at 15% 18%, rgba(212, 107, 45, 0.14), transparent 23rem),
      radial-gradient(circle at 85% 82%, rgba(62, 125, 161, 0.22), transparent 27rem),
      #0b2439;
  }
  .digital-card { width: min(100%, 29rem); min-height: auto; border: 1px solid rgba(18, 53, 83, 0.1); border-radius: 1.25rem; box-shadow: var(--shadow); }
  .card-header { min-height: 7.25rem; }
  .card-main { padding: 0 1.65rem 1.65rem; }
  .profile-photo { width: 8.25rem; }
  .card-footer { padding-inline: 1.65rem; }
}

@media (max-width: 40rem) {
  .privacy-toc ol { columns: 1; }
  .privacy-section { padding: 1.55rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
