/* ============================================================
   CRIVAC — Animaciones compartidas
   Incluir en: index, accidentes, sucesiones, contabilidad
   ============================================================ */

/* ----------------------------------------------------------
   1. INTRO SCREEN
   ---------------------------------------------------------- */
#crivac-intro {
  position: fixed;
  inset: 0;
  background: #073b5f;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
#crivac-intro.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.65s ease;
}
#crivac-intro.done {
  display: none;
}
.intro-logo-wrap {
  animation: introZoom 1.4s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}
.intro-logo-wrap img {
  width: 210px;
  height: auto;
  display: block;
}
@keyframes introZoom {
  0%   { opacity: 0; transform: scale(0.72); }
  60%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* ----------------------------------------------------------
   2. SCROLL REVEAL
   ---------------------------------------------------------- */
.reveal,
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 0;
  transition: opacity 0.65s ease, transform 0.65s ease;
  will-change: opacity, transform;
}
.reveal        { transform: translateY(20px); }
.reveal-up     { transform: translateY(36px); }
.reveal-left   { transform: translateX(-36px); }
.reveal-right  { transform: translateX(36px); }
.reveal-scale  { transform: scale(0.94) translateY(18px); }

.reveal.visible,
.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
  opacity: 1;
  transform: none;
}

/* Stagger parent — children animate in sequence */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.58s ease, transform 0.58s ease;
}
.reveal-stagger > *.visible {
  opacity: 1;
  transform: none;
}
.reveal-stagger > *:nth-child(1) { transition-delay: 0s;    }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.1s;  }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.2s;  }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.3s;  }
.reveal-stagger > *:nth-child(5) { transition-delay: 0.4s;  }
.reveal-stagger > *:nth-child(6) { transition-delay: 0.5s;  }

/* ----------------------------------------------------------
   3. CONTADORES ANIMADOS
   ---------------------------------------------------------- */
.counters-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #062f4c 0%, #073b5f 100%);
  color: #fff;
}
.counters-section .section-label {
  color: rgba(241, 158, 102, 0.9);
  letter-spacing: 0.15em;
  font-size: 12px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 12px;
}
.counters-section .section-title {
  color: #fff;
  text-align: center;
  margin-bottom: 52px;
}
.counters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
  padding: 0 24px;
}
.counter-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  transition: background 0.3s, transform 0.3s;
}
.counter-item:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-4px);
}
.counter-num {
  display: block;
  font-family: "Sorts Mill Goudy", serif;
  font-size: clamp(38px, 5vw, 60px);
  color: #d88b55;
  line-height: 1;
  font-weight: 400;
}
.counter-label {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  line-height: 1.4;
}
@media (max-width: 700px) {
  .counters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 400px) {
  .counters-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------
   4. CARRUSEL DE TARJETAS
   ---------------------------------------------------------- */
.carousel-section {
  padding: 95px 0;
  background: linear-gradient(180deg, #ffffff 0%, #f7f3ee 100%);
  overflow: hidden;
}
.carousel-section .section-label {
  text-align: center;
}
.carousel-section .section-title {
  text-align: center;
  margin-bottom: 0;
}
.carousel-section .section-sub {
  text-align: center;
  max-width: 580px;
  margin: 12px auto 0;
}
.carousel-wrapper {
  position: relative;
  margin-top: 52px;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  transition: transform 0.52s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.carousel-slide {
  min-width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}
.carousel-card-inner {
  background: #fff;
  border: 1px solid #ded6ce;
  border-radius: 32px;
  padding: 48px 52px;
  max-width: 820px;
  margin: 0 auto;
  box-shadow: 0 8px 40px rgba(7,59,95,0.08);
  text-align: center;
}
.carousel-card-inner .carousel-icon {
  font-size: 42px;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
}
.carousel-card-inner h3 {
  font-family: "Sorts Mill Goudy", serif;
  color: #073b5f;
  font-size: 24px;
  margin-bottom: 14px;
}
.carousel-card-inner p {
  color: #4a5568;
  font-size: 16px;
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto;
}
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}
.carousel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ded6ce;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: width 0.28s ease, background 0.28s ease, border-radius 0.28s ease;
}
.carousel-dot.active {
  width: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #935526, #b25b2a, #d88b55);
}
@media (max-width: 600px) {
  .carousel-card-inner {
    padding: 36px 28px;
    border-radius: 24px;
  }
}

/* ----------------------------------------------------------
   5. MODAL DEL QUIZ
   ---------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 47, 76, 0.72);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 16px;
  box-sizing: border-box;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  background: #fff;
  border-radius: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.32s ease;
  position: relative;
}
.modal-overlay.open .modal-box {
  transform: none;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #f0ebe4;
  color: #073b5f;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}
.modal-close:hover {
  background: #ded6ce;
  transform: rotate(90deg);
}
.modal-body {
  padding: 52px 36px 36px;
}
@media (max-width: 600px) {
  .modal-body {
    padding: 48px 22px 28px;
  }
}

/* ----------------------------------------------------------
   6. SECCIÓN QUIZ → BOTÓN (reemplaza el quiz inline)
   ---------------------------------------------------------- */
.quiz-section-btn {
  padding: 95px 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(178,91,42,0.07) 0%, transparent 70%), var(--crema, #f7f3ee);
  text-align: center;
}
.quiz-section-btn .section-label {
  text-align: center;
}
.quiz-section-btn .section-title {
  text-align: center;
  margin-bottom: 16px;
}
.quiz-section-btn .section-sub {
  max-width: 560px;
  margin: 0 auto 32px;
  text-align: center;
}
.quiz-benefits-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}
.quiz-benefit-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(178,91,42,0.08);
  border: 1px solid rgba(178,91,42,0.2);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  color: #b25b2a;
  font-weight: 500;
}
.quiz-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #935526, #b25b2a, #d88b55);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 18px 38px;
  font-size: 17px;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.25s, transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 6px 28px rgba(178,91,42,0.35);
  text-decoration: none;
}
.quiz-cta-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(178,91,42,0.45);
}
.quiz-disclaimer {
  margin-top: 18px;
  font-size: 13px;
  color: #888;
}

/* ----------------------------------------------------------
   7. SECCIÓN PROFESIONAL (foto + bio)
   ---------------------------------------------------------- */
.prof-section {
  padding: 80px 0;
  background: linear-gradient(180deg, #f7f3ee 0%, #ffffff 100%);
}
.prof-section .section-label {
  text-align: center;
}
.prof-section .section-title {
  text-align: center;
  margin-bottom: 0;
}
.prof-card {
  display: flex;
  max-width: 860px;
  margin: 44px auto 0;
  background: #fff;
  border: 1px solid #ded6ce;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(7,59,95,0.08);
}
.prof-photo {
  width: 280px;
  min-height: 340px;
  background: #f0ebe4;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.prof-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.45s ease;
}
.prof-card:hover .prof-photo img {
  transform: scale(1.04);
}
.prof-photo-ph {
  font-size: 80px;
  opacity: 0.3;
  user-select: none;
}
.prof-info {
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.prof-role {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #b25b2a;
  font-weight: 600;
  margin-bottom: 8px;
}
.prof-name {
  font-family: "Sorts Mill Goudy", serif;
  color: #073b5f;
  font-size: 30px;
  margin: 0 0 16px;
  line-height: 1.15;
}
.prof-bio {
  color: #4a5568;
  font-size: 15.5px;
  line-height: 1.75;
  margin-bottom: 20px;
}
.prof-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.prof-tags span {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(216,139,85,0.12);
  color: #b25b2a;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
@media (max-width: 720px) {
  .prof-card {
    flex-direction: column;
    margin: 32px 16px 0;
  }
  .prof-photo {
    width: 100%;
    min-height: 240px;
  }
  .prof-info {
    padding: 28px 28px 32px;
  }
}

/* ----------------------------------------------------------
   8. SERVICE CARD — imagen (index.html)
   ---------------------------------------------------------- */
.service-card-img {
  height: 175px;
  margin: -34px -30px 22px;
  overflow: hidden;
  border-radius: 18px 18px 0 0;
}
.service-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.service-card:hover .service-card-img img {
  transform: scale(1.06);
}
.service-card-img-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  background: linear-gradient(135deg, rgba(147,85,38,0.08), rgba(7,59,95,0.07));
}
.service-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.service-keywords span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(216,139,85,0.12);
  color: #b25b2a;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ----------------------------------------------------------
   9. RESULTS DARK (accidentes.html)
   ---------------------------------------------------------- */
.results-dark {
  background: linear-gradient(135deg, #062f4c 0%, #073b5f 100%) !important;
}
.results-dark .section-label {
  color: rgba(241,158,102,0.85) !important;
}
.results-dark .section-title {
  color: #fff !important;
}
.results-dark .section-sub {
  color: rgba(255,255,255,0.72) !important;
}
.results-dark .result-card {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #fff;
}
.results-dark .result-card h3,
.results-dark .result-card .result-amount {
  color: #d88b55 !important;
}
.results-dark .result-card p {
  color: rgba(255,255,255,0.75) !important;
}
.results-dark .case-tag {
  background: rgba(255,255,255,0.1) !important;
  color: rgba(255,255,255,0.8) !important;
  border-color: rgba(255,255,255,0.15) !important;
}
.results-dark .google-review-box {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.7) !important;
}

/* ----------------------------------------------------------
   10. WA PILL (sucesiones y contabilidad — si no está inline)
   ---------------------------------------------------------- */
.wa-float-pill {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 13px 20px 13px 16px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(37,211,102,0.45);
  z-index: 400;
  animation: waPulse 2.8s ease infinite;
  white-space: nowrap;
  max-width: calc(100vw - 44px);
}
.wa-float-pill svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.wa-pill-text {
  overflow: hidden;
  max-width: 220px;
  transition: max-width 0.35s ease;
}
@media (max-width: 500px) {
  .wa-pill-text {
    display: none;
  }
  .wa-float-pill {
    padding: 14px;
    border-radius: 50%;
  }
}
@keyframes waPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,0.45); }
  50%       { box-shadow: 0 4px 32px rgba(37,211,102,0.7); }
}

/* ----------------------------------------------------------
   11. RESPONSIVE HELPERS
   ---------------------------------------------------------- */
@media (max-width: 900px) {
  .counters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ----------------------------------------------------------
   12. REDUCED MOTION — accesibilidad
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .intro-logo-wrap {
    animation: none !important;
    opacity: 1 !important;
  }
  .carousel-track {
    transition: none !important;
  }
  .counter-num {
    /* counters skipped in JS, value set directly */
  }
  .wa-float-pill {
    animation: none !important;
  }
  .counter-item {
    transition: none !important;
  }
}
