/* Ventana de caso de éxito. La usan la home y /casos-reales.
   Mismo estilo que la web: esquinas rectas, sin sombras, colores de la marca. */

:root {
  --bg-card: #FFFFFF;
  --text-muted: #5E6470;
  --border: rgba(47, 123, 164, 0.25);
}

.modal ul, .modal ol { margin: 0; padding: 0; }
.modal p { margin: 0; }

.modal-overlay { position: fixed; inset: 0; background: rgba(26, 29, 36, 0.72); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s, visibility 0.25s; }
.modal-overlay.open { opacity: 1; visibility: visible; pointer-events: all; }
.modal { background: var(--bg-card); width: 100%; max-width: 760px; max-height: 90vh; overflow-y: auto; position: relative; transform: translateY(16px); transition: transform 0.25s; font-family: var(--sans, 'DM Sans', sans-serif); color: var(--text-body); }
.modal-overlay.open .modal { transform: translateY(0); }
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); }

.modal-header { padding: 40px 40px 28px; position: sticky; top: 0; background: var(--bg-card); z-index: 10; box-shadow: 0 1px 0 rgba(47, 123, 164, 0.15); }
.modal-close { position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; background: var(--bg-main); border: none; color: var(--text-dark); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s; }
.modal-close:hover { background: #EEF7FB; color: var(--azul); }
.modal-icp { font-size: 16px; font-weight: 700; color: var(--marron); margin-bottom: 10px; }
.modal-title { font-family: 'DM Serif Display', Georgia, serif; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; letter-spacing: -0.01em; color: var(--text-dark); padding-right: 48px; }

.modal-body { padding: 32px 40px; }

.modal-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.kpi-box { background: #EEF7FB; padding: 20px 14px; text-align: center; }
.kpi-value { font-family: 'DM Serif Display', Georgia, serif; font-size: 32px; color: var(--azul); line-height: 1; margin-bottom: 8px; }
.kpi-label { font-size: 14px; font-weight: 500; color: var(--text-body); line-height: 1.35; }

.modal-section { margin-bottom: 36px; }
.modal-section-label { font-family: 'DM Serif Display', Georgia, serif; font-size: 22px; color: var(--text-dark); margin-bottom: 14px; }

/* Antes y después con los colores de la marca */
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.before-box { padding: 22px; background: #FCF1DE; }
.after-box { padding: 22px; background: #EEF7FB; }
.ba-label { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.before-box .ba-label { color: var(--marron); }
.after-box .ba-label { color: var(--azul); }
.ba-items { list-style: none; }
.ba-items li { font-size: 16px; color: var(--text-dark); line-height: 1.5; padding: 4px 0 4px 20px; position: relative; }
.before-box .ba-items li::before { content: '—'; position: absolute; left: 0; color: var(--marron); font-weight: 700; }
.after-box .ba-items li::before { content: '✓'; position: absolute; left: 0; color: var(--azul); font-weight: 700; }

.modal-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.modal-tag { font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 100px; background: rgba(102, 81, 53, 0.08); color: var(--marron); }

.modal-quote { font-family: 'DM Serif Display', Georgia, serif; font-style: italic; font-size: 21px; line-height: 1.45; color: var(--text-dark); padding: 24px 28px; background: var(--bg-main); }
.modal-quote-author { font-family: var(--sans, 'DM Sans', sans-serif); font-style: normal; font-size: 15px; color: var(--text-body); margin-top: 12px; font-weight: 500; }

.video-embed { aspect-ratio: 16/9; background: var(--bg-main); }
.video-embed iframe { width: 100%; height: 100%; border: none; }

.modal-cta-inline { background: var(--bg-main); padding: 28px 32px; text-align: center; margin-bottom: 36px; }
.modal-cta-inline p { font-size: 17px; color: var(--text-body); margin-bottom: 18px; line-height: 1.55; }
.modal-cta-inline strong { color: var(--text-dark); }

.modal-cta { margin: 0 40px 40px; padding: 32px; background: var(--beix); text-align: center; }
.modal-cta p { font-size: 17px; color: var(--text-dark); margin-bottom: 18px; line-height: 1.55; }
.modal-cta strong { color: var(--text-dark); }

/* Mismo botón que en el resto de la web: cuadrado, naranja, texto oscuro */
.cta-btn { display: inline-flex; align-items: center; min-height: 52px; padding: 0 28px; background: var(--naranja); color: var(--text-dark); font-size: 17px; font-weight: 700; text-decoration: none; transition: transform 0.15s; }
.cta-btn:hover { color: var(--text-dark); transform: translateY(-2px); }

.modal-detail { font-size: 17px; color: var(--text-body); line-height: 1.7; margin-top: 40px; padding-top: 32px; border-top: 1px solid rgba(47, 123, 164, 0.15); }
.modal-detail h1, .modal-detail h2, .modal-detail h3 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; color: var(--azul); margin: 28px 0 12px; font-size: 24px; }
.modal-detail h1:first-child, .modal-detail h2:first-child, .modal-detail h3:first-child { margin-top: 0; }
.modal-detail p { margin-bottom: 16px; }
.modal-detail ul, .modal-detail ol { padding-left: 24px; margin-bottom: 16px; }
.modal-detail ul li, .modal-detail ol li { margin-bottom: 8px; }
.modal-detail strong { color: var(--text-dark); }
.modal-detail blockquote { padding: 18px 22px; background: #EEF7FB; margin: 20px 0; font-style: italic; color: var(--text-dark); }

@media (max-width: 768px) {
  .modal-overlay { padding: 0; }
  .modal { max-height: 100vh; height: 100%; }
  .before-after { grid-template-columns: 1fr; }
  .modal-header, .modal-body { padding: 24px; }
  .modal-cta, .modal-cta-inline { margin: 0 24px 24px; padding: 24px; }
  .modal-kpis { grid-template-columns: 1fr; }
}
