:root {
  /* Concreto de taller: neutros entintados hacia el ámbar */
  --ground: oklch(0.962 0.006 85);
  --ink: oklch(0.22 0.014 80);
  --ink-soft: oklch(0.44 0.014 80);

  --mp: oklch(0.915 0.185 101);
  --mp-ink: oklch(0.24 0.045 95);
  --mp-ink-soft: oklch(0.36 0.06 95);

  --rey: oklch(0.44 0.205 264);
  --rey-ink: oklch(0.985 0.006 264);
  --rey-ink-soft: oklch(0.88 0.045 264);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  --radius: 22px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --font-sign: "Avenir Next Condensed", "Bahnschrift SemiCondensed", "Bahnschrift",
    sans-serif-condensed, "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--ground);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.page {
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  padding:
    max(var(--space-2xl), env(safe-area-inset-top)) max(var(--space-lg), env(safe-area-inset-right))
    max(var(--space-2xl), env(safe-area-inset-bottom)) max(var(--space-lg), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  min-height: 100dvh;
}

/* ——— Rótulo ——— */
.head { display: grid; gap: var(--space-md); }

.head__kicker {
  margin: 0;
  font: 700 0.75rem/1 var(--font-text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.head__title { margin: 0; display: grid; gap: var(--space-xs); }

.head__lead {
  font: 600 1.1875rem/1.2 var(--font-text);
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}

.head__name {
  font-family: var(--font-sign);
  font-weight: 800;
  font-stretch: condensed;
  font-size: clamp(4rem, 21vw, 5.75rem);
  line-height: 0.86;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: var(--ink);
  margin-left: -0.04em; /* ajuste óptico del trazo de la C */
}

/* Banda de rodadura */
.tread {
  height: 10px;
  margin-block: var(--space-xs);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M1 0h12L7 9z' fill='%23211d17'/%3E%3C/svg%3E") 0 0 / 14px 10px round no-repeat;
  opacity: 0.88;
  border-radius: 2px;
}

.head__hint {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 34ch;
}
.head__hint strong { color: var(--ink); font-weight: 700; }

/* ——— Cuentas ——— */
.accounts { display: grid; gap: var(--space-lg); }

.acct {
  --bg: var(--mp);
  --fg: var(--mp-ink);
  --fg-soft: var(--mp-ink-soft);
  --btn-bg: var(--mp-ink);
  --btn-fg: var(--mp);

  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  padding: 20px 16px 22px 20px;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.35),
    0 1px 2px oklch(0.25 0.02 80 / 0.08),
    0 8px 24px -8px oklch(0.25 0.02 80 / 0.18);
  overflow: hidden;
  isolation: isolate;
}

/* Brillo de tarjeta física */
.acct::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 90% at 0% 0%, oklch(1 0 0 / 0.22), transparent 60%);
  pointer-events: none;
}

.acct--bbva {
  --bg: var(--rey);
  --fg: var(--rey-ink);
  --fg-soft: var(--rey-ink-soft);
  --btn-bg: var(--rey-ink);
  --btn-fg: var(--rey);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 0.14),
    0 1px 2px oklch(0.25 0.08 264 / 0.12),
    0 10px 26px -8px oklch(0.3 0.15 264 / 0.35);
}
.acct--bbva::before {
  background: radial-gradient(120% 90% at 0% 0%, oklch(1 0 0 / 0.12), transparent 60%);
}

.acct__body { display: grid; gap: var(--space-md); min-width: 0; }

.acct__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
}

.acct__bank {
  margin: 0;
  font: 700 1.0625rem/1.2 var(--font-text);
  letter-spacing: -0.01em;
}

.acct__type {
  font: 700 0.6875rem/1 var(--font-text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-soft);
  padding: 5px 8px 4px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.acct__num {
  margin: 0;
  font-family: var(--font-text);
  font-weight: 700;
  font-size: clamp(1.625rem, 7.4vw, 2.125rem);
  line-height: 1.12;
  letter-spacing: 0.01em;
  word-spacing: 0.18em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-user-select: all;
  user-select: all;
  cursor: text;
}
.acct__chunk { display: inline-block; white-space: nowrap; }

.acct__num::selection,
.acct__chunk::selection { background: var(--fg); color: var(--bg); }

/* ——— Botón copiar ——— */
.copy {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  margin: 0;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 700 0.6875rem/1 var(--font-text);
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.12) inset, 0 4px 10px -4px oklch(0.2 0.02 80 / 0.4);
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.copy:active { transform: scale(0.93); }

.copy:focus { outline: none; }
.copy:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

.copy__icon { position: relative; width: 24px; height: 24px; }

.i {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 200ms var(--ease-out), transform 260ms var(--ease-out);
}
.i--check { opacity: 0; transform: scale(0.5); stroke-width: 2.6; }

.copy.is-copied .i--clip { opacity: 0; transform: scale(0.6); }
.copy.is-copied .i--check { opacity: 1; transform: scale(1); }
.copy.is-copied { animation: pop 380ms var(--ease-out); }

@keyframes pop {
  0% { transform: scale(0.93); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Destello breve del número copiado */
.acct.is-copied .acct__num { animation: flash 700ms var(--ease-out); }
@keyframes flash {
  0% { opacity: 0.45; }
  100% { opacity: 1; }
}

/* ——— Pie ——— */
.foot {
  margin-top: auto;
  padding-top: var(--space-lg);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.foot p { margin: 0; }

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

/* Entrada escalonada */
@media (prefers-reduced-motion: no-preference) {
  .head, .acct, .foot { animation: rise 520ms var(--ease-out) both; }
  .acct--mp { animation-delay: 70ms; }
  .acct--bbva { animation-delay: 140ms; }
  .foot { animation-delay: 210ms; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

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

/* Pantallas amplias: más aire, mismo orden */
@media (min-width: 640px) {
  .page { padding-top: max(var(--space-3xl), 8vh); gap: var(--space-2xl); min-height: 0; }
  .foot { margin-top: 0; }
  .acct { padding: 26px 22px 28px 26px; }
  .copy { width: 72px; height: 72px; border-radius: 18px; }
}
