/* ============================================================
   WOYAL — Sistema de diseño v2 "Lineal"
   Blanco dominante · tipografía grande y fina · bloques de color
   redondeados · chips de contorno · nav oscura
   ============================================================ */

:root {
  /* Paleta */
  --blanco: #FFFFFF;
  --fondo: #F6F6F7;
  --negro: #17181C;
  --gris: rgba(23, 24, 28, .55);
  --gris-tenue: rgba(23, 24, 28, .38);
  --linea: rgba(23, 24, 28, .16);

  /* Bloques de color (la firma visual) */
  --lila: #CDA9F2;
  --lima: #DCE95A;
  --cobalto: #4646DD;
  --naranja: #E4522B;
  --rosa: #F6BDB4;

  /* Alias heredados (mantienen vivas las pantallas) */
  --crema: var(--fondo);
  --tinta: var(--negro);
  --tinta-suave: var(--gris);
  --tinta-tenue: var(--gris-tenue);
  --terra: var(--naranja);
  --terra-hover: #C94722;
  --terra-suave: var(--rosa);
  --terra-bg: rgba(228, 82, 43, .08);
  --verde: var(--cobalto);
  --verde-noche: var(--negro);
  --oro: var(--lima);

  /* Tipografía — grotesca fina estilo Helvetica Now */
  --font-display: "Switzer", "Helvetica Neue", Helvetica, system-ui, sans-serif;
  --font-body: "Switzer", "Helvetica Neue", Helvetica, system-ui, sans-serif;

  /* Ritmo */
  --radius: 24px;
  --radius-lg: 34px;
  --sombra-suave: 0 1px 2px rgba(23,24,28,.04), 0 10px 30px rgba(23,24,28,.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--blanco);
  color: var(--negro);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* Titulares: grandes, finos, tracking apretado — como la referencia */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6.5vw, 3.8rem); font-weight: 300; }
h2 { font-size: 1.35rem; }
.serif-i { font-style: italic; font-weight: 300; }

.wrap { width: min(1160px, calc(100% - 40px)); margin-inline: auto; padding-block: 28px 80px; }
.wrap-sm { width: min(520px, calc(100% - 36px)); margin-inline: auto; padding-block: 28px 80px; }

.kicker {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gris); margin-bottom: 14px;
}
.sub { color: var(--gris); margin: 12px 0 26px; max-width: 58ch; font-size: 16.5px; font-weight: 400; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 500; letter-spacing: -0.01em;
  padding: 15px 26px; border-radius: 999px; border: none;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:active { transform: scale(.97); }
.btn-terra { background: var(--negro); color: #fff; }
.btn-terra:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23,24,28,.22); }
.btn-tinta { background: var(--cobalto); color: #fff; }
.btn-tinta:hover { transform: translateY(-2px); }
.btn-linea { background: transparent; color: var(--negro); box-shadow: inset 0 0 0 1.5px var(--negro); }
.btn-linea:hover { background: var(--fondo); }
.btn-block { width: 100%; }
.btn-sm { padding: 11px 20px; font-size: 14.5px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* Flecha circular oscura (detalle firma de la referencia) */
.flecha {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--negro); color: #fff;
  display: grid; place-items: center; font-size: 18px;
  transition: transform .16s ease;
}
.bloque:hover .flecha { transform: translateX(4px); }

/* ---------- Bloques de color (lista tipo "My collections") ---------- */
.bloques { display: flex; flex-direction: column; gap: 14px; }
.bloque {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 26px 24px; border-radius: var(--radius-lg);
  text-decoration: none; color: var(--negro);
  transition: transform .16s ease;
}
.bloque:hover { transform: translateY(-2px); }
.bloque .t { font-size: 2.1rem; font-weight: 300; letter-spacing: -0.045em; line-height: 1.02; }
.bloque .chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.bloque.lila { background: var(--lila); }
.bloque.lima { background: var(--lima); }
.bloque.cobalto { background: var(--cobalto); color: #fff; }
.bloque.cobalto .chip-o { border-color: rgba(255,255,255,.7); color: #fff; }
.bloque.cobalto .flecha { background: #fff; color: var(--negro); }
.bloque.naranja { background: var(--naranja); color: #fff; }
.bloque.naranja .chip-o { border-color: rgba(255,255,255,.7); color: #fff; }
.bloque.naranja .flecha { background: #fff; color: var(--negro); }

/* Chip de contorno fino (pills de la referencia) */
.chip-o {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid var(--negro); background: transparent;
  font-size: 13.5px; font-weight: 450; letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ---------- Tarjeta wallet ---------- */
.wcard {
  --wc-bg: var(--cobalto);
  --wc-bg2: color-mix(in srgb, var(--wc-bg) 78%, #000);
  --wc-fg: #fff;
  --wc-sello: #F2F2ED;
  width: 100%; max-width: 380px;
  background: linear-gradient(160deg, var(--wc-bg), var(--wc-bg2));
  color: var(--wc-fg);
  border-radius: 30px; padding: 24px 24px 22px;
  box-shadow: 0 24px 60px rgba(23,24,28,.22);
  position: relative; overflow: hidden;
  margin-inline: auto;
}
.wcard-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.wcard-logo {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  background: rgba(255,255,255,.16); display: grid; place-items: center;
  font-size: 22px; font-weight: 500;
}
.wcard-tipo { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; opacity: .7; font-weight: 500; }
.wcard-nombre { font-size: 20px; font-weight: 500; letter-spacing: -0.03em; }
.wcard-miembro { margin-bottom: 16px; }
.wcard-miembro small { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.wcard-miembro strong { font-size: 17px; font-weight: 500; }
.wcard-sellos { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; position: relative; z-index: 1; }
.wsello {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px dashed rgba(255,255,255,.5);
  display: grid; place-items: center;
  font-size: 15px; color: var(--wc-sello);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), background .3s ease;
}
.wsello.on { background: var(--wc-sello); border: 1.5px solid var(--wc-sello); color: var(--negro); }
.wsello.pop-in { animation: selloPop .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes selloPop { 0% { transform: scale(.3); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.wcard-balance { font-size: 40px; font-weight: 400; letter-spacing: -0.04em; margin-bottom: 8px; }
.wcard-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; position: relative; z-index: 1; }
.wcard-foot small { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.wcard-foot strong { font-size: 15px; font-weight: 500; }
.wcard-qr { background: #fff; border-radius: 14px; padding: 7px; width: 86px; height: 86px; flex-shrink: 0; }
.wcard-qr img { width: 100%; height: 100%; display: block; }
.wcard-premio {
  display: inline-block; background: var(--lima); color: var(--negro);
  border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 12px;
  position: relative; z-index: 1;
}

/* ---------- Chips de acción ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--blanco); border: 1.5px solid var(--linea);
  font-size: 14px; font-weight: 450;
  transition: border-color .16s ease, transform .14s ease;
}
button.chip:hover { border-color: var(--negro); transform: translateY(-1px); }
.chip.on { border-color: var(--negro); background: var(--negro); color: #fff; font-weight: 500; }
.pill {
  display: inline-block; border-radius: 999px; padding: 3px 12px;
  font-size: 12px; font-weight: 550; border: 1.5px solid var(--linea); color: var(--gris);
}

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 7px; text-align: left; margin-bottom: 16px; }
.field label { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gris); }
.field input, .field select, .field textarea {
  padding: 15px 18px; border-radius: 16px;
  border: 1.5px solid var(--linea); background: var(--blanco);
  font-size: 16px; color: var(--negro); outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--negro); box-shadow: 0 0 0 4px rgba(23,24,28,.07);
}
.field input[type=color] { height: 54px; padding: 6px; }

.msg { padding: 14px 17px; border-radius: 16px; margin-top: 14px; font-size: 15px; display: none; }
.msg.ok { background: var(--lima); color: var(--negro); display: block; }
.msg.err { background: var(--rosa); color: #8C2317; display: block; }

/* ---------- Paneles ---------- */
.panel {
  background: var(--blanco); border-radius: var(--radius); padding: 24px;
  border: 1.5px solid var(--linea); margin-bottom: 16px;
}
.panel h2, .panel h3 { font-size: 19px; font-weight: 500; margin-bottom: 4px; }
.panel .hint { color: var(--gris-tenue); font-size: 13.5px; margin-bottom: 14px; }

/* ---------- Panel del negocio ---------- */
.app-shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; background: var(--blanco); }
@media (max-width: 860px) { .app-shell { grid-template-columns: 1fr; } .riel { display: none; } }
.riel {
  background: var(--negro); color: #fff;
  margin: 14px 0 14px 14px; border-radius: 26px;
  padding: 24px 16px; display: flex; flex-direction: column; gap: 4px;
  height: fit-content; position: sticky; top: 14px;
}
.riel .marca {
  font-weight: 500; font-size: 20px; letter-spacing: -0.03em;
  margin-bottom: 22px; display: flex; align-items: center; gap: 10px;
}
.riel .marca .dot { width: 32px; height: 32px; border-radius: 10px; background: var(--naranja); display: grid; place-items: center; font-size: 15px; }
.riel a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 999px; text-decoration: none;
  font-size: 14.5px; font-weight: 450; color: rgba(255,255,255,.65);
}
.riel a.on, .riel a:hover { background: rgba(255,255,255,.12); color: #fff; }
.app-main { padding: 30px clamp(18px, 4vw, 46px) 70px; }

/* KPIs como bloques de color (firma de la referencia) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { border-radius: var(--radius-lg); padding: 22px; color: var(--negro); }
.kpi:nth-child(4n+1) { background: var(--lila); }
.kpi:nth-child(4n+2) { background: var(--lima); }
.kpi:nth-child(4n+3) { background: var(--cobalto); color: #fff; }
.kpi:nth-child(4n+4) { background: var(--naranja); color: #fff; }
.kpi .k { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .72; }
.kpi .n { font-size: 48px; font-weight: 300; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12.5px; font-weight: 500; opacity: .8; }

.cols-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .cols-2 { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--linea); }
th { color: var(--gris-tenue); font-weight: 600; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
td { font-variant-numeric: tabular-nums; }

.feed { list-style: none; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linea); align-items: center; }
.feed li:last-child { border-bottom: none; }
.feed .ava {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--lila); color: var(--negro);
  display: grid; place-items: center; font-weight: 600; font-size: 12.5px;
}
.feed li:nth-child(3n+2) .ava { background: var(--lima); }
.feed li:nth-child(3n) .ava { background: var(--rosa); }
.feed .txt { flex: 1; font-size: 14.5px; }
.feed time { font-size: 12px; color: var(--gris-tenue); white-space: nowrap; }

.qrbox { background: var(--blanco); border: 1.5px solid var(--linea); border-radius: 20px; padding: 16px; text-align: center; }
.qrbox img { margin-inline: auto; }
.qrbox .code { color: var(--gris-tenue); font-size: 11.5px; word-break: break-all; margin-top: 6px; }

/* ---------- Confeti ---------- */
.confeti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 999; }
.confeti i {
  position: absolute; top: -14px; width: 9px; height: 14px; opacity: .95;
  animation: caer 2.6s ease-in forwards;
}
@keyframes caer { to { transform: translateY(105vh) rotate(720deg); opacity: .6; } }

/* ---------- Aparición ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .wsello.pop-in, .confeti i { animation: none; }
  html { scroll-behavior: auto; }
}
/* La textura de grano se retira: la nueva línea es limpia y plana */
.grain::before { content: none; }
