/* Sección "Casos de éxito" con un teléfono que reproduce una conversación de ejemplo. */
.cases {
  padding: 110px max(5vw, 24px);
  background: #fff;
}
.case {
  max-width: 1400px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 64px;
  align-items: center;
  padding: 56px;
  border: 1px solid #d7e4f2;
  border-radius: 27px;
  background: linear-gradient(160deg, #f4f8fd, #fff 60%);
}
.caseTag {
  margin: 0 0 14px;
  color: var(--royal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.caseCopy h3 {
  margin: 0 0 28px;
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}
.caseBlock {
  margin-bottom: 22px;
}
.caseBlock strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}
.caseBlock p {
  margin: 0;
  color: #52627a;
  font-size: 15px;
  line-height: 1.7;
}
.caseList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.caseList li {
  position: relative;
  padding-left: 22px;
  color: #33445c;
  font-size: 14px;
  line-height: 1.5;
}
.caseList li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--royal);
  border-bottom: 2px solid var(--royal);
  transform: rotate(-45deg);
}
.caseStack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 30px;
  padding: 0;
  list-style: none;
}
.caseStack li {
  padding: 7px 12px;
  border-radius: 999px;
  background: #e6effb;
  color: #2b4a73;
  font-size: 12px;
  font-weight: 700;
}
.caseCta {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  background: #0b7a3e;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.2s ease;
}
.caseCta:hover {
  transform: translateY(-2px);
}

/* Teléfono */
.phone {
  margin: 0 auto;
  width: min(330px, 100%);
}
.phoneScreen {
  overflow: hidden;
  border: 10px solid #0b1f3a;
  border-radius: 42px;
  background: #efeae2;
  box-shadow: 0 30px 70px rgb(11 31 58 / 25%);
}
.chatHeader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px 16px 12px;
  background: #075e54;
  color: #fff;
}
.chatAvatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dcf8c6;
  color: #075e54;
  font-size: 12px;
  font-weight: 800;
}
.chatHeader strong {
  display: block;
  font-size: 14px;
}
.chatHeader small {
  display: block;
  opacity: 0.8;
  font-size: 11px;
}
.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 420px;
  margin: 0;
  padding: 14px 12px 18px;
  list-style: none;
  overflow: hidden;
  justify-content: flex-end;
}
.msg {
  position: relative;
  max-width: 82%;
  padding: 8px 10px 18px;
  border-radius: 10px;
  color: #111b21;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 1px 1px rgb(0 0 0 / 8%);
}
.msg time {
  position: absolute;
  right: 8px;
  bottom: 4px;
  color: #667781;
  font-size: 10px;
}
.msg.in {
  align-self: flex-start;
  border-top-left-radius: 0;
  background: #fff;
}
.msg.out {
  align-self: flex-end;
  border-top-right-radius: 0;
  background: #d9fdd3;
}
.menu {
  display: grid;
  gap: 4px;
  align-self: flex-start;
  width: 82%;
}
.menu span {
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  color: #027eb5;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 1px 1px rgb(0 0 0 / 8%);
}
.doc {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f5f6f6;
}
.doc b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 40px;
  border-radius: 4px;
  background: #e5484d;
  color: #fff;
  font-size: 10px;
}
.doc span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc small {
  display: block;
  color: #667781;
  font-weight: 400;
}
.typing {
  display: none;
}
.phone figcaption {
  margin-top: 14px;
  color: #7a889c;
  font-size: 12px;
  text-align: center;
}

/* Animación: solo cuando el script marca la conversación como lista. */
.chat.is-ready > li {
  opacity: 0;
  transform: translateY(8px);
}
.chat.is-playing > li {
  animation: chatIn 0.35s ease forwards;
}
.chat.is-playing > li:nth-child(1) {
  animation-delay: 0.4s;
}
.chat.is-playing > li:nth-child(2) {
  animation-delay: 1.4s;
}
.chat.is-playing > li:nth-child(3) {
  animation-delay: 2.1s;
}
.chat.is-playing > li:nth-child(4) {
  animation-delay: 3.9s;
}
.chat.is-playing > li:nth-child(6) {
  animation-delay: 5.9s;
}
.chat.is-playing > li:nth-child(7) {
  animation-delay: 6.9s;
}
.chat.is-ready > .typing {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  height: 0;
  padding: 0 14px;
  border-radius: 10px;
  background: #fff;
}
.chat.is-playing > .typing {
  animation: typing 1.6s ease 4.3s forwards;
}
.typing i {
  width: 6px;
  height: 6px;
  margin-top: 12px;
  border-radius: 50%;
  background: #8696a0;
  animation: dot 1s infinite;
}
.typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes chatIn {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes typing {
  0% {
    opacity: 1;
    transform: none;
    height: 30px;
  }
  90% {
    opacity: 1;
    height: 30px;
  }
  100% {
    opacity: 0;
    height: 0;
    margin-top: -8px;
  }
}
@keyframes dot {
  50% {
    transform: translateY(-3px);
    opacity: 0.5;
  }
}

@media (max-width: 980px) {
  .case {
    grid-template-columns: 1fr;
    gap: 44px;
    padding: 34px 24px;
  }
}
@media (max-width: 760px) {
  .cases {
    padding: 80px 17px;
  }
  .caseList {
    grid-template-columns: 1fr;
  }
  .caseCta {
    width: 100%;
    justify-content: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .caseCta {
    transition: none;
  }
}

/* Segundo caso: portal de autofacturación (demo en ventana de navegador). */
.case + .case {
  margin-top: 32px;
}
@media (min-width: 981px) {
  .caseAlt {
    grid-template-columns: minmax(340px, 1fr) minmax(0, 1.05fr);
  }
  .caseAlt .browser {
    order: -1;
  }
}
.browser {
  margin: 0 auto;
  width: min(520px, 100%);
}
.browserFrame {
  overflow: hidden;
  border: 1px solid #cddbeb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 70px rgb(11 31 58 / 18%);
}
.browserBar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #eef3f9;
  border-bottom: 1px solid #dbe5f0;
}
.browserBar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c8d3e0;
}
.browserBar span {
  margin-left: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff;
  color: #6b7a8f;
  font-size: 11px;
}
.portalSteps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 14px 18px;
  list-style: none;
  counter-reset: step;
  border-bottom: 1px solid #e6edf5;
}
.portalSteps li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8a98ab;
  font-size: 11px;
  font-weight: 700;
  counter-increment: step;
}
.portalSteps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e3eaf3;
  color: #6b7a8f;
  font-size: 10px;
}
.portalSteps .s3 {
  color: #0b1f3a;
}
.portalSteps .s3::before {
  background: #0891b2;
  color: #fff;
}
.portalBody {
  position: relative;
  min-height: 300px;
  padding: 22px;
}
.screen {
  display: grid;
  gap: 12px;
}
.screenA,
.screenC {
  display: none;
}
.screenTitle {
  margin: 0;
  color: #0b1f3a;
  font-size: 16px;
  font-weight: 800;
}
.pickRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pick {
  padding: 12px;
  border: 1.5px solid #dbe5f0;
  border-radius: 10px;
  color: #52627a;
  font-size: 12px;
  font-weight: 700;
}
.pick.on {
  border-color: #0891b2;
  background: #ecfeff;
  color: #0b1f3a;
}
.portal label {
  display: grid;
  gap: 5px;
  color: #52627a;
  font-size: 11px;
  font-weight: 700;
}
.field {
  padding: 10px 12px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: #fafcff;
  color: #0b1f3a;
  font-size: 13px;
  font-weight: 600;
}
.hit {
  padding: 10px 12px;
  border-radius: 8px;
  background: #ecfeff;
  color: #0e7490;
  font-size: 12px;
  font-weight: 700;
}
.line {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px;
  border-bottom: 1px dashed #dbe5f0;
  color: #33445c;
  font-size: 13px;
}
.line.total {
  border-bottom: 0;
  color: #0b1f3a;
  font-size: 15px;
  font-weight: 800;
}
.screenC {
  justify-items: center;
  align-content: center;
  min-height: 256px;
  text-align: center;
}
.okMark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0b7a3e;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}
.okText {
  max-width: 300px;
  margin: 0;
  color: #52627a;
  font-size: 13px;
  line-height: 1.6;
}
.browser figcaption {
  margin-top: 14px;
  color: #7a889c;
  font-size: 12px;
  text-align: center;
}

/* Animación del portal: 3 pantallas en un ciclo de 12 s. */
.portal.is-ready .screen {
  display: grid;
  position: absolute;
  inset: 22px;
  opacity: 0;
}
.portal.is-ready .portalSteps .s3 {
  color: #8a98ab;
}
.portal.is-ready .portalSteps .s3::before {
  background: #e3eaf3;
  color: #6b7a8f;
}
.portal.is-playing .screenA {
  animation: screenShow 12s 0s infinite;
}
.portal.is-playing .screenB {
  animation: screenShow 12s -8s infinite;
}
.portal.is-playing .screenC {
  animation: screenShow 12s -4s infinite;
}
.portal.is-playing .s1::before,
.portal.is-playing .s3::before,
.portal.is-playing .s4::before {
  animation: stepOn 12s infinite;
}
.portal.is-playing .s1::before {
  animation-delay: 0s;
}
.portal.is-playing .s3::before {
  animation-delay: -8s;
}
.portal.is-playing .s4::before {
  animation-delay: -4s;
}
@keyframes screenShow {
  0%,
  30% {
    opacity: 1;
    transform: none;
  }
  33%,
  97% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes stepOn {
  0%,
  30% {
    background: #0891b2;
    color: #fff;
  }
  33%,
  97% {
    background: #e3eaf3;
    color: #6b7a8f;
  }
  100% {
    background: #0891b2;
    color: #fff;
  }
}
@media (max-width: 520px) {
  .portalSteps li {
    font-size: 0;
    justify-content: center;
  }
  .portalBody {
    padding: 16px;
  }
  .portal.is-ready .screen {
    inset: 16px;
  }
  .pickRow {
    grid-template-columns: 1fr;
  }
}

/* Enfoque de producto: para quién es y de dónde nació. */
.caseLead {
  margin: -14px 0 18px;
  color: #33445c;
  font-size: 17px;
  line-height: 1.6;
}
.caseFor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.caseFor li {
  padding: 6px 12px;
  border: 1px solid #b9d7e6;
  border-radius: 999px;
  background: #fff;
  color: #0e7490;
  font-size: 12px;
  font-weight: 700;
}
.caseOrigin {
  margin: 4px 0 0;
  padding-left: 12px;
  border-left: 3px solid #0891b2;
  color: #52627a;
  font-size: 13px;
  font-style: italic;
  line-height: 1.6;
}

/* Tercer caso: muro de fotos con varios eventos de ejemplo. */
.eventDemo {
  margin: 0 auto;
  width: min(380px, 100%);
}
.eventTabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}
.eventTabs button {
  padding: 7px 12px;
  border: 1px solid #d7e4f2;
  border-radius: 999px;
  background: #fff;
  color: #52627a;
  font:
    700 12px "Plus Jakarta Sans",
    Arial,
    sans-serif;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.eventTabs button[aria-selected="true"] {
  border-color: var(--accent, #0b1f3a);
  background: var(--accent, #0b1f3a);
  color: #fff;
}
.eventStage {
  position: relative;
}
.eventPhone {
  width: min(330px, 100%);
}
.eventToast {
  position: absolute;
  z-index: 2;
  top: 240px;
  left: -78px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff;
  color: #33445c;
  font-size: 12px;
  box-shadow: 0 14px 34px rgb(11 31 58 / 18%);
  white-space: nowrap;
}
.eventToast b {
  color: #0b1f3a;
}
.eventToast.is-new {
  animation: toastIn 0.5s ease;
}
.eventPanel[hidden] {
  display: none;
}
.eventScreen {
  background: #fff;
}
.eventShot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 300 / 636;
  object-fit: cover;
}
.eventPanel.is-entering .eventShot {
  animation: shotIn 0.5s ease both;
}
@keyframes shotIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 520px) {
  .eventToast {
    position: static;
    display: flex;
    justify-content: center;
    width: fit-content;
    margin: 0 auto 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .eventPanel.is-entering .eventShot,
  .eventToast.is-new {
    animation: none;
  }
}
.eventDemo figcaption {
  margin-top: 14px;
  color: #7a889c;
  font-size: 12px;
  text-align: center;
}

/* Autofacturación: dos vistas (portal del cliente y panel del dueño). */
.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.caseDuo {
  display: grid;
  gap: 0;
}
.caseNew {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.viewTabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}
.viewTabs button {
  padding: 8px 14px;
  border: 1px solid #d7e4f2;
  border-radius: 999px;
  background: #fff;
  color: #52627a;
  font:
    700 12px "Plus Jakarta Sans",
    Arial,
    sans-serif;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.viewTabs button[aria-selected="true"] {
  border-color: #0b1f3a;
  background: #0b1f3a;
  color: #fff;
}
.view.is-entering {
  animation: viewIn 0.45s ease both;
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.dash {
  display: grid;
  gap: 14px;
  min-height: 344px;
  padding: 18px;
  background: #f8fbff;
}
.dashHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #0b1f3a;
  font-size: 13px;
}
.dashHead span {
  padding: 4px 10px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: #fff;
  color: #52627a;
  font-size: 11px;
  font-weight: 700;
}
.dashKpis {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
}
.dashKpi {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #dbe5f0;
  border-radius: 10px;
  background: #fff;
}
.dashKpi small {
  color: #6b7a8f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.dashKpi b {
  color: #0b1f3a;
  font-size: 15px;
}
.dashKpi.main {
  border: 0;
  background: linear-gradient(135deg, #2563eb, #0284c7);
}
.dashKpi.main small {
  color: #dbeafe;
}
.dashKpi.main b {
  color: #fff;
}
.dashChart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 10px;
  height: 92px;
  padding: 10px 12px 18px;
  border: 1px solid #dbe5f0;
  border-radius: 10px;
  background: #fff;
}
.dashChart span {
  position: relative;
  height: var(--h);
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #2563eb, #0891b2);
  transform-origin: bottom;
}
.dashChart .b1 {
  --h: 46%;
}
.dashChart .b2 {
  --h: 58%;
}
.dashChart .b3 {
  --h: 52%;
}
.dashChart .b4 {
  --h: 70%;
}
.dashChart .b5 {
  --h: 64%;
}
.dashChart .b6 {
  --h: 88%;
}
.dashChart i {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  color: #8a98ab;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}
.dashRows {
  display: grid;
  gap: 6px;
}
.dashTitle {
  margin: 0;
  color: #0b1f3a;
  font-size: 12px;
  font-weight: 800;
}
.dashRow {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e3eaf3;
  border-radius: 9px;
  background: #fff;
}
.dashRow span {
  display: grid;
  min-width: 0;
}
.dashRow b {
  overflow: hidden;
  color: #0b1f3a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashRow small {
  color: #8a98ab;
  font-size: 10px;
}
.dashRow em {
  color: #0b1f3a;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.dashRow u {
  padding: 2px 6px;
  border: 1px solid #c7d7f5;
  border-radius: 6px;
  color: #2563eb;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}
.dash.is-playing .dashChart span {
  animation: barGrow 9s ease-out infinite;
}
.dash.is-playing .dashChart span:nth-child(2) {
  animation-delay: 0.08s;
}
.dash.is-playing .dashChart span:nth-child(3) {
  animation-delay: 0.16s;
}
.dash.is-playing .dashChart span:nth-child(4) {
  animation-delay: 0.24s;
}
.dash.is-playing .dashChart span:nth-child(5) {
  animation-delay: 0.32s;
}
.dash.is-playing .dashChart span:nth-child(6) {
  animation-delay: 0.4s;
}
.dash.is-playing .dashRow {
  animation: rowIn 9s ease-out infinite both;
}
.dash.is-playing .dashRow:nth-child(3) {
  animation-delay: 0.15s;
}
.dash.is-playing .dashRow:nth-child(4) {
  animation-delay: 0.3s;
}
@keyframes barGrow {
  0% {
    transform: scaleY(0);
  }
  8%,
  100% {
    transform: scaleY(1);
  }
}
@keyframes rowIn {
  0%,
  6% {
    opacity: 0;
    transform: translateX(-8px);
  }
  14%,
  100% {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 560px) {
  .dash {
    padding: 14px;
  }
  .dashKpi b {
    font-size: 13px;
  }
  .dashRow u:last-child {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dash.is-playing .dashChart span,
  .dash.is-playing .dashRow,
  .view.is-entering {
    animation: none;
  }
}
@media (min-width: 981px) {
  /* El texto de este caso es largo: la demo se alinea arriba, junto al título. */
  .caseAlt .browser[data-views] {
    align-self: start;
  }
}

/* Índice de productos al inicio de la sección. */
.productIndex {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 40px;
}
.productIndex a {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 20px;
  border: 1px solid #d7e4f2;
  border-radius: 18px;
  background: #fff;
  color: #0b1f3a;
  text-decoration: none;
  transition:
    border-color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}
.productIndex a:hover {
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgb(11 31 58 / 10%);
}
.productIndex strong {
  font-size: 17px;
}
.productIndex span {
  color: #52627a;
  font-size: 14px;
  line-height: 1.5;
}
.productIndex em {
  margin-top: 4px;
  color: #0e7490;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}
.caseMore {
  display: inline-block;
  margin: 14px 0 0 4px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.caseMore:hover {
  text-decoration: underline;
}
@media (max-width: 980px) {
  .productIndex {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .productIndex {
    grid-template-columns: 1fr;
  }
}
