/* Fideliza Ya! — páginas livianas (sin build). Mobile first.
   Estilo sobrio: fondo claro, tarjetas blancas con borde fino, botón principal negro y un solo acento (verde azulado).
   Se reemplazan por el PWA en Angular. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --text: #111418;
  --soft: #3d4450;
  --muted: #6b7280;
  --primary: #111418;
  --primary-hover: #2a2f37;
  --primary-text: #ffffff;
  --border: #e6e8ec;
  --border-strong: #d3d7de;
  --field: #ffffff;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, .10);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --font: "Archivo", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}

::selection { background: rgba(15, 118, 110, .18); }

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px 64px;
}
main.wide { max-width: 1080px; }

/* ---- barra superior: marca + usuario ---- */
header.brand {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px 24px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}
.brand-name small {
  font-weight: 600;
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2px 8px;
  background: #f0f1f4;
  border-radius: 6px;
}
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: .85rem;
  font-weight: 800;
  line-height: 1;
}
#who { color: var(--muted); font-size: .88rem; }

/* ---- tipografía ---- */
h1, h2, .display {
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.2;
}
h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1.08rem; margin: 0 0 14px; }
h3 { font-size: .98rem; font-weight: 650; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
strong { font-weight: 650; }
.muted { color: var(--muted); font-size: .9rem; }

/* ---- tarjetas ---- */
.card {
  position: relative;
  padding: 20px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.list > .card { margin-bottom: 12px; transition: border-color .15s ease; }
.list > .card:hover { border-color: var(--border-strong); }

/* ---- formularios ---- */
label {
  display: block;
  margin: 16px 0 6px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--soft);
}
label.check, label.inline { font-size: .95rem; font-weight: 400; color: var(--text); }

input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background-color: var(--field);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover { border-color: #b9bec8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.invalid { border-color: var(--error); box-shadow: 0 0 0 3px rgba(185, 28, 28, .10); }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
input::placeholder, textarea::placeholder { color: #9ca3af; }
button:focus-visible, a:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.code-input { letter-spacing: 10px; font-size: 1.5rem; font-weight: 700; text-align: center; }

.check { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; line-height: 1.4; }
.check input { margin-top: 2px; width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

/* ---- botones: negro (principal) y con borde (secundario) ---- */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-text);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
button:hover, .button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button:active, .button:active { transform: scale(.99); }

button.block { width: 100%; margin-top: 20px; min-height: 48px; }
button.secondary, .button.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}
button.secondary:hover, .button.secondary:hover { background: #f3f4f6; border-color: #b9bec8; }
button.small, .button.small { min-height: 34px; padding: 0 12px; font-size: .84rem; }
button:disabled { opacity: .55; cursor: wait; transform: none; }

.link { background: none; border: none; min-height: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.link:hover { background: none; text-decoration: underline; }

/* ---- avisos y estados ---- */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin: 14px 0; font-size: .92rem; }
.alert.error { background: var(--error-bg); color: var(--error); border: 1px solid #fecaca; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #a7f3d0; }

.hidden { display: none !important; }
/* Oculto a la vista pero activo: iOS no abre el selector de archivos de un input con display:none. */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #f3f4f6;
  color: var(--soft);
}
.pill.on, .pill.off { padding-left: 9px; }
.pill.on::before, .pill.off::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.on { color: var(--ok); background: var(--ok-bg); border-color: #a7f3d0; }
.pill.off { color: var(--error); background: var(--error-bg); border-color: #fecaca; }

.url {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .82rem;
  color: var(--soft);
  word-break: break-all;
  background: #f6f7f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.qr { width: 220px; max-width: 100%; background: #fff; border-radius: 12px; padding: 10px; border: 1px solid var(--border); }
.qr.centered { display: block; margin: 10px auto; }

ol.steps { padding-left: 20px; margin: 0; color: var(--soft); }
ol.steps li { margin-bottom: 8px; }
ol.steps strong { color: var(--text); }

.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.mt { margin-top: 16px; }
label.inline { display: inline; margin: 0; }
input.amount { width: 140px; flex: none; }

/* ---- pestañas: subrayado ---- */
.tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  margin-bottom: -1px;
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
}
.tab:hover { background: transparent; color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); background: transparent; }

/* ---- métricas de la plataforma ---- */
#stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
#stats > div {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8f9fb;
  border: 1px solid var(--border);
}
#stats .balance { font-size: 1.9rem; }
#stats .muted { margin-top: 4px; font-size: .78rem; font-weight: 600; }

/* ---- tarjeta de fidelización ---- */
.balance { font-size: 2.6rem; font-weight: 750; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.balance small { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.progress { height: 8px; border-radius: 999px; background: #eceef2; overflow: hidden; margin: 14px 0 8px; }
.progress > div { height: 100%; border-radius: 999px; background: var(--accent); }

.reward-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.reward-row:first-child { border-top: none; }

.big-code { font-size: 2.4rem; font-weight: 700; letter-spacing: 10px; text-align: center; margin: 10px 0; font-family: ui-monospace, Consolas, monospace; }

.history-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); font-size: .92rem; }
.history-row:first-child { border-top: none; }
.plus { color: var(--ok); font-weight: 650; }
.minus { color: var(--error); font-weight: 650; }
code { font-family: ui-monospace, Consolas, monospace; }
.card-code { font-size: 1.2rem; font-weight: 700; letter-spacing: 4px; text-align: center; margin: 10px 0 16px; font-family: ui-monospace, Consolas, monospace; color: var(--soft); }

/* ---- portada del cliente ---- */
.hero { text-align: center; margin: 8px 0 22px; }
.hero-title { font-size: clamp(1.8rem, 7.5vw, 2.4rem); font-weight: 750; line-height: 1.1; margin: 0 auto 14px; max-width: 14ch; }
.hero-rule { width: 48px; height: 3px; border-radius: 2px; background: var(--accent); margin: 0 auto 14px; }
.hero-tenant { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }

/* ---- invitación del dueño pendiente (plataforma) ---- */
.invite-box { padding: 14px 16px; margin-bottom: 14px; border-radius: 12px; border: 1px dashed #99d5cf; background: #f0fdfa; }
.invite-box p { margin-bottom: 10px; }
.invite-warn { color: var(--error); font-size: .9rem; }

/* ---- pie ---- */
.brand-footer { text-align: center; margin-top: 30px; }
.brand-footer .row { justify-content: center; }
.brand-footer .pill { padding: 4px 14px; font-size: .8rem; background: transparent; }

@media (min-width: 720px) {
  h1 { font-size: 1.85rem; }
  .card { padding: 24px; }
}

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

/* ---- escáner de cámara (caja) ---- */
.scan-button { min-height: 60px; font-size: 1.05rem; }
.scanner {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 24px; background: rgba(4, 5, 8, .94); backdrop-filter: blur(6px);
}
.scanner-frame { position: relative; width: min(86vw, 420px); aspect-ratio: 1; border-radius: 28px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2); }
.scanner video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.scanner-target { position: absolute; inset: 14%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 22px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); animation: scan-pulse 1.6s ease-in-out infinite; }
.scanner-hint { color: #d1d5db; text-align: center; max-width: 320px; }
@keyframes scan-pulse { 50% { border-color: rgba(255, 255, 255, .55); } }

/* ---- equipo ---- */
.member-row { padding: 12px 0; border-top: 1px solid var(--border); }
.member-row:first-of-type { border-top: none; }
.member-row p { margin: 2px 0 0; }

/* ---- mensajes Wallet ---- */
textarea { height: auto !important; padding: 14px 16px !important; resize: vertical; line-height: 1.45; }
.wallet-preview { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px;
  background: #f6f7f9; border: 1px solid var(--border); color: #111; }
.wallet-preview .logo-mark { flex: none; }
.wallet-preview .muted { color: #444; margin: 2px 0 0; }

/* ---- mi tarjeta: diseñador ---- */
.design-layout { display: grid; gap: 18px; }
@media (min-width: 880px) { .design-layout { grid-template-columns: 1.15fr .85fr; align-items: start; } }
.design-preview { position: sticky; top: 84px; }
input[type=color] { width: 46px; height: 46px; padding: 3px; border-radius: 10px; border: 1px solid var(--border-strong); background: #fff; cursor: pointer; }
input.hex-input { width: 120px; flex: none; font-family: ui-monospace, Consolas, monospace; text-transform: lowercase; }
.swatch { width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.swatch:hover { border-color: rgba(0,0,0,.4); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.icon-choice { flex-direction: column; gap: 6px; min-height: 84px; padding: 10px 6px; border-radius: 12px; font-size: .74rem;
  font-weight: 600; background: #fff; color: var(--soft); border: 1px solid var(--border); }
.icon-choice img { width: 34px; height: 34px; filter: invert(1); }
.icon-choice.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); box-shadow: 0 0 0 1px var(--accent); }
.icon-choice:hover { background: #f6f7f9; }
.wallet-card { border-radius: 20px; padding: 18px; color: #fff; box-shadow: 0 12px 32px -12px rgba(16,24,40,.35); transition: background .2s ease; }
.wallet-card-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.wallet-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #fff; }
.wallet-card-title { font-size: 1.35rem; font-weight: 750; margin: 12px 0; }
.wallet-card.light { color: #111418; }
.wallet-strip { display: block; width: 100%; aspect-ratio: 1032 / 336; border-radius: 14px; object-fit: cover; }
.wallet-card-foot { display: flex; gap: 14px; justify-content: space-between; align-items: flex-end; margin-top: 14px; }
.wallet-card-foot small { display: block; opacity: .8; }
.wallet-card-foot strong { font-size: 1.15rem; }
.wallet-qr { width: 64px; height: 64px; border-radius: 10px; background:
  repeating-linear-gradient(90deg, #111 0 6px, #fff 6px 12px), #fff; background-blend-mode: difference; border: 6px solid #fff; }
.wallet-promo { margin: 12px 0 0; font-size: .9rem; opacity: .9; }
.strip { display: block; width: 100%; border-radius: 16px; margin-bottom: 14px; aspect-ratio: 1032 / 336; object-fit: cover; }

/* ---- menú con los neones del acrílico (azul, verde azulado, violeta, lima sobre negro) ---- */
header.brand {
  color: #f7f8fb;
  border-bottom: none;
  background:
    radial-gradient(70% 160% at 0% 0%, rgba(67, 56, 202, .85), transparent 60%),
    radial-gradient(45% 200% at 100% 50%, rgba(13, 148, 136, .75), transparent 60%),
    radial-gradient(50% 220% at 55% 130%, rgba(147, 51, 234, .65), transparent 60%),
    radial-gradient(30% 160% at 100% 120%, rgba(132, 204, 22, .45), transparent 60%),
    #06070b;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 6px 20px -10px rgba(6, 7, 11, .6);
}
header.brand .logo-mark { background: transparent; border: 2px solid #fff; border-radius: 50%; color: #fff; }
header.brand .brand-name small { background: rgba(255, 255, 255, .12); color: #e5e7eb; }
header.brand #who, header.brand .muted { color: #d9dce6; }
header.brand button.secondary, header.brand .button.secondary { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .35); }
header.brand button.secondary:hover { background: rgba(255, 255, 255, .16); }
header.brand .link { color: #fff; }

/* pestaña activa: línea con el degradado neón */
.tab.active { border-bottom-color: transparent; background:
  linear-gradient(90deg, #4f46e5, #14b8a6 55%, #84cc16) bottom / 100% 2px no-repeat; }

/* ---- logo del negocio al costado de su nombre ---- */
.tenant-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.tenant-head h1 { margin: 0; }
.tenant-logo { width: 52px; height: 52px; flex: none; border-radius: 12px; object-fit: cover; background: #fff;
  border: 1px solid var(--border); }
.tenant-logo.small { width: 40px; height: 40px; border-radius: 10px; }
