/* ==========================================================
   HOJA DE ESTILOS GENERAL PARA CASOS DE ÉXITO - ERP365
   Reutilizable para todos los casos de estudio presentes y futuros
   ========================================================== */

/* Layout Casos de Éxito */
.case-study-page {
  background-color: #f8fafc;
  padding: 40px 0 70px;
  color: #1e293b;
}

.case-study-layout {
  display: flex;
  gap: 26px;
  align-items: flex-start;
}

.case-main-col {
  flex: 1 1 auto;
  min-width: 0;
  background: #ffffff;
  border-radius: 14px;
  padding: 40px 44px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  border: 1px solid #e2e8f0;
}

.case-sidebar-col {
  flex: 0 0 295px;
  width: 295px;
  position: sticky;
  top: 90px;
  background: #ffffff;
  border-radius: 14px;
  padding: 24px 20px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  border: 1px solid #e2e8f0;
}

/* Imagen de Cabecera (860 x 317 px) */
.case-header-img-wrap {
  width: 100%;
  max-width: 860px;
  margin: 0 auto 28px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  background: #1b2a6b;
}

.case-header-img-wrap img {
  width: 100%;
  height: auto;
  aspect-ratio: 1024 / 377;
  object-fit: cover;
  display: block;
}


.case-logo-card {
  width: 100%;
  padding: 16px 20px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.case-logo-card img {
  max-width: 100%;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.ph-logo-card {
  width: 100%;
  height: 85px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 19px;
  color: #1b2a6b;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

/* Tipografía de contenido */
.case-category {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #f57c1f;
  margin-bottom: 8px;
}

.case-study-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.2;
  color: #101446;
  margin: 0 0 14px;
}

.case-study-sub {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.38;
  color: #334155;
  margin: 0 0 24px;
}

.case-divider {
  height: 2px;
  background: linear-gradient(90deg, #f57c1f 0%, #22c1c3 60%, transparent 100%);
  border: 0;
  margin: 24px 0 28px;
}

.case-lead {
  font-size: 18px;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 20px;
  text-align: justify;
  text-justify: inter-word;
}

.case-body-text {
  font-size: 17px;
  line-height: 1.7;
  color: #475569;
  margin-bottom: 20px;
  text-align: justify;
  text-justify: inter-word;
}

/* Video Container */
.case-video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  margin: 32px 0 44px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.case-video-wrapper iframe,
.case-video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.case-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #1b2a6b 0%, #0c122e 100%);
  color: #ffffff;
}

.case-video-placeholder .play-btn {
  width: 72px;
  height: 72px;
  background: #f57c1f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 0 30px rgba(245, 124, 31, 0.5);
  transition: transform 0.2s ease;
}

.case-video-placeholder .play-btn svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
  margin-left: 4px;
}

/* Diagnóstico & Tratamiento Card */
.diag-card-container {
  font-family: inherit;
  background: radial-gradient(120% 120% at 50% 10%, #1e2b5e 0%, #131c42 50%, #0b1129 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px -15px rgba(8, 17, 36, 0.7);
  border-radius: 16px;
  padding: 42px 46px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  margin: 38px 0;
}

.diag-card-container::before {
  content: '';
  position: absolute;
  top: -30%;
  right: 10%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(34, 193, 195, 0.15) 0%, rgba(34, 193, 195, 0) 70%);
  pointer-events: none;
}

.diag-header-badge {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #22c1c3;
  margin-bottom: 10px;
}

.diag-title-main {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 12px 0;
  color: #ffffff;
}

.diag-title-main span {
  color: #f57c1f;
}

.diag-timeline-bar {
  position: relative;
  height: 6px;
  width: 100%;
  background: #253366;
  border-radius: 999px;
  margin: 36px 0 46px 0;
}

.diag-timeline-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7b9bb0 0%, #22c1c3 50%, #f57c1f 100%);
  border-radius: 999px;
}

.diag-milestone {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.diag-milestone-inner {
  width: 8px;
  height: 8px;
  background-color: #ffffff;
  border-radius: 50%;
  z-index: 2;
}

.diag-milestone-1 { left: 10%; background-color: #7b9bb0; box-shadow: 0 0 0 4px rgba(123, 155, 176, 0.35); }
.diag-milestone-2 { left: 50%; background-color: #22c1c3; box-shadow: 0 0 0 4px rgba(34, 193, 195, 0.4); }
.diag-milestone-3 { left: 90%; background-color: #f57c1f; box-shadow: 0 0 0 5px rgba(245, 124, 31, 0.4); }

.diag-pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: rgba(245, 124, 31, 0.6);
  animation: diagPulse 2.2s infinite cubic-bezier(0.24, 0, 0.38, 1);
  z-index: 1;
}

@keyframes diagPulse {
  0% { transform: scale(0.9); opacity: 0.9; }
  70% { transform: scale(2.3); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

.diag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.diag-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.diag-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 1.15rem;
  font-weight: 700;
}

.diag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.diag-badge-1 { background-color: #658196; }
.diag-title-1 { color: #d3e3ed; }
.diag-badge-2 { background-color: #179395; }
.diag-title-2 { color: #22c1c3; }
.diag-badge-3 { background-color: #f57c1f; color: #ffffff; }
.diag-title-3 { color: #f57c1f; }

.diag-desc {
  color: #cbd5e1;
  font-size: 0.93rem;
  line-height: 1.6;
  margin: 0 0 24px 0;
  font-weight: 400;
}

.diag-tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.diag-tag-1 { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); color: #cbd5e1; }
.diag-tag-2 { background: rgba(34, 193, 195, 0.16); border: 1px solid rgba(34, 193, 195, 0.35); color: #22c1c3; }
.diag-tag-3 { background: rgba(245, 124, 31, 0.16); border: 1px solid rgba(245, 124, 31, 0.35); color: #f57c1f; }

/* Lista de beneficios con icono */
.case-section-heading {
  font-size: 26px;
  font-weight: 700;
  color: #101446;
  margin: 36px 0 18px;
  line-height: 1.3;
}

.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0 0 34px;
}

.benefits-list li {
  position: relative;
  padding-left: 36px;
  margin-bottom: 14px;
  font-size: 17px;
  line-height: 1.55;
  color: #334155;
}

.benefits-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(34, 193, 195, 0.15);
  color: #0d9488;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.benefits-list li b {
  color: #0f172a;
}

/* Tarjeta de Cita / Testimonio */
.case-quote-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px 28px;
  margin: 30px 0;
  box-shadow: 0 4px 16px -6px rgba(0, 0, 0, 0.05);
}

.case-quote-box p.quote-text {
  font-size: 19px;
  line-height: 1.55;
  font-weight: 500;
  color: #1e293b;
  font-style: italic;
  margin: 0 0 12px;
}

.case-quote-box .quote-author {
  font-size: 14.5px;
  font-weight: 700;
  color: #1b2a6b;
  margin: 0;
}

.case-quote-box .quote-role {
  font-size: 13.5px;
  color: #64748b;
}

/* Estadísticas / Impacto en números */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0 38px;
}

.stat-card {
  background: #101446;
  border-radius: 12px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(16, 20, 70, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.stat-number {
  font-size: 24px;
  font-weight: 800;
  color: #f57c1f;
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: #ffffff;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
}

/* Bloque ANTES vs HOY indicador */
.antes-hoy-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 30px;
  margin: 30px 0 24px;
  text-align: center;
}

.ah-col .ah-badge {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 8px;
}

.ah-col.antes .ah-badge {
  background: #fee2e2;
  color: #b91c1c;
}

.ah-col.hoy .ah-badge {
  background: #dcfce7;
  color: #15803d;
}

.ah-time {
  font-size: 32px;
  font-weight: 800;
  color: #101446;
  margin: 2px 0 4px;
  line-height: 1.1;
}

.ah-sub {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.ah-arrow svg {
  width: 36px;
  height: 36px;
  fill: #f57c1f;
}

/* Tabla de Antes y DespuA%xito */
.wrap-tabla-rotovia,
.wrap-tabla-caso,
.wrap-case-table {
  margin: 36px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(16, 20, 70, 0.06);
  border: 1px solid #dce4eb;
}

.tabla-clean-rotovia,
.tabla-clean-caso,
.case-table {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background-color: #ffffff;
}

.tabla-clean-rotovia th,
.tabla-clean-caso th,
.case-table th {
  padding: 16px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
}

.tabla-clean-rotovia th.th-antes,
.tabla-clean-caso th.th-antes,
.case-table th.th-antes {
  width: 50% !important;
  background-color: #1b2a6b;
  color: #ffffff;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.tabla-clean-rotovia th.th-despues,
.tabla-clean-caso th.th-despues,
.case-table th.th-despues {
  width: 50% !important;
  background-color: #f57c1f;
  color: #ffffff;
}

.tabla-clean-rotovia td,
.tabla-clean-caso td,
.case-table td {
  padding: 16px 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  border-bottom: 1px solid #eaf0f5;
  vertical-align: middle;
  text-transform: none !important;
}

.tabla-clean-rotovia tr:last-child td,
.tabla-clean-caso tr:last-child td,
.case-table tr:last-child td {
  border-bottom: none;
}

.tabla-clean-rotovia td.td-antes,
.tabla-clean-caso td.td-antes,
.case-table td.td-antes {
  width: 50% !important;
  color: #475569;
  border-right: 1px solid #eaf0f5;
  background-color: #ffffff;
  text-transform: none !important;
}

.tabla-clean-rotovia tr:nth-child(even) td.td-antes,
.tabla-clean-caso tr:nth-child(even) td.td-antes,
.case-table tr:nth-child(even) td.td-antes {
  background-color: #f8fafc;
}

.tabla-clean-rotovia td.td-despues,
.tabla-clean-caso td.td-despues,
.case-table td.td-despues {
  width: 50% !important;
  color: #0f172a;
  font-weight: 600;
  background-color: #ffffff;
  text-transform: none !important;
}

.tabla-clean-rotovia tr:nth-child(even) td.td-despues,
.tabla-clean-caso tr:nth-child(even) td.td-despues,
.case-table tr:nth-child(even) td.td-despues {
  background-color: #f8fafc;
}


/* Banner CTA Final */
.case-final-cta {
  background: linear-gradient(135deg, #101446 0%, #1b2a6b 60%, #184882 100%);
  border-radius: 14px;
  padding: 38px 32px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  margin: 48px 0 24px;
  box-shadow: 0 14px 30px rgba(16, 20, 70, 0.25);
}

.case-final-cta .cta-text {
  max-width: 680px;
  width: 100%;
}

.case-final-cta .cta-text h4 {
  font-size: 24px;
  margin: 0 0 10px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.case-final-cta .cta-text p {
  font-size: 16px;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.55;
}

.case-final-cta .cta-btn-action {
  flex-shrink: 0;
  background: #f57c1f;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 32px;
  border-radius: 8px;
  display: inline-block;
  text-align: center;
  box-shadow: 0 4px 15px rgba(245, 124, 31, 0.4);
  transition: transform 0.2s, filter 0.2s;
}

.case-final-cta .cta-btn-action:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.back-cases-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: #1b2a6b;
  margin-top: 18px;
  transition: color 0.2s;
}

.back-cases-btn:hover {
  color: #f57c1f;
}

/* Sidebar Ficha Técnica */
.sidebar-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #101446;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-data-group {
  margin-bottom: 13px;
}

.sidebar-data-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 2px;
}

.sidebar-data-value {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.sidebar-data-value a {
  color: #f57c1f;
  text-decoration: underline;
}

.sidebar-cta-box {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 14px 12px;
  margin-top: 18px;
  text-align: center;
}

.sidebar-cta-box p {
  font-size: 12px;
  color: #475569;
  margin: 0 0 8px;
  line-height: 1.35;
}

.sidebar-cta-box .btn-side {
  display: block;
  width: 100%;
  background: #1b2a6b;
  color: #ffffff;
  padding: 8px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}
  background: #1b2a6b;
  color: #ffffff;
  padding: 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
}

.sidebar-cta-box .btn-side:hover {
  background: #f57c1f;
}

/* Responsive */
@media (max-width: 992px) {
  .case-study-layout {
    flex-direction: column;
  }
  .case-main-col {
    flex: 1 1 100%;
    padding: 32px 24px;
  }
  .case-sidebar-col {
    flex: 1 1 100%;
    width: 100%;
    position: static;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .diag-card-container {
    padding: 30px 20px;
  }
  .diag-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .diag-timeline-bar {
    display: none;
  }
  .antes-hoy-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .ah-arrow svg {
    transform: rotate(90deg);
  }
  .case-final-cta {
    flex-direction: column;
    text-align: center;
    padding: 30px 24px;
  }
  .case-study-title {
    font-size: 28px;
  }
  .case-study-sub {
    font-size: 18px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.case-main-col a:not(.cta-btn-action):not(.back-cases-btn) {
  color: #f57c1f;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s;
}
.case-main-col a:not(.cta-btn-action):not(.back-cases-btn):hover {
  color: #1b2a6b;
}

/* Header Resilience (Garantiza que el menA% con 'Casos de A%xito' se mantenga en 1 sola lA-nea) */
@media (min-width: 861px) {
  header .wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: clamp(10px, 1.3vw, 18px) !important;
    flex-wrap: nowrap !important;
  }
  header nav {
    display: flex !important;
    gap: clamp(8px, 1.1vw, 15px) !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
  }
  header nav a {
    font-weight: 700 !important;
    font-size: 16px !important;
    white-space: nowrap !important;
  }
  header .btn-contact {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 9px 16px !important;
    font-size: 13.5px !important;
  }
}

/* Reglas de alineación explícitas: Cajas, bullets, citas y títulos NO justificados */
.case-quote-box,
.case-quote-box p,
.quote-text,
.quote-author,
.quote-role,
.benefits-list,
.benefits-list li,
.diag-card-container,
.diag-desc,
.stat-card,
.stat-label,
.ah-col,
.ah-sub,
.case-final-cta,
.case-final-cta p,
.sidebar-cta-box,
.sidebar-cta-box p,
.sidebar-data-group,
.tabla-clean-rotovia th,
.tabla-clean-rotovia td {
  text-align: left;
}
