/* Tarjeta de fidelidad - NYMERIA CAFE
   Paleta oficial sacada de la guia de marca (LOGOS PNG-06.png). */

:root {
  --verde:      #134947;   /* verde Nymeria, el principal */
  --verde-osc:  #072B2B;   /* casi negro */
  --salvia:     #718778;
  --crema:      #E9E3D8;
  --rosa:       #DBAEAB;
  --rosa-osc:   #CC9F9A;

  --fondo:      #F4F1EA;   /* crema aclarado, para el fondo de pagina */
  --papel:      #FFFFFF;
  --borde:      #DFD8CB;
  --tenue:      #7C8A83;
  --rojo:       #A85A4C;

  --sombra: 0 2px 10px rgba(7, 43, 43, .07), 0 16px 40px rgba(7, 43, 43, .08);
  --radio: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 26px 20px 60px;
  background: var(--fondo);
  color: var(--verde-osc);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.envoltorio { max-width: 780px; margin: 0 auto; }
.estrecho   { max-width: 440px; }

h1 { font-size: 1.55rem; margin: 0 0 4px; letter-spacing: -.02em; color: var(--verde); }
h2 { font-size: 1.02rem; margin: 32px 0 12px; letter-spacing: -.01em; color: var(--verde); }
p  { margin: 0 0 14px; }

.tenue     { color: var(--tenue); font-size: .86rem; }
.subtitulo { color: var(--tenue); margin-bottom: 24px; }
.vacio     { color: var(--tenue); font-style: italic; }

/* --- El logotipo, coloreable por CSS --- */
.logotipo {
  display: block;
  -webkit-mask: url(/estatico/marca/nymeria-solo.png) left center/contain no-repeat;
          mask: url(/estatico/marca/nymeria-solo.png) left center/contain no-repeat;
  background: currentColor;
}

/* --- Navegacion --- */
.nav {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--borde);
}
.nav .logotipo { width: 104px; height: 17px; color: var(--verde); margin-right: 6px; }
.nav a {
  padding: 6px 13px; border-radius: 999px;
  background: rgba(19, 73, 71, .07); color: var(--verde);
  text-decoration: none; font-size: .86rem; font-weight: 500;
  transition: background .15s;
}
.nav a:hover  { background: rgba(19, 73, 71, .14); }
.nav a.activo { background: var(--verde); color: var(--crema); }

/* --- Cajas --- */
.caja {
  background: var(--papel); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 22px; margin-bottom: 18px;
}

/* --- LA TARJETA ------------------------------------------------------ */
.pase {
  background: linear-gradient(158deg, #1a5754 0%, var(--verde) 45%, var(--verde-osc) 100%);
  color: var(--crema); border-radius: 22px; padding: 26px 24px 24px;
  box-shadow: var(--sombra); position: relative; overflow: hidden;
}
.pase::after {  /* brillo diagonal muy sutil */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, rgba(233,227,216,.09), transparent 44%);
}
/* Cuando toca cafe gratis la tarjeta sigue verde: el rosa entra solo
   como acento, en el titular, el borde y el aro de los sellos. */
.pase.premio-listo {
  box-shadow: var(--sombra), inset 0 0 0 2px var(--rosa-osc);
}
.pase.premio-listo .pase-titular { color: var(--rosa); }

.pase-cabecera {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; margin-bottom: 22px;
}
.pase .logotipo { width: 138px; height: 22px; color: currentColor; opacity: .96; }

/* El rotulo del club, debajo del logotipo */
.pase-programa {
  margin-top: 7px; font-size: .64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .32em;
  color: var(--rosa); opacity: .95;
}
.pase-nombre {
  font-size: 1.02rem; font-weight: 600; margin-top: 14px; opacity: .92;
}
.pase-marca {
  width: 40px; height: 52px; flex: none; opacity: .5;
  -webkit-mask: url(/estatico/marca/sello.png) center/contain no-repeat;
          mask: url(/estatico/marca/sello.png) center/contain no-repeat;
  background: currentColor;
}

.pase-titular    { font-size: 1.45rem; font-weight: 650; letter-spacing: -.02em; }
.pase-subtitular { opacity: .74; font-size: .89rem; margin-bottom: 18px; }

/* Los sellos: cada uno es la marca de Nymeria */
.sellos {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 9px; margin: 18px 0 22px;
}
.sello {
  aspect-ratio: 1; border-radius: 50%;
  border: 1.5px dashed currentColor;
  display: flex; align-items: center; justify-content: center;
  opacity: .30;
}
.sello i {
  display: block; width: 56%; height: 64%;
  -webkit-mask: url(/estatico/marca/sello.png) center/contain no-repeat;
          mask: url(/estatico/marca/sello.png) center/contain no-repeat;
  background: currentColor;
}
.sello.lleno {
  opacity: 1; border: none; background: var(--crema);
  box-shadow: 0 2px 6px rgba(7,43,43,.28);
}
.sello.lleno i { background: var(--verde); }
/* Tarjeta completa: los sellos se rematan con un aro rosa */
.premio-listo .sello.lleno {
  box-shadow: 0 0 0 2px var(--rosa-osc), 0 2px 6px rgba(7,43,43,.28);
}

.pase-qr {
  background: #fff; border-radius: 12px; padding: 11px;
  width: 164px; margin: 0 auto 10px;
}
.pase-qr img { width: 100%; height: auto; display: block; }
.pase-codigo {
  text-align: center; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .22em; font-size: .92rem; opacity: .85;
}
.pase-pie {
  display: flex; justify-content: space-between;
  margin-top: 18px; padding-top: 15px;
  border-top: 1px solid currentColor;
  font-size: .77rem; opacity: .68;
}

/* --- Formularios --- */
label {
  display: block; font-size: .83rem; font-weight: 600;
  margin-bottom: 6px; color: var(--verde);
}
input[type=text], input[type=tel], select, textarea {
  width: 100%; padding: 11px 13px; margin-bottom: 16px;
  border: 1px solid var(--borde); border-radius: 10px;
  font-size: 1rem; font-family: inherit;
  background: var(--papel); color: var(--verde-osc);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--salvia); outline-offset: -1px; border-color: transparent;
}
textarea { resize: vertical; min-height: 78px; }

.boton {
  display: inline-block; width: 100%; padding: 13px 20px;
  background: var(--verde); color: var(--crema);
  border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 600; font-family: inherit;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: background .15s;
}
.boton:hover      { background: var(--verde-osc); }
.boton.rosa       { background: var(--rosa-osc); color: #3B211E; }
.boton.rosa:hover { background: #B4837E; }
.boton.fantasma   { background: transparent; color: var(--verde); border: 1px solid var(--borde); }
.boton.fantasma:hover { background: rgba(19,73,71,.06); }
.boton:disabled   { opacity: .45; cursor: not-allowed; }

/* --- Avisos --- */
.aviso {
  padding: 13px 16px; border-radius: 10px; margin-bottom: 18px;
  font-size: .92rem; border-left: 3px solid;
}
.aviso.ok    { background: rgba(113,135,120,.13); border-color: var(--salvia); color: #2F4A3A; }
.aviso.error { background: rgba(168,90,76,.10);  border-color: var(--rojo);   color: #7A3025; }
.aviso.info  { background: rgba(19,73,71,.06);   border-color: var(--salvia); color: var(--verde); }

/* --- Escaner --- */
#video-caja {
  position: relative; background: var(--verde-osc); border-radius: var(--radio);
  overflow: hidden; aspect-ratio: 4/3; margin-bottom: 16px;
}
#video { width: 100%; height: 100%; object-fit: cover; display: block; }
#mira {
  position: absolute; inset: 18%;
  border: 2.5px solid rgba(233,227,216,.9); border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(7,43,43,.42);
}
.escaner-estado {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px 14px; background: rgba(7,43,43,.72);
  color: var(--crema); font-size: .85rem; text-align: center;
}

#resultado { margin-bottom: 18px; }
.resultado-tarjeta {
  background: var(--papel); border: 1px solid var(--borde);
  border-left: 4px solid var(--salvia);
  border-radius: var(--radio); padding: 20px; margin-bottom: 16px;
}
.resultado-tarjeta.fallo { border-left-color: var(--rojo); }
.resultado-nombre { font-size: 1.22rem; font-weight: 650; margin-bottom: 2px; color: var(--verde); }
.resultado-msg    { color: var(--verde-osc); margin-bottom: 14px; }
.barra {
  height: 8px; background: rgba(19,73,71,.10);
  border-radius: 999px; overflow: hidden; margin-bottom: 14px;
}
.barra span {
  display: block; height: 100%; background: var(--salvia);
  border-radius: 999px; transition: width .4s;
}

/* --- Tablas --- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left; padding: 9px 10px;
  border-bottom: 2px solid var(--borde);
  font-size: .73rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--tenue);
}
td { padding: 12px 10px; border-bottom: 1px solid rgba(223,216,203,.6); vertical-align: top; }
td.num { text-align: center; font-variant-numeric: tabular-nums; }
code {
  background: rgba(19,73,71,.07); padding: 2px 7px; border-radius: 5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .84rem;
}
.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.chip {
  display: inline-block; background: var(--rosa-osc); color: #3B211E;
  padding: 1px 8px; border-radius: 999px;
  font-size: .67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; vertical-align: middle;
}
.chip-dest {
  display: inline-block; background: rgba(19,73,71,.08); color: var(--verde);
  padding: 1px 8px; border-radius: 999px; font-size: .72rem;
  font-weight: 600; margin-right: 7px;
}
.mini { font-size: .82rem; color: var(--salvia); text-decoration: none; font-weight: 600; }
.mini:hover { text-decoration: underline; }

/* --- Metricas --- */
.metricas {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.metrica {
  background: var(--papel); border: 1px solid var(--borde);
  border-radius: 12px; padding: 16px;
}
.metrica-num {
  font-size: 1.8rem; font-weight: 680; color: var(--verde);
  letter-spacing: -.03em; line-height: 1.1;
}
.metrica-txt {
  font-size: .74rem; color: var(--tenue);
  text-transform: uppercase; letter-spacing: .06em; margin-top: 2px;
}

/* --- Notificaciones --- */
.lista-notis { list-style: none; padding: 0; margin: 0; }
.lista-notis li {
  padding: 11px 0; border-bottom: 1px solid rgba(223,216,203,.6); font-size: .9rem;
}
.lista-notis li:last-child { border-bottom: none; }
.noti-fecha { display: block; color: var(--tenue); font-size: .76rem; margin-top: 3px; }
.noti-txt { display: block; }

@media (max-width: 520px) {
  body { padding: 16px 14px 48px; }
  .sellos { gap: 7px; }
  .pase { padding: 22px 18px 20px; }
}

/* --- Boton de Google Wallet (solo sale si esta configurado) --- */
.boton.wallet {
  background: #072B2B; color: var(--crema);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-bottom: 12px;
}
.boton.wallet::before {
  content: ""; width: 19px; height: 19px; flex: none;
  background: currentColor;
  -webkit-mask: url(/estatico/marca/sello.png) center/contain no-repeat;
          mask: url(/estatico/marca/sello.png) center/contain no-repeat;
}
.boton.wallet:hover { background: #041c1c; }

/* --- Los vales del socio --- */
.vales-caja { border-left: 4px solid var(--rosa-osc); }
.lista-vales { list-style: none; padding: 0; margin: 14px 0 0; }
.vale {
  padding: 13px 15px; margin-bottom: 9px;
  background: rgba(204,159,154,.13);
  border: 1px solid rgba(204,159,154,.42);
  border-radius: 11px;
}
.vale:last-child { margin-bottom: 0; }
.vale-titulo {
  display: block; font-weight: 650; color: var(--verde); font-size: .97rem;
}
.vale-detalle {
  display: block; color: var(--tenue); font-size: .84rem; margin-top: 2px;
}
/* En el mostrador, cada vale es un boton para entregarlo */
.vale-boton {
  display: block; width: 100%; text-align: left;
  padding: 13px 15px; margin-bottom: 9px;
  background: rgba(204,159,154,.13);
  border: 1px solid var(--rosa-osc); border-radius: 11px;
  font-family: inherit; font-size: .95rem; cursor: pointer;
  transition: background .15s;
}
.vale-boton:hover { background: rgba(204,159,154,.28); }
.vale-boton strong { display: block; color: var(--verde); }
.vale-boton span { display: block; color: var(--tenue); font-size: .82rem; margin-top: 2px; }
