@import url('variables.css');

/* --- SEÇÃO FUNCIONALIDADES --- */
#funcionalidades {
  padding: 80px 1.5rem 5rem;
  background: var(--cor-verde-floresta);
}

#funcionalidades h2 {
  max-width: 36rem;
  margin: 0 auto 3.5rem;
  color: var(--cor-dourado-premium);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  justify-items: center;
  perspective: 1200px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 220px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  perspective: 1200px;
}

.feature-card:focus {
  outline: none;
}

.card-wrapper {
  width: 100%;
  height: 360px;
  opacity: 0;
  transform: translateY(30px);
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.feature-card.visible .card-wrapper {
  opacity: 1;
  transform: translateY(0);
}

.feature-card.visible:nth-child(1) .card-wrapper {
  transition-delay: 0.1s;
}

.feature-card.visible:nth-child(2) .card-wrapper {
  transition-delay: 0.2s;
}

.feature-card.visible:nth-child(3) .card-wrapper {
  transition-delay: 0.3s;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--borda-radius) * 1.25);
  border: 1.5px solid rgba(var(--cor-verde-floresta-rgb), 0.12);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.3),
    0 10px 20px rgba(var(--cor-verde-floresta-rgb), 0.2);
  transform-style: preserve-3d;
  transition: transform 0.65s ease;
  will-change: transform;
}

.feature-card.flipped .card-inner {
  transform: rotateY(180deg);
}

/* --- CARD CONTENT (FRONT & BACK) --- */
.card-front,
.card-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-radius: inherit;
  backface-visibility: hidden;
}

.card-front {
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(var(--cor-dourado-premium-rgb), 0.05));
}

.card-back {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 1.4rem;
  overflow: hidden;
  border: 1.5px solid rgba(var(--cor-verde-floresta-rgb), 0.16);
  background: var(--cor-branco);
  transform: rotateY(180deg);
}

.card-back::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(var(--cor-verde-floresta-rgb), 0.08), transparent 60%);
  pointer-events: none;
}

.back-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: 220px;
  margin: 0 auto;
  text-align: center;
}

.back-content h3 {
  margin: 0;
  color: var(--cor-verde-floresta);
  font-size: 1.2rem;
  font-weight: var(--peso-bold);
}

.back-content p {
  margin: 0;
  color: rgba(0, 0, 0, 0.75);
  font-size: 0.9rem;
  line-height: 1.4;
}

.back-features {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.back-features li {
  color: rgba(var(--cor-verde-floresta-rgb), 0.8);
  font-size: 0.8rem;
  font-weight: var(--peso-medium);
}

.phone-image {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
}

/* --- INTERACTION HINT --- */
.interaction-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  opacity: 0.7;
  color: var(--cor-dourado-premium);
  font-size: 0.85rem;
  font-weight: var(--peso-medium);
  transition: opacity 0.4s ease, transform 0.4s ease;
  animation: floating-hint 2s ease-in-out infinite;
}

.feature-card.flipped .interaction-hint {
  opacity: 0;
  transform: translateY(5px);
  pointer-events: none;
}

@keyframes floating-hint {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
