/* =========================================================
   MiAfandecor — Sistema de diseño compartido
   Webapp móvil de postventa (QR) · Grupo Afandecor
   Artboards 390 × 844
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  /* Marca */
  --ink:        #111111;  /* headers, botones principales */
  --gold:       #C9A227;  /* único acento */
  --section:    #F2F4F7;  /* fondos de sección / notas */
  --text:       #1F2937;  /* texto principal */
  --muted:      #5F6B76;  /* texto secundario */
  --surface:    #FFFFFF;  /* superficie */
  --line:       #E7EAEF;  /* divisores sutiles */
  --gold-soft:  #FBF6E6;  /* fondo dorado tenue (garantía) */
  --gold-ink:   #8A6E12;  /* texto sobre dorado tenue */
  --pos:        #1E9E5A;  /* movimiento positivo */
  --neg:        #C2483A;  /* movimiento negativo */

  /* Radios */
  --r-sm: 10px;
  --r:    12px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* Sombra muy sutil, arquitectónica */
  --shadow: 0 1px 2px rgba(17,17,17,.04), 0 6px 20px rgba(17,17,17,.05);
  --shadow-card: 0 1px 0 var(--line);

  --ff: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Iconos inline (Tabler-style) — tamaño = font-size del contenedor */
i.ti { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
i.ti svg { width: 1em; height: 1em; display: block; }

html, body { height: 100%; }

body {
  font-family: var(--ff);
  color: var(--text);
  background: #C9CDD4;            /* gris fuera del lienzo */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100%;
}

/* ---------- Lienzo de pantalla 390×844 ---------- */
.screen {
  width: 390px;
  height: 844px;
  background: var(--surface);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============ HEADER negro ============ */
.app-header {
  background: var(--ink);
  color: #fff;
  padding: 18px 22px 22px;
  flex-shrink: 0;
}
.app-header__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 18px;
}
.app-header__wm { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 23px; height: 23px; flex-shrink: 0; display: block; }
.app-header__brand .mi { font-weight: 400; }
.app-header__logo { height: 17px; width: auto; display: block; opacity: .95; flex-shrink: 0; }
.app-header__brand .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
}
.app-header__brand .wm { letter-spacing: -0.01em; }
.app-header__brand b { font-weight: 600; }
.app-header__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.app-header__subtitle {
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(255,255,255,.62);
  margin-top: 5px;
  line-height: 1.45;
}
/* botón back opcional */
.app-header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.app-header__nav .app-header__brand { margin-bottom: 0; }
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.08);
  color: #fff;
  border: none; cursor: pointer;
  font-size: 20px;
}

/* ============ CUERPO ============ */
.app-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app-body--section { background: var(--surface); }

/* ============ FOOTER ============ */
.app-footer {
  flex-shrink: 0;
  padding: 14px 22px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.app-footer .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
}
.app-footer b { font-weight: 500; color: var(--text); }
.app-footer__logo { height: 13px; width: auto; display: block; filter: brightness(0); opacity: .5; }

/* logo Afandecor recoloreado */
.af-logo { display: block; width: auto; }
.af-logo--dark { filter: brightness(0); }

/* ============ Tipografía utilitaria ============ */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.muted { color: var(--muted); }
.text-sm { font-size: 13px; }

/* ============ CARD ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
}
.card--section { background: var(--section); border-color: transparent; }

/* lista de datos técnicos (clave/valor) */
.data-list { display: flex; flex-direction: column; }
.data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.data-row:last-child { border-bottom: 0; }
.data-row__label {
  font-size: 13px;
  color: var(--muted);
  display: flex; align-items: center; gap: 9px;
}
.data-row__label i { font-size: 20px; color: var(--ink); }
.data-row__value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}
.badge i { font-size: 15px; }
.badge--neutral { background: var(--section); color: var(--text); }
.badge--ink     { background: var(--ink); color: #fff; }
.badge--gold    { background: var(--gold-soft); color: #8A6E12; }
.badge--gold .dot,
.badge--dot::before { }
.badge--outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* ============ BOTONES ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 52px;
  border-radius: var(--r);
  font-family: var(--ff);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform .08s ease, opacity .15s ease;
}
.btn i { font-size: 20px; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .4; cursor: default; }
.btn:disabled:active { transform: none; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--premium { background: var(--gold); color: #1A1500; font-weight: 600; }
.btn--ghost   { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn--quiet   { background: var(--section); color: var(--text); }

/* ============ NOTA / aviso RGPD ============ */
.note {
  background: var(--section);
  border-radius: var(--r);
  padding: 13px 14px;
  display: flex;
  gap: 11px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.note i { font-size: 20px; color: var(--ink); flex-shrink: 0; margin-top: 1px; }

/* divisor */
.divider { height: 1px; background: var(--line); border: 0; }

/* ============ SAT · llamada vinculada ============ */
.sat-id__row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.sat-id__icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--surface); border-radius: var(--r); color: var(--ink); }
.sat-id__icon i { font-size: 22px; }
.sat-id__text { display: flex; flex-direction: column; gap: 2px; }
.sat-id__title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.sat-id__sub { font-size: 12.5px; color: var(--muted); }

/* ============ Saldo de puntos (strip) ============ */
.pts-strip { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--gold-soft); border-radius: var(--r-lg); padding: 16px 18px; }
.pts-strip__label { font-size: 12px; font-weight: 500; color: var(--gold-ink); letter-spacing: .01em; }
.pts-strip__num { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin-top: 2px; }
.pts-strip__num span { font-size: 14px; font-weight: 500; color: var(--muted); }
.pts-strip__link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font: 500 12.5px var(--ff); color: var(--text); background: rgba(255,255,255,.7);
  border: 1px solid rgba(201,162,39,.25); padding: 8px 12px; border-radius: var(--r-pill); white-space: nowrap; }
.pts-strip__link i { font-size: 16px; }

/* ============ Chips de puntos ============ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { height: 38px; padding: 0 14px; border-radius: var(--r-pill); cursor: pointer;
  font: 500 13px var(--ff); color: var(--text); background: var(--surface); border: 1px solid var(--line); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ============ Bottom sheet ============ */
.sheet-backdrop { position: absolute; inset: 0; z-index: 50; background: rgba(17,17,17,.42);
  display: flex; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet { width: 100%; background: var(--surface); border-radius: 20px 20px 0 0; padding: 12px 22px 24px;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.22,1,.36,1); }
.sheet-backdrop.is-open .sheet { transform: translateY(0); }
.sheet__grip { width: 38px; height: 4px; border-radius: 999px; background: #D7DBE1; margin: 4px auto 16px; }
.sheet__head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sheet__icon { width: 42px; height: 42px; border-radius: var(--r); background: var(--section);
  display: grid; place-items: center; flex-shrink: 0; color: var(--ink); }
.sheet__icon i { font-size: 22px; }
.sheet__title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.sheet__sub { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 10px 0 0; }
.sheet__pts { margin-top: 18px; }
.sheet__hint { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.sheet__hint b { color: var(--gold-ink); font-weight: 600; }
.sheet__confirm { margin-top: 20px; }
.sheet__cancel { width: 100%; height: 44px; margin-top: 8px; background: none; border: 0; cursor: pointer;
  font: 500 13.5px var(--ff); color: var(--muted); }

/* ============ SAT · llamada vinculada ============ */

/* ============ GUÍA EN PANTALLA (tour) ============ */
.tour-help { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0;
  cursor: pointer; color: var(--muted); font: 500 11.5px var(--ff); padding: 0; }
.tour-help i { font-size: 15px; color: var(--ink); }
.app-footer.has-help { justify-content: space-between; }

.tour-overlay { position: absolute; inset: 0; z-index: 60; }
.tour-spot { position: absolute; box-shadow: 0 0 0 9999px rgba(17,17,17,.64);
  outline: 2px solid var(--gold); outline-offset: 2px; pointer-events: none; }
.tour-tip { position: absolute; width: 264px; background: var(--surface);
  border-radius: var(--r-lg); padding: 16px;
  box-shadow: 0 20px 48px rgba(17,17,17,.32); }
.tour-tip__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--gold-ink); margin-bottom: 7px; }
.tour-tip__title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 5px; }
.tour-tip__text { font-size: 13px; line-height: 1.5; color: var(--muted); }
.tour-tip__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; }
.tour-tip__skip { background: none; border: 0; color: var(--muted); font: 500 12.5px var(--ff); cursor: pointer; padding: 0; }
.tour-tip__nav { display: flex; gap: 8px; }
.tour-btn { height: 34px; padding: 0 13px; border-radius: 9px; font: 500 13px var(--ff);
  cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.tour-btn--primary { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ============ BACK / volver ============ */
.back-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 0; cursor: pointer;
  color: rgba(255,255,255,.7);
  font: 500 13px var(--ff);
  padding: 2px 0; margin-bottom: 14px;
  text-decoration: none;
}
.back-btn i { font-size: 18px; }
.back-btn:hover { color: #fff; }

/* ============ MENU (icono · título · subtítulo · chevron) ============ */
.menu { display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; background: var(--surface); }
.menu-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; min-height: 64px;
  text-decoration: none; color: inherit; cursor: pointer;
  border: 0; border-bottom: 1px solid var(--line);
  background: var(--surface); width: 100%; text-align: left;
  font-family: var(--ff);
}
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover { background: var(--section); }
.menu-item__icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--section); display: grid; place-items: center; flex-shrink: 0; }
.menu-item__icon i { font-size: 22px; color: var(--ink); }
.menu-item__text { flex: 1; min-width: 0; }
.menu-item__title { font-size: 14.5px; font-weight: 500; color: var(--text); }
.menu-item__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.menu-item__chevron { color: #B5BCC6; font-size: 20px; flex-shrink: 0; }
.menu-item__meta { font-size: 13px; font-weight: 600; color: var(--gold-ink); flex-shrink: 0; }

/* ============ OPCIÓN seleccionable (radio) ============ */
.opt {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 15px; border: 1px solid var(--line);
  border-radius: var(--r); cursor: pointer; background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.opt + .opt { margin-top: 10px; }
.opt:hover { border-color: #CDD3DB; }
.opt.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt__icon { width: 40px; height: 40px; border-radius: 11px; background: var(--section);
  display: grid; place-items: center; flex-shrink: 0; }
.opt__icon i { font-size: 21px; color: var(--ink); }
.opt__text { flex: 1; min-width: 0; }
.opt__title { font-size: 14px; font-weight: 500; }
.opt__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.opt__radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #C2C9D2;
  flex-shrink: 0; display: grid; place-items: center; transition: border-color .12s; }
.opt.is-active .opt__radio { border-color: var(--ink); }
.opt.is-active .opt__radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }

/* ============ SALDO (negro borde dorado) ============ */
.balance {
  background: var(--ink); border: 1px solid var(--gold);
  border-radius: var(--r-lg); padding: 24px 22px; text-align: center; color: #fff; }
.balance__num { font-size: 46px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.balance__sub { font-size: 13px; color: rgba(255,255,255,.62); margin-top: 9px; }
.balance__sub b { color: var(--gold); font-weight: 600; }

/* ============ MOVIMIENTOS ============ */
.mov-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.mov-row:last-child { border-bottom: 0; }
.mov-row__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--section);
  display: grid; place-items: center; flex-shrink: 0; }
.mov-row__icon i { font-size: 19px; color: var(--ink); }
.mov-row__text { flex: 1; min-width: 0; }
.mov-row__title { font-size: 13.5px; font-weight: 500; }
.mov-row__sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.mov-row__amt { font-size: 14px; font-weight: 600; white-space: nowrap; }
.amt-pos { color: var(--pos); }
.amt-neg { color: var(--neg); }
.amt-tag { font-size: 12px; font-weight: 600; color: var(--text); background: var(--section);
  padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap; }

/* gate de verificación: oculta el contenido real mientras está bloqueado */
.screen[data-locked] .app-body:not(#mia-gate) { display: none; }

/* ============ RECOMPENSAS (canje) ============ */
.reward-row { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.reward-row:last-child { border-bottom: 0; }
.reward-row__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--section);
  display: grid; place-items: center; flex-shrink: 0; }
.reward-row__icon i { font-size: 22px; color: var(--ink); }
.reward-row__text { flex: 1; min-width: 0; }
.reward-row__title { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.reward-row__cost { font-size: 12.5px; font-weight: 600; color: var(--gold-ink); margin-top: 3px; }
.btn-sm { height: 36px; padding: 0 15px; border-radius: 10px; font: 500 13px var(--ff);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; width: auto; flex-shrink: 0; }
.btn-sm--ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-sm:disabled { opacity: .45; cursor: default; }

/* ============ FORMULARIOS ============ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field + .field { margin-top: 4px; }
.label, .field > label { font-size: 12.5px; font-weight: 500; color: var(--text); }
.req { color: var(--gold); }
.input, .textarea {
  width: 100%; font: 400 14px var(--ff); color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 14px; }
.input::placeholder, .textarea::placeholder { color: #9AA3AD; }
.input:focus, .textarea:focus { outline: none; border-color: var(--ink); }
.textarea { resize: none; min-height: 92px; line-height: 1.5; }

/* checkbox */
.check { display: flex; gap: 11px; align-items: flex-start; cursor: pointer;
  font-size: 12.5px; line-height: 1.5; color: var(--muted); position: relative; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box { width: 20px; height: 20px; border: 1.5px solid #C2C9D2; border-radius: 6px;
  flex-shrink: 0; margin-top: 1px; display: grid; place-items: center;
  background: var(--surface); transition: .12s; }
.check__box i { font-size: 14px; color: #fff; opacity: 0; }
.check input:checked + .check__box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .check__box i { opacity: 1; }

/* ============ PASOS numerados ============ */
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.step:last-child { padding-bottom: 0; }
.step__num { width: 28px; height: 28px; border-radius: 50%; background: var(--ink);
  color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center;
  flex-shrink: 0; position: relative; z-index: 1; }
.step__line { position: absolute; left: 13.5px; top: 30px; bottom: 4px; width: 1.5px; background: var(--line); }
.step:last-child .step__line { display: none; }
.step__text { font-size: 13.5px; line-height: 1.5; color: var(--text); padding-top: 4px; }
.step__text b { font-weight: 600; }

/* ============ HERO / estados centrados ============ */
.app-body--center { justify-content: center; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 9px; }
.hero__icon { width: 100px; height: 100px; border-radius: 50%; background: var(--section);
  display: grid; place-items: center; margin-bottom: 4px; }
.hero__icon i { font-size: 46px; color: var(--ink); }
.hero__title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; max-width: 300px; }
.hero__text { font-size: 14px; color: var(--muted); line-height: 1.55; max-width: 300px; }

.hero-confirm { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px; }
.hero-confirm__icon { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px; }
.hero-confirm__icon i { font-size: 36px; }
.ic-neutral { background: var(--section); } .ic-neutral i { color: var(--ink); }
.ic-gold { background: var(--gold-soft); } .ic-gold i { color: var(--gold-ink); }
.hero-confirm__title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; max-width: 290px; }
.hero-confirm__text { font-size: 13.5px; color: var(--muted); line-height: 1.55; max-width: 290px; }

/* utilidades */
.stack { display: flex; flex-direction: column; gap: 16px; }
/* títulos/subtítulos apilados dentro de filas */
.menu-item__title, .menu-item__sub,
.opt__title, .opt__sub,
.mov-row__title, .mov-row__sub,
.idv-row__t, .idv-row__s,
.reward-row__title, .reward-row__cost { display: block; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.is-hidden { display: none !important; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 14px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
