/* Define primary and secondary color variables */
:root {
  --primary-color: #6c84ff;
  --secondary-color: #d3daff;
  --gray-color: #9ea0b6;
  --bg-color: white;
  --text-color: #1e1e1e;
  --footer-bg: #d1aee4;
  --max-width: 660px;
  --card-width: 100px;
  --card-width-mobile: 76px;
  --card-height: calc(var(--card-width) * 1.6);
  --card-height-mobile: calc(var(--card-width) * 1.2);
  --primary-color-dark: #eff2ff;
  --text-color-dark: #c2c9ea;
  --bg-color-dark: #040329;
  --profil-color-dark-light: #a1ace9;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* width: 100%; */
  min-height: 100vh;
}
body {
  font-family: "Inter", sans-serif;
  /*background-color: var(--bg-color);*/
  color: var(--text-color);
  text-align: center;
  line-height: 1.5;
  font-size: 18px;
  font-weight: 400;
}
.preload-hidden {
  visibility: hidden;
}

a {
  text-decoration: none;
}
h1 {
  margin: 0;
}
h2 {
  font-family: "Inter", sans-serif;
  font-size: 1.88em;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  padding: 0 0 20px;
}
.dark h2 {
  color: var(--primary-color-dark);
}

h3,
h4 {
  color: var(--secondary-color);
  margin-top: 0px;
  margin-bottom: 8px;
}

label {
  margin-bottom: 0;
}

/* Remove default focus outline and set border to primary color */
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  border-width: 2px;
  box-shadow: 0 0 6px var(--primary-color);
}
/* Optional: Style text selection inside the textarea */
textarea::selection {
  background: var(--primary-color);
  color: white;
}
input::placeholder,
textarea::placeholder {
  font-family: "Inter", sans-serif;
}
.talk-to-advisor {
  display: none;
  margin-top: 30px;
}
button,
.talk-to-advisor {
  display: flex;
  justify-content: space-between;
}

button,
.talk-to-advisor {
  cursor: pointer;
  padding: 20px 30px;
  width: fit-content;
  align-self: center;
  border: none;
  border-radius: 10px;
  color: white;
  background-color: var(--primary-color);
  font-weight: 600;
  font-family: "Inter", sans-serif;
  font-size: 0.88em;
  gap: 15px;
}

.hideOnSubmit img {
  vertical-align: middle;
}
.showOnSubmit {
  display: none;
}

small {
  color: rgb(177, 177, 177);
}
.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}
.light .page-container {
  background-image: url("https://marketing-kasamba.kassrv.com/content/kasamba/ai-tarot-reading/images/ask-the-cards-reveal-the-truth-bg.svg"),
    linear-gradient(to bottom, #ecf1ff, #ffffff);
}
.dark .page-container {
  background-image: url("https://marketing-kasamba.kassrv.com/content/kasamba/ai-tarot-reading/images/ask-the-cards-reveal-the-truth-bg-dark.svg");
  background-color: #020117;
}
.tarot-widget-container {
  flex: 1;
}
.logo {
  padding-top: 20px;
}

.title {
  width: 100%;
  /*background-color: var(--primary-color);*/
  color: var(--primary-color);
  font-size: 1.66em;
  line-height: 1.2;
  font-weight: 500;
  font-family: "Lora", serif;
  padding-top: 40px;
}
.dark .title {
  color: var(--primary-color-dark);
}
.header {
  max-width: var(--max-width);
  margin: 20px auto;
  font-size: 0.88em;
}
.dark .header {
  color: var(--text-color-dark);
}

.readMore {
  color: var(--primary-color);
  text-decoration: none;
}
.txt-highlight {
  font-style: italic;
  font-size: 1em;
  font-weight: 600;
}

/* Form & Input */
.form-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0 auto 80px;
}

form {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.form-title {
  font-family: "Lora", serif;
  margin: 0;
  color: var(--primary-color);
  text-align: center;
  font-size: 1.33em;
  font-weight: 500;
  line-height: 1;
}
.dark .form-title {
  color: var(--primary-color-dark);
}
.choose-a-card {
  padding-top: 30px;
  padding-bottom: 20px;
}
textarea {
  font-family: "Inter", sans-serif;
  width: 555px;
  max-width: 555px;
  height: 45px;
  padding: 12px;
  border-radius: 5px;
  font-size: 0.88em;
  font-weight: 400;
  resize: none;
  overflow: hidden;
  background-color: var(--bg-color);
  border: 1px solid var(--secondary-color);
  caret-color: var(--primary-color); /* sets the blinking cursor color */
  transition: width 0.2s ease;
}
.dark textarea {
  background-color: var(--bg-color-dark);
  border: 1px solid #6677c3;
  color: var(--text-color-dark);
}
.dark textarea::placeholder {
  color: var(--text-color-dark);
}
.form-group {
  max-width: var(--max-width);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.deck-container {
  margin-top: 0px;
  margin-bottom: 0px; /* Reduce space below the deck */
}
.deck {
  height: 215px;
  position: relative;
}

/* Card Styles */
.card {
  perspective: 1000px; /* Enable 3D effect */
  position: absolute;
  bottom: 0;
  left: 50%;
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 20px;
  transform-origin: bottom center;
  transition: transform 0.1s ease;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%) var(--base-transform);
}

.card:hover:not(.centered) {
  /* On hover, move up a bit */
  transform: translateX(-50%) var(--base-transform) translateY(-20px);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card.centered {
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  transition: transform 0.5s ease;
}

/* Flip Animation for Single-Face Approach */
/* When the card is centered and gets "flip-half", it rotates 90° (edge-on) with a scale */
.card.centered.flip-half {
  transform: translate(-50%, -50%) rotateY(90deg) scale(1.2);
}
/* When the card gets "flip-complete", it rotates back to 0° (revealing the new image) */
.card.centered.flip-complete {
  transform: translate(-50%, -50%) rotateY(0deg) scale(1.2);
}
/* Selected card gets a glow */
.card.selected {
  transform: translateX(-50%) var(--base-transform) translateY(-20px);
  cursor: default;
  box-shadow: none;
}

.submitted-question {
  font-size: 1.1em;
  margin-bottom: 10px;
  color: var(--form-text-color);
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.card-name {
  color: var(--text-color);
  text-align: center;
  font-family: "Lora", serif;
  font-size: 1.55em;
  font-style: normal;
  font-weight: 500;
  line-height: 1.2;
  padding-top: 20px;
  margin-bottom: 0;
}
.dark .card-name {
  color: var(--text-color-dark);
}
.response {
  border: var(--secondary-color);
  border-radius: 10px;
  color: var(--text-color);

  display: none;
  max-width: var(--max-width);
}
.dark .response {
  color: var(--text-color-dark);
}
.wait {
  color: var(--gray-color);
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.2;
  display: block;
  margin: 15px 0 0;
}
.spinner-sentence {
  color: #8d8fa8;
}
.interpreting {
  color: var(--text-color);
  text-align: center;
  font-family: "Lora", serif;
  font-size: 1em;
  font-weight: 400;
  line-height: 2;
  display: block;
  margin: 15px 0 0;
}
.dark .interpreting {
  color: var(--text-color-dark);
}

/* CTA button styling */
.cta-button {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  padding: 16px 20px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.4em;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
  transform: scale(1.05);
}

.show {
  display: block;
  opacity: 1;
}

/*GRID*/

.grid-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  text-align: left;
  margin-bottom: 40px;
}

.box {
  box-sizing: border-box;
  width: 374px;
  min-height: 322px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid #dfe2ef;
}
.dark .box {
  background-color: var(--bg-color-dark);
}

.flex-grid {
  display: flex;
}
.flex-grid-jutify-center {
  justify-content: center;
}
.flex-grid-align-item {
  align-items: center;
}
.flex-grid-align-item-start {
  align-items: flex-start;
}
.flex-grid-align-item-end {
  align-items: flex-end;
}
.flex-grid-wrap {
  flex-wrap: wrap;
}
.flex-grid-direction {
  flex-direction: column;
}
.flex-grid-space-between {
  justify-content: space-between;
}
.flex-grid-start {
  justify-content: flex-start;
}
.grid-col-50 {
  width: 50%;
}

.profil {
  align-content: center;
  gap: 16px;
  align-self: stretch;
}
.profil-expert {
  width: 100%;
}
.profil-img {
  display: flex;
  width: 100px;
  height: 100px;
  min-width: 100px;
  border-radius: 8px;
}
.profil-expertname {
  color: #121212;
  font-size: 1.22em;
  font-weight: 700;
  line-height: 150%;
}
.dark .profil-expertname {
  color: var(--primary-color-dark);
}
.profil-title {
  color: #636570;
  font-size: 0.94em;
  font-weight: 400;
  line-height: 150%;
}
.dark .profil-title {
  color: var(--profil-color-dark-light);
}
.profil-available-wrapper {
  gap: 5px;
  padding-top: 5px;
}
.profil-available {
  overflow: hidden;
  color: #7bd137;
  text-overflow: ellipsis;

  font-size: 0.77em;
  font-weight: 400;
  line-height: 140%;
}
.green-circle {
  height: 6px;
  width: 6px;
}
.profil-numbers {
  padding: 16px 0;
}
.profil-reviews {
  gap: 5px;
}
.profil-rate-number,
.profil-reading-number {
  font-size: 1em;
  font-weight: 700;
  line-height: 140%;
  color: #121212;
}
.dark .profil-rate-number,
.dark .profil-reading-number {
  color: var(--primary-color-dark);
}
.profil-reviews-number,
.profil-reading-text {
  color: #636570;
  font-size: 0.77em;
  font-weight: 400;
  line-height: 140%;
}
.dark .profil-reviews-number,
.dark .profil-reading-text {
  color: var(--profil-color-dark-light);
}
.profil-description {
  color: #636570;
  font-size: 0.94em;
  font-style: normal;
  font-weight: 400;
  line-height: 150%;
}
.dark .profil-description {
  color: var(--profil-color-dark-light);
}
.profil-actions {
  padding-top: 16px;
}
.profil-badge {
  background-color: #7bd137;
  padding: 3px 5px;
  border-radius: 8px;
  gap: 3px;
}
.profil-free-min {
  font-size: 0.66em;
  font-weight: 700;
  line-height: 150%;
  color: #ffffff;
}
.profil-price {
  font-size: 1em;
  font-weight: 700;
  line-height: 140%;
  color: #121212;
  padding-top: 5px;
}
.dark .profil-price {
  color: var(--primary-color-dark);
}
.profil-cta {
  background-color: #6c84ff;
  border-radius: 8px;
  padding: 16px;
  min-width: 160px;
  gap: 8px;
}
.profil-cta-text a,
.profil-cta-text a:hover {
  color: #ffffff;
  text-align: center;
  font-size: 0.83em;
  font-weight: 700;
  line-height: 150%;
  display: flex;
}
/* HTML: <div class="loader"></div> */
.loader-wrapper {
  margin-top: 15px;
}
.loader {
  width: 40px;
  aspect-ratio: 1;
  --c: linear-gradient(var(--primary-color) 0 0);
  --r1: radial-gradient(
    farthest-side at bottom,
    var(--primary-color) 93%,
    #0000
  );
  --r2: radial-gradient(farthest-side at top, var(--primary-color) 93%, #0000);
  background: var(--c), var(--r1), var(--r2), var(--c), var(--r1), var(--r2),
    var(--c), var(--r1), var(--r2);
  background-repeat: no-repeat;
  animation: l2 1s infinite alternate;
}
@keyframes l2 {
  0%,
  25% {
    background-size: 8px 0, 8px 4px, 8px 4px, 8px 0, 8px 4px, 8px 4px, 8px 0,
      8px 4px, 8px 4px;
    background-position: 0 50%, 0 calc(50% - 2px), 0 calc(50% + 2px), 50% 50%,
      50% calc(50% - 2px), 50% calc(50% + 2px), 100% 50%, 100% calc(50% - 2px),
      100% calc(50% + 2px);
  }
  50% {
    background-size: 8px 100%, 8px 4px, 8px 4px, 8px 0, 8px 4px, 8px 4px, 8px 0,
      8px 4px, 8px 4px;
    background-position: 0 50%, 0 calc(0% - 2px), 0 calc(100% + 2px), 50% 50%,
      50% calc(50% - 2px), 50% calc(50% + 2px), 100% 50%, 100% calc(50% - 2px),
      100% calc(50% + 2px);
  }
  75% {
    background-size: 8px 100%, 8px 4px, 8px 4px, 8px 100%, 8px 4px, 8px 4px,
      8px 0, 8px 4px, 8px 4px;
    background-position: 0 50%, 0 calc(0% - 2px), 0 calc(100% + 2px), 50% 50%,
      50% calc(0% - 2px), 50% calc(100% + 2px), 100% 50%, 100% calc(50% - 2px),
      100% calc(50% + 2px);
  }
  95%,
  100% {
    background-size: 8px 100%, 8px 4px, 8px 4px, 8px 100%, 8px 4px, 8px 4px,
      8px 100%, 8px 4px, 8px 4px;
    background-position: 0 50%, 0 calc(0% - 2px), 0 calc(100% + 2px), 50% 50%,
      50% calc(0% - 2px), 50% calc(100% + 2px), 100% 50%, 100% calc(0% - 2px),
      100% calc(100% + 2px);
  }
}

.fade-in-down {
  opacity: 0.5;
  transform: translateY(-20px); /* Position initiale plus haute */
  animation: fadeInDown 1.2s ease-out forwards;
}

/* Animation */
@keyframes fadeInDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Tablet: 2 cols + 1 centered below */
@media (min-width: 768px) and (max-width: 1139px) {
  .grid-wrapper {
    justify-content: center;
  }

  .box:nth-child(3) {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Desktop: 3 cols, centered */
@media (min-width: 1140px) {
  .grid-wrapper {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .flex-grid-direction-mobile {
    flex-direction: column;
  }
  .box {
    width: 324px;
  }
}

/*END GRID*/
.mobile-hide {
  display: block;
}
.desktop-hide {
  display: none;
}

/* Responsive styling */
@media (max-width: 600px) {
  .mobile-hide {
    display: none;
  }
  .desktop-hide {
    display: block;
  }

  .page-container {
    background-position: top center;
    background-size: contain;
  }
  .light .page-container {
    background-image: url("https://marketing-kasamba.kassrv.com/content/kasamba/ai-tarot-reading/images/ask-the-cards-reveal-the-truth-bg-mobile.svg"),
      linear-gradient(to bottom, #ecf1ff, #ffffff);
  }
  .dark .page-container {
    background-image: url("https://marketing-kasamba.kassrv.com/content/kasamba/ai-tarot-reading/images/ask-the-cards-reveal-the-truth-bg-dark-mobile.svg");
    background-color: #020117;
  }
  .tarot-widget-container .title {
    font-size: 1.2em;
    padding-top: 20px;
  }
  .tarot-widget-container .header {
    font-size: 0.83em;
    width: 100%;
    max-width: 100%;
    padding: 0 14px;
    margin: 10px 0 20px;
  }
  .tarot-widget-container .header p {
    /*margin: 1em 0.3em 0em 0.3em;*/
    margin: 0;
  }
  .form-wrapper {
    padding: 0 15px 8px;
    margin-bottom: 15px;
  }

  .form-group {
    flex-direction: column;
    gap: 0;
  }

  .form-title {
    font-size: 1.22em;
    text-align: center;
    margin-bottom: 0;
  }
  .form-group label {
    margin-bottom: 0;
  }
  .choose-a-card {
    padding-bottom: 0;
    margin-bottom: 0;
    padding-top: 30px;
  }
  textarea {
    width: 325px;
    max-width: 325px;
  }
  .deck {
    height: 200px;
    position: relative;
  }
  .card {
    -webkit-tap-highlight-color: transparent;
    width: var(--card-width-mobile);
    height: var(--card-height-mobile);
  }

  .cta-button {
    flex: 1;
    font-weight: 600;
    padding: 8px 24px;
    border-radius: 5px;
    font-size: 1.2em;
  }
  .response {
    padding: 0 20px;
  }
  button {
    width: 95%;
  }
  button div {
    width: 90%;
  }
}
