/* =========================
       RESET & BASE
    ========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Lato", sans-serif;
  background: #f9fbfd;
  color: #0b1220;
  overflow-x: hidden;
  padding: 20px;
}
h1 {
  font-family: "Quicksand", sans-serif;
  color: #1697c7;
  text-align: center;
  font-size: clamp(1.8rem, 2vw + 1rem, 3rem);
  margin-bottom: 10px;
  font-weight: 700;
}
h2.subtitle {
  text-align: center;
  color: #333;
  margin-bottom: 40px;
}
.mrv-percorso-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

/* =========================
       FLIP CARD BASE
    ========================= */
.mrv-flip-card {
  background: transparent;
  width: 320px;
  height: 420px;
  perspective: 1000px;
  cursor: pointer;
}
.mrv-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s ease;
  transform-style: preserve-3d;
}
.mrv-flip-card.active .mrv-flip-inner {
  transform: rotateY(180deg);
}
.mrv-flip-front,
.mrv-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  background: #fff;
}

/* FRONT */
.mrv-flip-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
}
.mrv-flip-front img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin-bottom: 20px;
}
.mrv-flip-front h2 {
  color: #1697c7;
  font-family: "Quicksand", sans-serif;
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.mrv-flip-front p {
  font-size: 1rem;
  color: #333;
  line-height: 1.4em;
}

/* BACK */
.mrv-flip-back {
  background: #4cbfe9;
  color: #fff;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
}
.mrv-flip-back h3 {
  font-family: "Quicksand", sans-serif;
  font-size: 1.3rem;
  margin-bottom: 20px;
}
.mrv-flip-back form {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 260px;
  gap: 12px;
}
.mrv-flip-back input[type="text"],
.mrv-flip-back input[type="email"] {
  padding: 12px;
  /*border: none;*/
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}
.mrv-flip-back button {
  background: #1697c7;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}
.mrv-flip-back button:hover {
  background: #f1f1f1;
  transform: translateY(-2px);
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .mrv-flip-card {
    width: 90%;
    height: 380px;
  }
  .mrv-flip-front img {
    width: 130px;
    height: 130px;
  }
  h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
  }
}
/* --- Highlight / Flash animation for incoming links --- */
.mrv-flip-card.highlight {
  position: relative;
  z-index: 5;
  animation: mrv-flash 1s ease-in-out 0s 7;
}

@keyframes mrv-flash {
  0% {
    box-shadow: 0 10px 30px rgba(199, 22, 22, 0), 0 0 0 0 rgba(219, 11, 11, 0.555);
    transform: translateY(0);
  }
  25% {
    box-shadow: 0 12px 34px rgba(199, 22, 22, 0.18);
    transform: translateY(-4px);
  }
  50% {
    box-shadow: 0 18px 46px rgba(199, 22, 22, 0.28);
    transform: translateY(0);
  }
  75% {
    box-shadow: 0 12px 34px rgba(199, 22, 22, 0.18);
    transform: translateY(-2px);
  }
  100% {
    box-shadow: 0 10px 30px rgba(199, 22, 22, 0);
    transform: translateY(0);
  }
}

/* Small outline to make it more visible when focused */
.mrv-flip-card.highlight .mrv-flip-front,
.mrv-flip-card.highlight .mrv-flip-back {
  outline: 3px solid rgba(22, 151, 199, 0.12);
}

/* Screen-reader only utility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
