@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:wght@300;400;500;600;700&display=swap");

:root {
  --primary: #050505;
  --wine: #141414;
  --wine-deep: #0a0a0a;
  --wine-mid: #2a261b;
  --beige: #f7f3ee;
  --gold: #c7a86d;
  --gold-light: #e8d0a1;
  --gold-dark: #9c7e4a;
  --pistachio: #bfc8a5;
  --white-soft: rgba(255, 255, 255, 0.82);
  --line: rgba(201, 169, 110, 0.28);
  --field-bg: transparent;
  --shadow-gold: 0 0 30px rgba(201, 169, 110, 0.22);
}

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

html,
body {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(120deg, #050505 0%, #111111 48%, #1d1a12 100%);
  color: var(--beige);
  font-family: "DM Sans", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 1;
  background:
    radial-gradient(circle at 18% 14%, rgba(199, 168, 109, 0.18), transparent 30%),
    radial-gradient(circle at 86% 20%, rgba(191, 200, 165, 0.18), transparent 42%),
    radial-gradient(circle at 58% 92%, rgba(232, 208, 161, 0.12), transparent 38%),
    linear-gradient(90deg, rgba(5, 5, 5, 0.96) 0%, rgba(10, 10, 10, 0.9) 44%, rgba(20, 20, 20, 0.52) 72%, rgba(35, 31, 22, 0.54) 100%);
}

body::after {
  z-index: 2;
  background:
    linear-gradient(115deg, transparent 0%, transparent 60%, rgba(199, 168, 109, 0.12) 60.2%, transparent 61%),
    linear-gradient(90deg, rgba(10, 10, 10, 0.2), rgba(191, 200, 165, 0.08), rgba(199, 168, 109, 0.12));
  opacity: 0.58;
  mix-blend-mode: screen;
}

.bg-layer {
  position: fixed;
  inset: 0;
  background-repeat: no-repeat;
  z-index: 0;
  transition: opacity 0.7s ease;
  will-change: opacity;
}

.bg-base {
  background-image: url("img/hero-dani.png");
  background-size: min(48vw, 680px) auto;
  background-position: right 4vw bottom -7vh;
  opacity: 0.76;
  filter: saturate(1.02) contrast(1.05) drop-shadow(0 24px 44px rgba(199, 168, 109, 0.12));
}

.bg-intro {
  background-image: url("img/hero-dani.png");
  background-size: min(48vw, 680px) auto;
  background-position: right 4vw bottom -7vh;
  opacity: 0;
  filter: saturate(1.08) contrast(1.08) drop-shadow(0 24px 44px rgba(201, 169, 110, 0.18));
}

body.intro-bg .bg-intro {
  opacity: 0.82;
}

body.intro-bg .bg-base {
  opacity: 0;
}

form {
  min-height: 100vh;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
  z-index: 3;
}

header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  padding: 0;
  background: rgba(5, 5, 5, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
}

header .container {
  width: 100%;
  padding: 0;
}

.progress-container {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(248, 241, 230, 0.14);
  box-shadow: inset 0 -1px 0 rgba(201, 169, 110, 0.14);
}

.progress-markers,
.progress-question-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.progress-markers {
  z-index: 3;
}

.progress-question-markers {
  z-index: 2;
}

.progress-question-markers span {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 45%;
  background: rgba(248, 241, 230, 0.24);
  transform: translateY(-50%);
  transition: background 0.25s ease, opacity 0.25s ease;
  opacity: 0.65;
}

.progress-question-markers span.active {
  background: rgba(226, 201, 154, 0.95);
  opacity: 1;
}

#progressBar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold-light) 50%, var(--gold) 100%);
  background-size: 200% 100%;
  box-shadow: 0 0 14px rgba(201, 169, 110, 0.62), 0 0 28px rgba(201, 169, 110, 0.32);
  animation: progressShift 5s ease infinite;
  transition: width 0.4s ease;
  z-index: 1;
}

.progress-markers span {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 100%;
  background: rgba(248, 241, 230, 0.38);
  transform: translateY(-50%);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  transform-origin: center center;
}

.progress-markers span.active {
  background: var(--gold-light);
  box-shadow: 0 0 16px rgba(201, 169, 110, 0.85);
}

.progress-markers span.pulse {
  animation: pulseMarker 0.6s ease;
}

@keyframes pulseMarker {
  0% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(2.4); }
  100% { transform: translateY(-50%) scale(1); }
}

@keyframes progressShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

main {
  width: 100%;
  flex: 1;
  min-height: calc(100dvh - 6px);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: clamp(28px, 5.2vh, 54px) 7vw 24px;
}

.perguntas-container {
  width: min(660px, 92vw);
  padding: 0;
  margin: 0 auto;
  position: relative;
}

.question-wrapper {
  position: relative;
  min-height: 220px;
  overflow: visible;
  --question-offset: 24px;
}

.question {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: absolute;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-bottom: 44px;
  transform: translateY(var(--question-offset));
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  z-index: 1;
}

.question:not(.intro):not(.final) {
  align-items: flex-start;
  text-align: left;
}

.question.enter {
  z-index: 1;
  transform: translateY(0);
  opacity: 1;
}

.question.reverse {
  transform: translateY(calc(-1 * var(--question-offset)));
  opacity: 0;
}

.question.reverse.enter {
  transform: translateY(0);
  opacity: 1;
}

.question.exit {
  z-index: 2;
  transform: translateY(calc(-1 * var(--question-offset)));
  opacity: 0;
}

.question.exit-down {
  z-index: 2;
  transform: translateY(var(--question-offset));
  opacity: 0;
  transition-duration: 0.3s;
  transition-timing-function: ease-in;
}

#blockTitle {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 700;
}

.question h2,
.intro h2 {
  width: 100%;
  max-width: 660px;
  margin-bottom: 12px;
  color: var(--beige);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(25px, 3.35vw, 40px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
}

.intro h2 {
  font-size: clamp(28px, 3.65vw, 42px);
}

.question:not(.intro):not(.final) h2 {
  max-width: 580px;
  margin-bottom: 18px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.question-note {
  display: block;
  margin-top: 10px;
  color: rgba(248, 241, 230, 0.58);
  font-family: "DM Sans", sans-serif;
  font-size: 0.42em;
  font-style: normal;
  font-weight: 500;
  line-height: 1.35;
  vertical-align: baseline;
}

.intro h2 .intro-name {
  display: block;
  color: transparent;
  background: linear-gradient(90deg, var(--gold), #fff1d0, var(--gold-light));
  -webkit-background-clip: text;
  background-clip: text;
  font-style: italic;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: flex-start;
}

.intro-text {
  width: min(650px, 100%);
  max-width: 650px;
  color: var(--white-soft);
  font-size: 15px;
  line-height: 1.52;
  font-weight: 300;
}

.intro-text p + p {
  margin-top: 12px;
}

.intro-text strong {
  color: var(--beige);
  font-weight: 700;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.intro > button,
.nav-buttons .next {
  color: var(--primary);
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  box-shadow: 0 10px 30px rgba(201, 169, 110, 0.32);
}

.intro > button {
  margin-bottom: 18px;
}

.intro > button:hover,
.nav-buttons .next:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 34px rgba(201, 169, 110, 0.48);
}

.nav-buttons {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  margin-bottom: 32px;
  padding-bottom: 12px;
  flex-wrap: wrap;
  row-gap: 12px;
  justify-content: flex-start;
}

.nav-buttons .back {
  -webkit-appearance: none;
  appearance: none;
  color: var(--beige);
  background: rgba(5, 5, 5, 0.28);
  background-image: none;
  border-color: rgba(201, 169, 110, 0.44);
  padding: 12px 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-buttons .back::before,
.nav-buttons .back::after {
  content: none !important;
  display: none !important;
}

.nav-buttons .back:hover {
  color: var(--gold-light);
  border-color: rgba(226, 201, 154, 0.72);
  background: rgba(42, 38, 27, 0.44);
}

input,
textarea {
  width: 100%;
  color: var(--beige);
  background: var(--field-bg);
  border: 1px solid var(--line);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  font-family: "DM Sans", sans-serif;
  font-weight: 300;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input {
  max-width: 560px;
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 17px;
  line-height: 1.4;
}

textarea {
  resize: none;
  max-width: 560px;
  min-height: 112px;
  max-height: 220px;
  overflow-y: hidden;
  margin: 10px 0 14px;
  padding: 13px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
}

input:focus,
textarea:focus,
.phone-country-wrap.open .phone-country-trigger {
  border-color: rgba(226, 201, 154, 0.82);
  background: transparent;
  box-shadow: 0 0 0 1px rgba(201, 169, 110, 0.2), var(--shadow-gold);
}

input::placeholder,
textarea::placeholder,
.phone-grid input::placeholder {
  color: rgba(248, 241, 230, 0.38);
}

textarea {
  scrollbar-width: thin;
  scrollbar-color: rgba(226, 201, 154, 0.9) rgba(248, 241, 230, 0.08);
}

textarea::-webkit-scrollbar,
.phone-country-list::-webkit-scrollbar {
  width: 8px;
}

textarea::-webkit-scrollbar-track,
.phone-country-list::-webkit-scrollbar-track {
  background: rgba(248, 241, 230, 0.08);
  border-radius: 999px;
}

textarea::-webkit-scrollbar-thumb,
.phone-country-list::-webkit-scrollbar-thumb {
  background: rgba(226, 201, 154, 0.85);
  border-radius: 999px;
  border: 2px solid rgba(5, 5, 5, 0.75);
}

.phone-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.62fr 1.2fr;
  gap: 12px;
  width: min(560px, 100%);
  margin: 12px 0 18px;
}

.phone-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: rgba(248, 241, 230, 0.72);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}

.phone-grid input,
.phone-grid select,
.phone-country-trigger {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--beige);
  font-size: 14px;
  font-weight: 400;
  outline: none;
}

.phone-grid option {
  color: #111;
}

.phone-country-wrap {
  position: relative;
  z-index: 30;
  isolation: isolate;
}

.phone-country.native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.phone-country-trigger {
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

.phone-country-trigger:hover {
  border-color: rgba(226, 201, 154, 0.62);
}

.phone-country-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--gold-light);
  border-bottom: 2px solid var(--gold-light);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}

.phone-country-wrap.open .phone-country-chevron {
  transform: rotate(-135deg);
}

.phone-country-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(201, 169, 110, 0.36);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(24, 22, 16, 0.98), rgba(5, 5, 5, 0.98));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.38), var(--shadow-gold);
  background-clip: padding-box;
}

.phone-country-wrap.open .phone-country-list {
  display: block;
}

.phone-country-option {
  width: 100%;
  min-height: auto;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--beige);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

.phone-country-option:hover,
.phone-country-option:focus {
  background: rgba(201, 169, 110, 0.13);
  outline: none;
}

.phone-country-option.selected {
  color: var(--primary);
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  width: min(560px, 100%);
  margin: 12px 0 8px;
  align-items: start;
}

.choice {
  width: 100%;
  height: auto;
  min-height: 50px;
  align-self: stretch;
  justify-content: flex-start;
  padding: 12px 13px;
  border: 1px solid rgba(201, 169, 110, 0.28);
  border-radius: 14px;
  background: transparent;
  color: rgba(248, 241, 230, 0.9);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.choice:hover {
  border-color: rgba(226, 201, 154, 0.72);
  background: rgba(201, 169, 110, 0.08);
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.choice.selected {
  color: var(--primary);
  border-color: rgba(255, 241, 208, 0.9);
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  box-shadow: 0 0 0 1px rgba(255, 241, 208, 0.28), 0 10px 28px rgba(201, 169, 110, 0.3);
}

.error-message {
  margin: 2px 0 12px;
  color: #ff9a9c;
  font-size: 14px;
  font-weight: 500;
}

.question.has-error input,
.question.has-error textarea,
.question.has-error .phone-grid input,
.question.has-error .phone-grid select,
.question.has-error .phone-country-trigger {
  border-color: #ff9a9c;
  box-shadow: 0 0 0 1px rgba(255, 154, 156, 0.16);
}

.has-error .error-message {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.thank-you-main {
  justify-content: flex-start;
  position: relative;
  z-index: 3;
}

.thank-you-card {
  max-width: 620px;
}

#thank-you-title {
  color: var(--gold);
}

@media (max-width: 980px) {
  body::before {
    background:
      radial-gradient(circle at 24% 12%, rgba(201, 169, 110, 0.18), transparent 34%),
      radial-gradient(circle at 82% 18%, rgba(191, 200, 165, 0.18), transparent 42%),
      linear-gradient(180deg, rgba(10, 10, 10, 0.78) 0%, rgba(20, 20, 20, 0.86) 52%, rgba(5, 5, 5, 0.94) 100%);
  }

  .bg-base {
    background-size: 96vw auto;
    background-position: right -36vw bottom -8vh;
    opacity: 0.44;
  }

  .bg-intro {
    background-size: 96vw auto;
    background-position: right -36vw bottom -8vh;
  }

  body.intro-bg .bg-intro {
    opacity: 0.58;
  }

  main {
    padding: 32px 5vw 30px;
    align-items: center;
  }

  .perguntas-container {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  body {
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
  }

  form {
    position: relative;
    z-index: 3;
    height: auto;
    overflow: visible;
  }

  .progress-container {
    height: 6px;
    border-radius: 0;
  }

  main {
    min-height: calc(100vh - 6px);
    height: auto;
    padding: 28px 5vw 34px;
    justify-content: flex-start;
  }

  .perguntas-container {
    width: 100%;
  }

  #blockTitle {
    margin-bottom: 14px;
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  .question h2,
  .intro h2 {
    width: 330px;
    max-width: calc(100vw - 48px);
    font-size: clamp(23px, 6.7vw, 31px);
  }

  .intro-text {
    width: 300px;
    max-width: calc(100vw - 64px);
    font-size: 13px;
    line-height: 1.48;
    overflow-wrap: break-word;
  }

  .intro-text p + p {
    margin-top: 10px;
  }

  input {
    font-size: 17px;
  }

  textarea {
    min-height: 118px;
    font-size: 15px;
  }

  .phone-grid {
    grid-template-columns: 1fr;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .choice {
    min-height: 52px;
    font-size: 13px;
  }

  .question {
    padding-bottom: 56px;
  }

  .nav-buttons {
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
  }

  .nav-buttons .back,
  .nav-buttons .next {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 12px;
    padding-right: 12px;
    transition: none;
  }

  .intro > button,
  .nav-buttons .next,
  .nav-buttons .back {
    transform: none;
    transition: none;
  }

  .nav-buttons .back {
    background: rgba(5, 5, 5, 0.28);
  }

  .intro > button:hover,
  .intro > button:active,
  .intro > button:focus,
  .nav-buttons .next:hover,
  .nav-buttons .next:active,
  .nav-buttons .next:focus,
  .nav-buttons .back:hover,
  .nav-buttons .back:active,
  .nav-buttons .back:focus {
    transform: none;
    box-shadow: none;
  }

  .nav-buttons .back:hover,
  .nav-buttons .back:active,
  .nav-buttons .back:focus {
    background: rgba(5, 5, 5, 0.28);
  }

  .intro > button:hover,
  .intro > button:active,
  .intro > button:focus,
  .nav-buttons .next:hover,
  .nav-buttons .next:active,
  .nav-buttons .next:focus {
    background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  }
}

@media (max-width: 420px) {
  .intro > button {
    width: 100%;
  }

  .nav-buttons .next,
  .nav-buttons .back {
    width: auto;
  }

  .bg-base,
  .bg-intro {
    background-position: right -76vw bottom -4vh;
    opacity: 0.34;
  }
}
