/* 121.tf — identidad visual
   El número es el protagonista.
   Violeta eléctrico = marca. Lima = acción (solo en lo que convierte). Tinta índigo = lectura. */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-latin-ext.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --violet: #5b3df5;
  --violet-strong: #4526e0;
  --violet-soft: #eeebff;
  --violet-glow: rgb(91 61 245 / .16);
  --lime: #c8f53c;
  --lime-strong: #b6e62a;
  --on-lime: #16122e;
  --on-violet: #ffffff;

  --bg: #f7f6fc;
  --surface: #ffffff;
  --ink: #16122e;
  --ink-2: #48445f;
  --muted: #77738f;
  --line: #e7e4f4;
  --soft: #f2f0fb;
  --placeholder: #d9d5ee;
  --night: #16122e;           /* bloque oscuro de llamada a la acción */
  --warn: #c2410c;

  --shadow: 0 1px 2px rgb(22 18 46 / .05), 0 12px 40px rgb(22 18 46 / .08);
  --shadow-violet: 0 10px 30px rgb(91 61 245 / .30);
  --shadow-lime: 0 10px 28px rgb(150 200 20 / .35);
  --radius: 24px;
  --display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", "PingFang SC", "Hiragino Sans", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --violet: #8f7dff;
    --violet-strong: #a797ff;
    --violet-soft: #231d45;
    --violet-glow: rgb(143 125 255 / .20);
    --lime: #d4ff4f;
    --lime-strong: #e2ff82;
    --on-violet: #0e0b1c;
    --bg: #0e0b1c;
    --surface: #17132b;
    --ink: #f3f1ff;
    --ink-2: #cdc8e6;
    --muted: #938db0;
    --line: #2a2448;
    --soft: #1e1938;
    --placeholder: #3a3360;
    --night: #231d45;
    --warn: #fdba74;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 14px 44px rgb(0 0 0 / .4);
    --shadow-violet: 0 10px 30px rgb(143 125 255 / .25);
    --shadow-lime: 0 10px 30px rgb(212 255 79 / .18);
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(700px 420px at 12% -120px, var(--violet-glow), transparent 70%),
    radial-gradient(600px 380px at 92% -80px, rgb(200 245 60 / .16), transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
.icon { flex: none; }

:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 8px; }

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

.muted { color: var(--muted); }

/* ---------- Estructura ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 20px 14px;
  max-width: 1080px; width: 100%; margin: 0 auto;
}

.brand {
  display: inline-flex; align-items: center; gap: 3px; text-decoration: none;
  font-family: var(--display); direction: ltr; unicode-bidi: isolate;
}
.brand-key {
  position: relative; display: inline-grid; place-items: center;
  height: 36px; padding: 0 10px; border-radius: 11px;
  background: var(--violet); color: var(--on-violet);
  font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18), var(--shadow-violet);
}
.brand-key::after {
  content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 0 2px var(--bg);
}
.brand-tf { font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }

.topbar-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lang { min-width: 0; }

.lang select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 14px; font-size: 16px; color: var(--ink-2); cursor: pointer;
  max-width: 100%; text-overflow: ellipsis;
}
.lang select:hover { border-color: var(--violet); }

.page {
  flex: 1; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 24px 16px 48px;
}

.footer {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 18px;
  padding: 20px 16px max(20px, env(safe-area-inset-bottom));
  color: var(--muted); font-size: 13px; text-align: center;
}
.footer a { font-weight: 650; color: var(--ink-2); }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--lime); color: var(--on-lime); box-shadow: var(--shadow-lime); }
.btn-primary:hover { background: var(--lime-strong); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 16px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--violet-soft); color: var(--violet); }

.link-btn {
  border: 0; background: none; padding: 0; color: inherit; font-size: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Portada ---------- */

.is-home .page { max-width: 760px; }

.hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-top: clamp(16px, 6vh, 72px);
}

.slogan {
  margin: 0; font-family: var(--display); font-size: clamp(44px, 10vw, 84px); line-height: .95;
  font-weight: 700; letter-spacing: -.05em; text-wrap: balance;
}

.lead {
  margin: 20px 0 72px; max-width: 32ch; color: var(--ink-2); font-size: clamp(17px, 2.4vw, 19px);
  text-wrap: balance;
}

.search-stage { position: relative; width: 100%; max-width: 480px; }

.search { position: relative; width: 100%; }
.search input {
  width: 100%; height: 80px; padding: 0 88px 0 30px;
  border: 2px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow);
  font-family: var(--display); font-size: 38px; font-weight: 700; letter-spacing: .01em;
  font-variant-numeric: tabular-nums; outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
[dir="rtl"] .search input { padding: 0 30px 0 88px; }
.search input::placeholder { color: var(--placeholder); }
.search input:focus { border-color: var(--violet); box-shadow: 0 0 0 7px var(--violet-glow), var(--shadow); }
.search button {
  position: absolute; inset-inline-end: 11px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 58px; height: 58px;
  border: 0; border-radius: 999px; background: var(--violet); color: var(--on-violet); cursor: pointer;
  box-shadow: var(--shadow-violet); transition: transform .15s ease, background-color .15s ease;
}
.search button:hover { background: var(--violet-strong); }
[dir="rtl"] .search button .icon { transform: scaleX(-1); }
.search button:active { transform: translateY(-50%) scale(.95); }

/* Escena: alguien dice su número… y aparece la tarjeta */
.bubble {
  position: absolute; left: -14px; top: -52px; z-index: 2; margin: 0;
  padding: 10px 16px; border-radius: 18px 18px 18px 4px;
  background: var(--night); color: #fff; font-family: var(--display); font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow); transform: rotate(-3deg);
  animation: float 6s ease-in-out infinite;
}
.bubble::before { content: "“"; color: var(--lime); font-size: 20px; line-height: 0; margin-inline-end: 4px; }
[dir="rtl"] .bubble { left: auto; right: -14px; border-radius: 18px 18px 4px 18px; }

.mini-card {
  position: absolute; right: -215px; top: 18px; z-index: 0; width: 190px;
  display: grid; grid-template-columns: 38px 1fr; gap: 6px 10px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  text-align: start; transform: rotate(5deg); animation: float 7s ease-in-out infinite reverse;
}
.mini-avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--violet-soft); color: var(--violet); font: 700 14px var(--display);
}
.mini-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mini-body strong { font: 700 14px/1.1 var(--display); }
.mini-line { display: flex; align-items: center; gap: 6px; color: var(--violet); }
.mini-line i { display: block; height: 6px; flex: 1; border-radius: 3px; background: var(--soft); }
.mini-num {
  grid-column: 1 / -1; justify-self: start; padding: 3px 9px; border-radius: 999px;
  background: var(--lime); color: var(--on-lime); font: 700 12px var(--display);
}

@keyframes float { 50% { translate: 0 -6px; } }

@media (max-width: 1120px) {
  .mini-card { display: none; }
}
@media (max-width: 640px) {
  .lead { margin-bottom: 64px; }
  .bubble { left: 8px; top: -46px; font-size: 14px; }
  [dir="rtl"] .bubble { right: 8px; }
  .search input { height: 72px; font-size: 32px; }
  .search button { width: 52px; height: 52px; }
}

.search-hint {
  min-height: 24px; margin: 12px 0 22px; font-size: 14px; font-weight: 650; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.search-hint.is-found { color: var(--violet); }

.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-top: clamp(44px, 10vh, 96px);
}
.step {
  padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); text-align: start;
}
.step h2 { margin: 14px 0 4px; font: 700 18px/1.2 var(--display); letter-spacing: -.02em; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.step-num {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--violet); color: var(--on-violet); font: 700 18px var(--display);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18);
}
.step:nth-child(2) .step-num { background: var(--lime); color: var(--on-lime); }
.step:nth-child(3) .step-num { background: var(--night); color: #fff; }

@media (max-width: 640px) {
  .steps { grid-template-columns: 1fr; gap: 12px; }
  .step { display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; padding: 18px; }
  .step-num { grid-row: span 2; }
  .step h2 { margin-top: 2px; }
}

/* ---------- Tarjeta ---------- */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}

.card-id {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 10px 20px; background: var(--violet); color: var(--on-violet);
}
[dir="rtl"] .card-id { padding: 10px 20px 10px 10px; }
.card-id .icon-btn { color: var(--on-violet); }
.card-id .icon-btn:hover { background: rgb(255 255 255 / .16); color: var(--on-violet); }

.card-num, .big-num {
  font-family: var(--display); font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate;
}
.card-num { font-size: 22px; }
.card-num span { opacity: .7; font-weight: 500; }
.big-num { color: var(--violet); }
.big-num span { color: var(--muted); font-weight: 500; }

.card-head { padding: 28px 22px 22px; text-align: center; }
.card-head h1 { margin: 16px 0 4px; font: 700 28px/1.1 var(--display); letter-spacing: -.035em; }
.card-head .role { margin: 0; color: var(--ink-2); }
.card-head .muted { margin: 2px 0 0; font-size: 14px; }

.card-image { width: 100%; height: auto; margin-bottom: 16px; }

.avatar {
  width: 96px; height: 96px; margin: 0 auto; border-radius: 30px; object-fit: cover;
  background: var(--soft); box-shadow: var(--shadow);
}
.avatar-initials {
  display: grid; place-items: center; font: 700 34px var(--display); letter-spacing: -.03em;
  background: var(--lime); color: var(--on-lime); transform: rotate(-4deg);
}

.actions {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px;
  padding: 0 16px 20px;
}
.action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 13px 4px; border-radius: 16px; background: var(--violet-soft); color: var(--violet);
  font-size: 12.5px; font-weight: 700; text-decoration: none; text-align: center;
  transition: background-color .15s ease, transform .15s ease;
}
.action:hover { transform: translateY(-2px); }
.action:active { transform: scale(.97); }
.action-primary { background: var(--lime); color: var(--on-lime); box-shadow: var(--shadow-lime); }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows:empty { display: none; }
.rows li + li { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 22px; text-decoration: none;
  color: var(--ink-2);
}
a.row:hover { background: var(--soft); }
a.row:hover .row-value { color: var(--violet); }
.row .icon { margin-top: 12px; color: var(--violet); }
.row-text { display: flex; flex-direction: column; min-width: 0; }
.row-label { font-size: 12.5px; color: var(--muted); }
.row-value { color: var(--ink); overflow-wrap: anywhere; transition: color .15s ease; }
[dir="rtl"] .row-value[dir="ltr"] { text-align: right; }

.qr { border-top: 1px solid var(--line); }
.qr summary {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px;
  font-size: 14px; font-weight: 700; color: var(--ink-2); cursor: pointer; list-style: none;
}
.qr summary:hover { color: var(--violet); }
.qr summary::-webkit-details-marker { display: none; }
.qr img { margin: 0 auto 24px; border-radius: 12px; background: #fff; padding: 8px; }

.cta {
  /* Los brillos son parte del fondo (sin capas desenfocadas): Safari los recorta bien en las esquinas */
  margin-top: 24px; padding: 30px 22px; text-align: center; border-radius: var(--radius);
  color: #fff;
  background:
    radial-gradient(120% 90% at 0% 0%, rgb(91 61 245 / .60), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, rgb(200 245 60 / .28), transparent 60%),
    var(--night);
}
.cta h2 { margin: 0 0 6px; font: 700 23px/1.15 var(--display); letter-spacing: -.03em; }
.cta p { margin: 0 0 18px; color: rgb(255 255 255 / .78); font-size: 15px; }

/* ---------- Estados: número libre, tarjeta privada ---------- */

.state {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding-top: clamp(24px, 8vh, 80px);
}
.state h1 { margin: 0; font: 700 28px/1.15 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.state > p { margin: 0 0 12px; max-width: 34ch; }
.state .btn { width: 100%; max-width: 320px; }
.big-num { margin: 0 0 8px; font-size: clamp(56px, 16vw, 96px); line-height: .9; }
.big-num span { font-size: .36em; letter-spacing: -.01em; }
.state-icon {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px;
  background: var(--violet); color: var(--on-violet); box-shadow: var(--shadow-violet);
}

.key-form { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 320px; }
.key-form input {
  width: 100%; height: 62px; padding: 0 20px; text-align: center;
  border: 2px solid var(--line); border-radius: 999px; background: var(--surface);
  font: 700 26px var(--display); letter-spacing: .3em; outline: none;
}
.key-form input::placeholder { letter-spacing: normal; font: 400 16px var(--font); color: var(--muted); }
.key-form input:focus { border-color: var(--violet); box-shadow: 0 0 0 7px var(--violet-glow); }
.key-form input[aria-invalid="true"] { border-color: var(--warn); }
.error { margin: 0; color: var(--warn); font-size: 14px; font-weight: 650; }

/* ---------- Ayuda ---------- */

.sheet {
  width: min(640px, 100vw - 24px); max-height: min(86vh, 900px); padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
}
.sheet::backdrop { background: rgb(14 11 28 / .45); backdrop-filter: blur(4px); }
.sheet-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px 14px 22px; background: var(--surface); border-bottom: 1px solid var(--line);
}
[dir="rtl"] .sheet-head { padding: 14px 22px 14px 12px; }
.sheet-head h2 { margin: 0; font: 700 20px var(--display); letter-spacing: -.02em; }
.sheet-body { padding: 8px 22px 24px; }

.faq { border-bottom: 1px solid var(--line); }
.faq summary {
  padding: 14px 0; font-weight: 650; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--violet); font-weight: 700; }
.faq[open] summary { color: var(--violet); }
.faq[open] summary::after { content: "–"; }
.faq p { margin: 0 0 16px; color: var(--ink-2); }

.notice { margin: 20px 0; padding: 16px 18px; border-radius: 16px; background: var(--violet-soft); }
.notice strong { color: var(--violet); }
.notice p { margin: 4px 0 0; color: var(--ink-2); }
.about { font-size: 13px; color: var(--muted); }
.about a { font-weight: 650; }

/* ---------- Aviso breve ---------- */

.toast {
  /* Siempre arriba y por encima de todo (paneles, barra fija, ayuda) */
  position: fixed; z-index: 2147483000; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 6px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 18px 12px 12px; border-radius: 18px; background: var(--night); color: #fff;
  box-shadow: 0 12px 40px rgb(14 11 28 / .35), 0 0 0 1px rgb(255 255 255 / .08);
  animation: toast-in .28s cubic-bezier(.2, .8, .2, 1);
}
.toast-icon {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--lime); color: var(--on-lime);
}
.toast-text { display: flex; flex-direction: column; min-width: 0; }
.toast-text strong { font-size: 15.5px; font-weight: 700; line-height: 1.2; }
.toast-text small { font-size: 13px; color: rgb(255 255 255 / .72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -16px); } }

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

/* ---------- Formularios: alta y gestión ---------- */

.is-form .page { max-width: 640px; }

.form-hero { text-align: center; padding: clamp(8px, 4vh, 40px) 0 20px; }
.form-hero h1 { margin: 0; font: 700 clamp(34px, 8vw, 52px)/1 var(--display); letter-spacing: -.045em; }
.lead-sm { margin: 12px auto 0; max-width: 40ch; color: var(--ink-2); text-wrap: balance; }

.alert {
  margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; font-weight: 650; font-size: 15px;
  background: #fff1e6; color: var(--warn); border: 1px solid #fed7aa;
}
.alert-ok { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
@media (prefers-color-scheme: dark) { .alert:not(.alert-ok) { background: #3a2410; border-color: #7c3a0e; } }

.card-form { display: flex; flex-direction: column; gap: 14px; }

.form-block {
  padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.form-block h2 { margin: 0 0 16px; font: 700 20px var(--display); letter-spacing: -.02em; }
.form-block h3 { margin: 20px 0 10px; font-size: 14px; color: var(--muted); font-weight: 700; }
.form-more { padding: 0; }
.form-more > summary {
  display: flex; align-items: center; gap: 10px; padding: 18px 22px; cursor: pointer; list-style: none;
  font: 700 17px var(--display); letter-spacing: -.01em;
}
.form-more > summary::-webkit-details-marker { display: none; }
.form-more > summary .icon { color: var(--violet); }
.form-more > summary::after { content: "+"; margin-inline-start: auto; color: var(--violet); font-size: 22px; font-weight: 500; }
.form-more[open] > summary::after { content: "–"; }
.form-more[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.form-more > :not(summary) { margin-inline: 22px; }
.form-more > :last-child { margin-bottom: 22px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span:first-child { font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="date"] {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); font-size: 16px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.field input:focus { border-color: var(--violet); background: var(--surface); box-shadow: 0 0 0 5px var(--violet-glow); }
.field input[aria-invalid="true"] { border-color: var(--warn); }
.hint { font-size: 13px; color: var(--muted); }
.hint.is-error { color: var(--warn); font-weight: 600; }
.hint.is-ok { color: var(--violet); font-weight: 650; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.number-input {
  display: flex; align-items: center; height: 68px; padding: 0 18px; border-radius: 18px;
  border: 2px solid var(--line); background: var(--bg); transition: border-color .15s ease, box-shadow .15s ease;
  direction: ltr;
}
.number-input:focus-within { border-color: var(--violet); background: var(--surface); box-shadow: 0 0 0 6px var(--violet-glow); }
.number-prefix { font: 500 22px var(--display); color: var(--muted); }
.field .number-input input[type="text"] {
  flex: 1; min-width: 0; height: 100%; padding: 0 0 0 2px; border: 0; border-radius: 0; background: transparent; outline: none; box-shadow: none;
  font: 700 32px var(--display); letter-spacing: -.01em; color: var(--violet);
}
.field-number:has([aria-invalid="true"]) .number-input { border-color: var(--warn); }

.image-drop {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 16px;
  border-radius: 16px; border: 1.5px dashed var(--line); background: var(--bg); cursor: pointer;
  transition: border-color .15s ease;
}
.image-drop:hover { border-color: var(--violet); }
.image-drop img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.image-drop-text { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--violet); }
.image-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); margin-top: 4px; }

.choice-group { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 16px;
  border: 1.5px solid var(--line); cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.choice:has(input:checked) { border-color: var(--violet); background: var(--violet-soft); }
.choice input { margin-top: 4px; accent-color: var(--violet); width: 18px; height: 18px; }
.choice strong { display: block; font: 700 16px var(--display); }
.choice small { color: var(--muted); font-size: 13.5px; }

.form-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 0 max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
}
.form-actions .btn { width: 100%; max-width: 380px; }
.fine { margin: 4px auto 0; font-size: 12.5px; color: var(--muted); text-align: center; max-width: 46ch; }

/* ---------- Gestión ---------- */

.manage-hero { text-align: center; padding: clamp(8px, 4vh, 36px) 0 18px; }
.manage-hero .big-num { margin: 10px 0 6px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px; border-radius: 999px;
  font-weight: 700; font-size: 14px;
}
.badge-lime { background: var(--lime); color: var(--on-lime); }
.status { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 650; color: var(--ink-2); }
.status span { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgb(200 245 60 / .3); }
.status-1 span { background: var(--violet); box-shadow: 0 0 0 3px var(--violet-glow); }
.status-2 span { background: var(--muted); box-shadow: none; }

.panel {
  margin-top: 16px; padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.panel > h2 { margin: 0 0 16px; font: 700 20px var(--display); letter-spacing: -.02em; }
.panel .card-form .form-block { box-shadow: none; }
#editar .form-block { padding: 0; border: 0; }
#editar .form-more { border: 1px solid var(--line); }
#editar .form-more > summary { padding: 16px 18px; }
#editar .form-more > :not(summary) { margin-inline: 18px; }

.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 16px;
  border: 0; background: var(--violet-soft); color: var(--violet); font-size: 13px; font-weight: 700;
  text-decoration: none; text-align: center; cursor: pointer; transition: transform .15s ease;
}
.tile:hover { transform: translateY(-2px); }
.share-preview { width: 100%; height: auto; margin-top: 14px; border-radius: 14px; }

.key-box { margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--soft); }
.key-box p { margin: 0 0 12px; color: var(--ink-2); }
.key { font: 700 24px var(--display); letter-spacing: .2em; color: var(--violet); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input {
  flex: 1; min-width: 150px; height: 50px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 16px; outline: none;
}
.inline-form input:focus { border-color: var(--violet); box-shadow: 0 0 0 5px var(--violet-glow); }

.panel-danger > summary { cursor: pointer; font-weight: 700; color: var(--warn); list-style: none; }
.panel-danger > summary::-webkit-details-marker { display: none; }
.panel-danger p { color: var(--ink-2); }
.btn-danger { background: var(--warn); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }

.stack-form input[type="email"] {
  width: 100%; height: 56px; padding: 0 20px; text-align: center; border: 2px solid var(--line);
  border-radius: 999px; background: var(--surface); font-size: 16px; outline: none;
  font: 400 16px var(--font); letter-spacing: normal;
}
.stack-form input[type="email"]:focus { border-color: var(--violet); box-shadow: 0 0 0 7px var(--violet-glow); }
.stack-form input[name="n"] { letter-spacing: .04em; }

/* ==========================================================================
   Móvil primero (iPhone, iPad): toques, teclado, zonas seguras y hoja inferior
   ========================================================================== */

html { -webkit-tap-highlight-color: transparent; }
/* Nada se desliza de lado: Safari en iPhone necesita el recorte también en <html> */
html { overflow-x: hidden; }
html, body { overflow-x: clip; max-width: 100%; }
img, video, audio, iframe, canvas, svg, table, pre { max-width: 100%; }
input, select, textarea, button { max-width: 100%; }
a, button, summary, label, select, input[type="radio"], input[type="checkbox"] { touch-action: manipulation; }

/* Zonas seguras laterales (iPhone en horizontal) */
.topbar, .page, .footer {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* Objetivos táctiles de al menos 44 px; campos a 16 px para que Safari no haga zoom */
.icon-btn { width: 44px; height: 44px; }
.lang select { min-height: 44px; font-size: 16px; padding: 0 16px; }
.footer .link-btn { padding: 12px 6px; }
.check { min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--violet); }

/* Fecha en iOS: altura y alineación como los demás campos */
.field input[type="date"] {
  -webkit-appearance: none; appearance: none; display: flex; align-items: center; min-width: 0; color: var(--ink);
}
.field input[type="date"]::-webkit-date-and-time-value { text-align: start; }

/* En pantallas táctiles no hay «pasar por encima»: los efectos se quedarían pegados tras tocar */
@media (hover: none) {
  .btn-primary:hover { background: var(--lime); transform: none; }
  .btn-ghost:hover { border-color: var(--line); color: var(--ink); }
  .icon-btn:hover { background: transparent; color: var(--ink-2); }
  .action:hover, .tile:hover { transform: none; }
  a.row:hover { background: transparent; }
  a.row:hover .row-value { color: var(--ink); }
  .lang select:hover, .image-drop:hover { border-color: var(--line); }
  .search button:hover { background: var(--violet); }
}
/* …y en su lugar, respuesta inmediata al tocar */
.btn:active, .action:active, .tile:active, .icon-btn:active { transform: scale(.96); }
a.row:active, .faq summary:active, .form-more > summary:active { background: var(--soft); }
.icon-btn:active { background: var(--violet-soft); color: var(--violet); }

/* Ayuda como hoja que sube desde abajo (estilo iOS) */
html.has-sheet { overflow: hidden; }
.sheet { overscroll-behavior: contain; }
@media (max-width: 640px) {
  .sheet {
    width: 100%; max-width: 100%; max-height: 88dvh; margin: auto 0 0;
    border-radius: 26px 26px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sheet[open] { animation: sheet-up .32s cubic-bezier(.2, .8, .2, 1); }
  .sheet-head { padding-top: 22px; }
  .sheet-head::before {
    content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px;
    border-radius: 3px; background: var(--line);
  }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

/* Tarjeta: barra fija con «Llamar» y «Guardar» al desplazarse */
.dock {
  position: fixed; z-index: 30; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; padding: 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateY(calc(100% + 40px)); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.dock.is-visible { transform: none; }
.dock .btn { flex: 1; min-width: 0; min-height: 48px; box-shadow: none; }
@media (min-width: 900px) { .dock { display: none; } }
/* El hueco para la barra fija va DEBAJO del pie, para que el pie se pueda ver entero */
@media (max-width: 899px) { .is-card .footer { padding-bottom: calc(104px + env(safe-area-inset-bottom)); } }

/* Con el teclado abierto, nada fijo tapa el campo que se está escribiendo */
html.is-typing .form-actions { position: static; background: none; }
html.is-typing .dock { transform: translateY(calc(100% + 40px)); }

/* Móviles pequeños (iPhone SE / mini) */
@media (max-width: 380px) {
  .topbar { gap: 8px; padding-inline: 12px; }
  .topbar-actions { gap: 2px; }
  .lang select { padding: 7px 10px; max-width: 104px; }
  .dock { gap: 6px; padding: 6px; }
  .dock .btn { padding-inline: 10px; font-size: 15px; }
  .slogan { font-size: 40px; }
  .search input { height: 66px; font-size: 28px; padding-left: 22px; }
  .search button { width: 48px; height: 48px; }
  .actions { gap: 6px; padding-inline: 12px; }
  .action { font-size: 11.5px; padding: 11px 2px; }
  .card-head h1 { font-size: 24px; }
  .number-prefix { font-size: 18px; }
  .field .number-input input[type="text"] { font-size: 26px; }
}

/* ---------- Portada: para quién es ---------- */

.uses { margin-top: clamp(44px, 9vh, 88px); text-align: center; }
.uses-title {
  margin: 0 auto 22px; max-width: 22ch; font: 700 clamp(26px, 5vw, 38px)/1.1 var(--display); letter-spacing: -.035em;
  text-wrap: balance;
}
.uses-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; text-align: start; }
.use { padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.use h3 { margin: 12px 0 4px; font: 700 18px/1.2 var(--display); letter-spacing: -.02em; }
.use p { margin: 0; color: var(--muted); font-size: 14.5px; }
.use-icon {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  background: var(--violet-soft); color: var(--violet);
}
.use:nth-child(2) .use-icon { background: var(--lime); color: var(--on-lime); }
.use:nth-child(3) .use-icon { background: var(--night); color: #fff; }
@media (max-width: 560px) { .uses-grid { grid-template-columns: 1fr; } }
.is-home .steps { margin-top: 28px; }

/* ---------- Pie ---------- */

.footer { flex-direction: column; gap: 4px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; }
.footer-links a, .footer-links .link-btn {
  display: inline-block; padding: 10px 2px; color: var(--muted); font-size: 13px; text-decoration: none; font-weight: 500;
}
.footer-links a:hover { color: var(--violet); }

/* ---------- Archivos en la tarjeta ---------- */

.media { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 16px; border-top: 1px solid var(--line); }
.media-image { display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--soft); }
.media-image img { width: 100%; height: 100%; object-fit: cover; }
.media-video { grid-column: 1 / -1; width: 100%; max-height: 70vh; border-radius: 14px; background: #000; }
.media-audio { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--soft); }
.media-audio span { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; color: var(--ink-2); overflow-wrap: anywhere; }
.media-audio span .icon { color: var(--violet); }
.media-audio audio { width: 100%; }

/* ---------- Archivos en la gestión ---------- */

.file-list { list-style: none; margin: 0 0 14px; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.file-item {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 2px; text-decoration: none; color: var(--ink);
}
.file-item .icon { color: var(--violet); }
.file-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-add .image-drop { justify-content: center; }
.image-drop.is-busy { opacity: .6; pointer-events: none; }
.image-drop.is-busy .image-drop-text::after { content: "…"; }

/* ---------- Mis números ---------- */

.state-compact { padding-top: 0; }
.signed-as { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 18px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.signed-as a { color: var(--violet); font-weight: 650; }
.center { text-align: center; }
.my-cards { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.my-card { border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.my-card-main { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 12px; text-decoration: none; color: var(--ink); }
.my-card-num { font: 700 28px/1 var(--display); letter-spacing: -.03em; color: var(--violet); direction: ltr; unicode-bidi: isolate; }
.my-card-num span { font-size: 15px; font-weight: 500; color: var(--muted); }
.my-card-title { font-weight: 650; }
.my-card .status { font-size: 13.5px; }
.my-card-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.my-card-actions .btn { flex: 1; min-height: 44px; box-shadow: none; }
.btn-block { display: flex; width: 100%; }
.back-link { margin: 8px 0 0; }
.back-link a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--violet); font-weight: 650; text-decoration: none; }

/* ---------- Páginas legales ---------- */

.is-legal .page { max-width: 720px; }
.legal { padding: 8px 0 24px; line-height: 1.65; }
.legal h1 { margin: 8px 0 4px; font: 700 clamp(30px, 6vw, 42px)/1.1 var(--display); letter-spacing: -.035em; }
.legal-date { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.legal h2 { margin: 30px 0 8px; font: 700 20px/1.25 var(--display); letter-spacing: -.02em; }
.legal ul { padding-inline-start: 20px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--violet); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 14px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.legal th, .legal td { padding: 10px 12px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.legal th { background: var(--soft); font-weight: 700; }
.legal tr:last-child td { border-bottom: 0; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); }
.legal-nav a { padding: 8px 14px; border-radius: 999px; background: var(--violet-soft); text-decoration: none; font-weight: 650; font-size: 14px; }

/* Compartir: confirmación visible en el propio botón */
.icon-btn.is-done { width: auto; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; border-radius: 999px; }
.card-id .icon-btn.is-done { background: rgb(255 255 255 / .18); color: var(--on-violet); }
.done-label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.tile.is-done { background: var(--lime); color: var(--on-lime); }

/* ---------- Acceso del titular desde la tarjeta · cambiar número y e-mail ---------- */

.own-link { margin: 14px 0 0; text-align: center; }
.own-link a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; border-radius: 999px;
}
.own-link a:hover, .own-link a:active { color: var(--violet); background: var(--violet-soft); }
.warn-note {
  margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; font-size: 14px;
  background: #fff4e6; color: #8a3a0a; border: 1px solid #fed7aa;
}
@media (prefers-color-scheme: dark) { .warn-note { background: #3a2410; color: #fdba74; border-color: #7c3a0e; } }
#numero form .btn { width: 100%; }
#email p { margin: 0 0 8px; }
#email p:first-of-type { font-weight: 650; overflow-wrap: anywhere; }

/* Clave de tarjeta privada: se escribe oculta, pero no es un campo de contraseña (el llavero no la guarda ni la rellena) */
.key-input { -webkit-text-security: disc; text-security: disc; }
.key-note { margin: -4px 0 12px !important; font-size: 13.5px; }

/* Alta: el campo «Elige tu clave» aparece solo al marcar «Privada, con clave» */
.key-choose { display: none; margin: 14px 0 0; }
.choice-group:has(input[value="1"]:checked) ~ .key-choose { display: flex; }
.field.key-choose input[type="text"] {
  max-width: 200px; font: 700 24px var(--display); letter-spacing: .35em; text-align: center;
}
.field.key-choose input::placeholder { color: var(--placeholder); letter-spacing: .35em; }

/* Etiqueta de visibilidad en la cabecera de la tarjeta: pública / privada / en pausa */
.card-id-main { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.card-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; line-height: 1.2; white-space: nowrap;
}
.card-badge.is-public { background: rgb(255 255 255 / .18); color: var(--on-violet); }
.card-badge.is-private { background: var(--lime); color: var(--on-lime); }
.card-badge.is-paused { background: rgb(0 0 0 / .25); color: #fff; }
@media (prefers-color-scheme: dark) { .card-badge.is-public { background: rgb(0 0 0 / .18); } }
