/* ============================================================
   Prosperity & Faith - clone da landing de seleção de cartas
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --wine: #9d053e;
  --pink: #ff0066;
  --pink-light: #ff4081;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #1a0010;
  color: #fff;
}

/* ---------- Tela de carregamento ---------- */
.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-text {
  color: #fff;
  font-size: 1.25rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ---------- Layout principal ---------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  position: relative;
}

.bg-fixed {
  position: fixed;
  inset: 0;
  z-index: 0;
}
.bg-fixed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content {
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 72rem;
  padding: 2rem 1rem;
}

.logo-header {
  margin-bottom: 1.5rem;
}
.logo-header img {
  max-width: 20rem;
  margin: 0 auto;
  display: block;
}

.main-title {
  font-size: 2.25rem;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 1.5rem;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 2px 10px #9d053e4d;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #f06, #9d053e, #f06);
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 900;
}

.subtitle-block {
  margin-bottom: 1rem;
}

.cta-text {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 2px 4px #0006;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #f06, #9d053e, #f06);
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 800;
}

/* ---------- Barra de progresso ---------- */
.progress-container {
  background-color: #ffffffb3;
  border: 1px solid #ffffff80;
  border-radius: 20px;
  justify-content: space-between;
  width: 100%;
  max-width: 300px;
  height: 14px;
  margin: 15px auto;
  padding: 2px;
  display: flex;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 8px #0003, 0 0 5px #ffffff4d;
}
.progress-segment {
  background-color: #ffffff80;
  border: 1px solid #ffffff4d;
  border-radius: 10px;
  flex: 1;
  height: 100%;
  margin: 0 3px;
  position: relative;
  overflow: hidden;
}
.progress-segment-fill {
  background: linear-gradient(90deg, #f06, #ff4081);
  border-radius: 8px;
  width: 0%;
  height: 100%;
  transition: width 0.8s;
  box-shadow: 0 0 10px #ff0066b3;
}
.progress-segment.active .progress-segment-fill {
  width: 100%;
}

/* ---------- Instrução ---------- */
.instruction-container {
  margin-top: 1rem;
  background: linear-gradient(135deg, #ff6699b3, #ff0066b3);
  border: 1px solid #ffffff4d;
  border-radius: 30px;
  padding: 2px;
  box-shadow: 0 4px 15px #0003;
}
.instruction-text {
  letter-spacing: 0.5px;
  color: #9d053e;
  background-color: #ffffffe6;
  border-radius: 28px;
  padding: 8px 16px;
  font-weight: 600;
  text-align: center;
  display: block;
}

/* ---------- Cartas ---------- */
.cards-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.card {
  perspective: 1000px;
  cursor: pointer;
  border-radius: 15px;
  width: 120px;
  height: 200px;
  transition: transform 0.3s;
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-10px);
}
.card::after {
  content: "";
  opacity: 0.7;
  z-index: 10;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff' width='24px' height='24px'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E");
  background-position: 50%;
  background-repeat: no-repeat;
  width: 40px;
  height: 40px;
  transition: opacity 0.3s;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.card.flipped::after {
  opacity: 0;
}
.card-inner {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  border-radius: 15px;
  transition: transform 0.6s;
  position: relative;
  box-shadow: 0 4px 12px #0000004d;
}
.card.flipped .card-inner {
  transform: rotateY(180deg);
}
.card-front,
.card-back {
  backface-visibility: hidden;
  border-radius: 15px;
  width: 100%;
  height: 100%;
  position: absolute;
  overflow: hidden;
}
.card-front {
  transform: rotateY(180deg);
}
.card-back img,
.card-front img {
  object-fit: cover;
  pointer-events: none;
  border-radius: 15px;
  width: 100%;
  height: 100%;
}
.card.selected {
  pointer-events: none;
}

/* ---------- Cartas finais ---------- */
.final-cards-container {
  gap: 10px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 20px 0;
  position: relative;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  display: flex !important;
}
.final-cards-container .card {
  flex: none;
  width: 120px;
  margin: 0 !important;
  position: static !important;
  transform: none !important;
}
.card.selected-final {
  border: 2px solid #ffffff4d;
  border-radius: 15px;
  width: 120px;
  height: 200px;
  box-shadow: 0 4px 8px #0000004d;
  margin: 0 !important;
  position: static !important;
  transform: none !important;
}
.card.selected:hover,
.card.selected-final:hover,
.final-cards-container .card:hover {
  transform: none !important;
}

/* ---------- Mensagem de leitura ---------- */
.reading-message {
  text-align: center;
  opacity: 0;
  background: linear-gradient(135deg, #ffffffe6, #fff0f5f2);
  border: 2px solid #f06;
  border-radius: 15px;
  max-width: 600px;
  margin-top: 30px;
  padding: 25px;
  transition: all 0.8s;
  position: relative;
  overflow: hidden;
  transform: translateY(20px);
  box-shadow: 0 10px 30px #0000004d, 0 0 20px #ff00664d;
}
.reading-message.visible {
  opacity: 1;
  transform: translateY(0);
}
.reading-message h3 {
  color: #9d053e;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px #0003;
  margin-bottom: 15px;
  font-size: 1.7rem;
  font-weight: 800;
}
.reading-message p {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.1rem;
  line-height: 1.6;
}
.reading-message-icon {
  color: #f06;
  margin-bottom: 15px;
  font-size: 2.5rem;
}
.reading-message-icon svg {
  width: 3rem;
  height: 3rem;
  margin: 0 auto;
  display: block;
  color: #ff0066;
}
.txt-wine {
  color: #9d053e;
  font-weight: 700;
}

/* ---------- Botão CTA ---------- */
.cta-wrap {
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.cta-button {
  letter-spacing: 0.8px;
  text-align: center;
  background: linear-gradient(135deg, #f06, #9d053e);
  border: 2px solid #fff6;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  transition: all 0.3s;
  display: flex;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 20px #9d053eb3, 0 0 15px #ff006680;
  color: #fff;
  text-decoration: none;
  padding: 1rem 2.5rem;
  border-radius: 9999px;
  font-size: 1.25rem;
}
.cta-button:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 25px #9d053ee6, 0 0 20px #ff0066b3;
}
.cta-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ---------- Animações ---------- */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-in {
  animation: 1.5s ease-out forwards fadeIn;
}
@keyframes pulseSlow {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  to {
    opacity: 0.8;
  }
}
.animate-pulse-slow {
  animation: 3s infinite pulseSlow;
}
@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}

a:focus,
button:focus {
  outline-offset: 2px;
  outline: 2px solid #f06;
}

/* ---------- Responsivo ---------- */
@media (min-width: 768px) {
  .main-title {
    font-size: 3rem;
  }
  .cta-text {
    font-size: 1.875rem;
  }
  .cards-area {
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .card {
    width: 90px;
    height: 150px;
  }
  .card::after {
    width: 30px;
    height: 30px;
  }
  .card.selected-final {
    width: 90px;
    height: 150px;
  }
  .final-cards-container {
    gap: 15px;
  }
  .reading-message {
    margin-top: 20px;
    padding: 15px;
  }
  .reading-message h3 {
    font-size: 1.2rem;
  }
  .reading-message p {
    font-size: 1rem;
  }
  .cta-button {
    padding: 12px 25px;
    font-size: 1.1rem;
  }
}
