/* Portal de comprobantes · identidad FARMASOFT */
:root {
  --navy: #0b3253;
  --navy-2: #123f66;
  --teal: #049b90;
  --teal-osc: #037a71;
  --menta: #e4f3f1;
  --menta-2: #f2f9f8;
  --papel: #fbfdfd;
  --tinta: #1d2a38;
  --gris: #5b6876;
  --linea: #d3dfe6;
  --rojo: #b42f3c;
  --ambar: #a86a00;
  --display: "Lexend", "Segoe UI", system-ui, sans-serif;
  --texto: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font: 400 15px/1.5 var(--texto);
  color: var(--tinta);
  background: var(--papel);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-osc); }
h1, h2, h3 { font-family: var(--display); color: var(--navy); line-height: 1.12; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* Cabecera */
.top { border-bottom: 1px solid var(--linea); background: #fff; }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.marca img:first-child { width: 38px; height: auto; }
.marca__word { width: 130px; }
.top__nav { display: flex; gap: 22px; font-family: var(--display); font-size: 14px; }
.top__nav a { color: var(--navy); text-decoration: none; }
.top__nav a:hover { color: var(--teal-osc); }

/* Hero */
.hero {
  padding: 32px 0 52px;
  background:
    radial-gradient(circle at 1px 1px, rgba(4,155,144,.16) 1.2px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(180deg, var(--menta-2), var(--papel) 70%);
}
.hero__intro { max-width: 680px; margin-bottom: 26px; }
.hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 600; letter-spacing: -0.02em; }
.lead { margin-top: 12px; font-size: 1rem; color: var(--gris); max-width: 62ch; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-areas: "guia panel";
  gap: 32px;
  align-items: start;
}
.panel { grid-area: panel; }
.guia { grid-area: guia; }

/* Panel de búsqueda */
.panel {
  background: #fff;
  border: 1px solid var(--linea);
  border-top: 6px solid var(--navy);
  border-radius: var(--r-m);
  padding: 22px;
  box-shadow: 0 18px 40px -24px rgba(11, 50, 83, .45);
}
.panel__titulo { font-size: 1.15rem; font-weight: 600; margin-bottom: 14px; }
.consulta { display: grid; gap: 12px; }
.fila { display: grid; grid-template-columns: 100px 1fr; gap: 12px; }
.campo { display: grid; gap: 4px; }
.campo label, .envio label { font-weight: 700; font-size: 13.5px; color: var(--navy); }
input {
  font: inherit;
  font-size: 15px;
  width: 100%;
  min-height: 40px;
  padding: 7px 12px;
  color: var(--tinta);
  background: #fff;
  border: 1.5px solid var(--linea);
  border-radius: var(--r-s);
  transition: border-color .15s, box-shadow .15s;
  font-variant-numeric: tabular-nums;
}
input::placeholder { color: #9aa7b3; }
input:hover { border-color: #b5c6d1; }
input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(4,155,144,.16); }
.campo.con-error input { border-color: var(--rojo); }
.error { color: var(--rojo); font-size: 13px; min-height: 0; }
.error:empty { display: none; }
#serie, #captcha { text-transform: uppercase; letter-spacing: .06em; }
.prefijo { position: relative; }
.prefijo span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gris); font-weight: 700; }
.prefijo input { padding-left: 36px; }
.captcha { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; }
.captcha img { border-radius: var(--r-s); border: 1px solid var(--linea); width: 140px; height: 43px; }
.icono {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1.5px solid var(--linea); border-radius: 50%; background: #fff; color: var(--navy); cursor: pointer;
}
.icono:hover { border-color: var(--teal); color: var(--teal-osc); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.aviso {
  padding: 12px 14px; border-radius: var(--r-s);
  background: #fdf0f1; color: #7d1f29; border: 1px solid #f1c6cb; font-size: 14px;
}

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px;
  font: 600 14.5px/1 var(--display);
  border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primario { background: var(--teal); color: #fff; }
.btn--primario:hover { background: var(--teal-osc); }
.btn--sec { background: #fff; color: var(--navy); border-color: var(--linea); }
.btn--sec:hover { border-color: var(--navy); }
.btn--claro { background: #fff; color: var(--navy); }
.btn--claro:hover { background: var(--menta); }
.btn--linea { color: #fff; border-color: rgba(255,255,255,.55); }
.btn--linea:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn--ancho { width: 100%; margin-top: 4px; }
.btn[disabled], .btn.cargando { opacity: .7; cursor: progress; }
.btn.cargando span::after { content: "…"; }
.enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--teal-osc); text-decoration: underline; cursor: pointer; }

/* Guía visual */
.guia { margin: 0; }
.guia figcaption { font-family: var(--display); font-weight: 600; color: var(--navy); font-size: 1rem; margin-bottom: 12px; }
.ticket {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 4px;
  padding: 18px 18px 14px;
  font-size: 11.5px;
  color: #3c4a58;
  box-shadow: 0 1px 0 #fff, 6px 6px 0 -1px var(--menta), 6px 6px 0 0 var(--linea);
  transform: rotate(-1deg);
  max-width: 500px;
}
.ticket b { color: var(--navy); }
.ticket__head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.ticket__emisor { display: flex; gap: 10px; align-items: flex-start; }
.ticket__emisor > div { display: grid; gap: 6px; }
.ticket__box {
  border: 1.5px solid var(--navy); border-radius: 6px; padding: 8px 10px; text-align: center;
  display: grid; gap: 4px; min-width: 170px;
}
.ticket__tipo { background: var(--navy); color: #fff; font-weight: 700; font-size: 11px; padding: 3px 4px; border-radius: 2px; }
.ticket__num { font-weight: 700; color: var(--teal-osc); font-size: 14px; }
.ticket__cli { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin: 16px 0 12px; padding: 10px; background: var(--menta-2); border-radius: 4px; }
.ticket__cli > div { display: grid; gap: 4px; }
.ticket__cli .k { font-size: 11px; color: var(--gris); }
.ticket__items { display: grid; }
.ti { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px; border-bottom: 1px solid #edf2f5; font-variant-numeric: tabular-nums; }
.ti--h { background: var(--navy); color: #fff; font-weight: 700; font-size: 11px; border: 0; border-radius: 2px; padding: 5px 6px; }
.ticket__tot { margin: 10px 0 0 auto; width: 58%; display: grid; gap: 3px; }
.ticket__tot > div { display: flex; justify-content: space-between; padding: 2px 6px; font-variant-numeric: tabular-nums; }
.ticket__total { background: var(--teal); color: #fff; border-radius: 3px; padding: 5px 6px !important; }
.ticket__total b { color: #fff; }
.ph { display: block; height: 7px; border-radius: 4px; background: #e3eaef; }
.ph--logo { width: 34px; height: 34px; border-radius: 6px; background: var(--menta); flex: none; }
.ph--l { width: 140px; } .ph--m { width: 100px; } .ph--s { width: 70px; }
.ti .ph--l { width: 60%; } .ti .ph--m { width: 45%; } .ti .ph--s { width: 35%; }

/* Resaltado sincronizado con el formulario */
.zona, .zona__txt { border-radius: 4px; transition: box-shadow .2s, background-color .2s; }
.zona.on, .zona__txt.on { box-shadow: 0 0 0 3px #f6c445; background-color: #fff6d6; }
.ticket__total.on { background-color: var(--teal); box-shadow: 0 0 0 3px #f6c445; }
.ticket__tipo { box-shadow: none !important; }
.guia__lista { margin: 20px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--gris); max-width: 60ch; }
.guia__lista li { padding: 2px 6px; border-radius: 6px; transition: background-color .2s; }
.guia__lista li::marker { font-family: var(--display); font-weight: 600; color: var(--teal-osc); }
.guia__lista li.on { background: #fff6d6; color: var(--tinta); }
.guia__lista b { color: var(--navy); }

/* Resultado */
.resultado { display: grid; gap: 14px; }
.resultado.entra { animation: entra .35s ease-out; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.res__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.res__emisor { display: flex; gap: 12px; align-items: center; min-width: 0; }
.res__logo { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--linea); border-radius: 10px; padding: 4px; background: #fff; flex: none; }
.res__nombre { font-family: var(--display); font-weight: 600; color: var(--navy); line-height: 1.25; }
.res__ruc { color: var(--gris); font-size: 13.5px; }
.estado { flex: none; font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: var(--menta); color: var(--teal-osc); display: inline-flex; align-items: center; gap: 6px; }
.estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.estado--rechazado, .estado--excepcion { background: #fdf0f1; color: var(--rojo); }
.estado--observado, .estado--desconocido { background: #fff5e0; color: var(--ambar); }
.res__doc { border-top: 1px dashed var(--linea); padding-top: 12px; }
.res__tipo { font-size: 13px; color: var(--gris); }
.res__num { font-family: var(--display); font-size: 1.6rem; font-weight: 600; color: var(--navy); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.res__datos { margin: 0; display: grid; gap: 6px; }
.res__datos > div { display: flex; justify-content: space-between; gap: 16px; }
.res__datos dt { color: var(--gris); }
.res__datos dd { margin: 0; text-align: right; font-weight: 700; color: var(--tinta); }
.res__total { border-top: 1px solid var(--linea); padding-top: 10px; }
.res__total dd { font-family: var(--display); font-size: 1.3rem; color: var(--teal-osc); font-weight: 600; }
.res__total dt { align-self: center; }
.descargas { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; }
.res__ver { font-size: 13.5px; justify-self: start; }
.envio { display: grid; gap: 8px; background: var(--menta-2); border: 1px solid var(--menta); border-radius: var(--r-m); padding: 14px; }
.envio__fila { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.envio__msg { font-size: 14px; }
.envio__msg.ok { color: var(--teal-osc); font-weight: 700; }
.envio__msg.mal { color: var(--rojo); }
.res__otra { justify-self: center; }

/* Ayuda */
.ayuda { padding: 52px 0; border-top: 1px solid var(--linea); background: #fff; }
.ayuda__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: 40px; }
.ayuda h2 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); font-weight: 600; }
.faq { display: grid; }
.faq details { border-bottom: 1px solid var(--linea); }
.faq details:first-child { border-top: 1px solid var(--linea); }
.faq summary {
  list-style: none; cursor: pointer; padding: 14px 36px 14px 0; position: relative;
  font-family: var(--display); font-weight: 500; font-size: 0.98rem; color: var(--navy);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 11px; height: 11px; margin-top: -8px;
  border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 0 16px; color: var(--gris); max-width: 68ch; }

/* Banda FARMASOFT */
.fs { background: var(--navy); color: #d7e4ee; padding: 48px 0; position: relative; overflow: hidden; }
.fs::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 1px 1px, rgba(127,214,205,.18) 1.2px, transparent 0) 0 0 / 22px 22px;
  mask-image: linear-gradient(90deg, transparent 30%, #000);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.fs__grid { position: relative; display: grid; grid-template-columns: 200px 1fr; gap: 44px; align-items: center; }
.fs__logo { width: 200px; }
.fs h2 { color: #fff; font-size: clamp(1.4rem, 2.2vw, 1.8rem); font-weight: 600; }
.fs p { margin-top: 10px; max-width: 62ch; font-size: 1rem; }
.fs__acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Pie */
.pie { background: #08263f; color: #a9bccb; font-size: 13.5px; padding: 18px 0; }
.pie__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.pie a { color: #dfeaf1; }

/* Responsive */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; grid-template-areas: "panel" "guia"; }
  .ticket { transform: none; }
  .ayuda__grid { grid-template-columns: 1fr; gap: 20px; }
  .fs__grid { grid-template-columns: 1fr; gap: 28px; }
  .fs__logo { width: 160px; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .hero { padding: 28px 0 48px; }
  .hero__intro { margin-bottom: 24px; }
  .top__nav a:first-child { display: none; }
  .marca__word { width: 120px; }
  .panel { padding: 20px 16px; }
  .fila { grid-template-columns: 96px 1fr; }
  .captcha { grid-template-columns: auto 1fr; }
  .captcha .icono { justify-self: start; }
  .captcha input { grid-column: 1 / -1; }
  .ticket { padding: 14px; font-size: 11px; }
  .ticket__head { flex-direction: column; }
  .ticket__box { min-width: 0; width: 100%; }
  .ticket__tot { width: 100%; }
  .ph--l { width: 110px; }
  .descargas { grid-template-columns: 1fr 1fr; }
  .descargas .btn--primario { grid-column: 1 / -1; }
  .envio__fila { grid-template-columns: 1fr; }
  .res__head { flex-direction: column; }
  .res__num { font-size: 1.6rem; }
}
