:root {
  --primary: #EBC124;
  --primary-hover: #eeca49;
  --secondary: #7A5CFF;
  --secondary-hover: #6747e5;
  --bg-color: #F7F8FA;
  --bg-relax: #EDEDF5;
  /* Soft purple/blue for resting */
  --text-dark: #2D3748;
  --text-light: #718096;
  --card-bg: #FFFFFF;
  --border-radius: 16px;
  --transition-speed: 0.4s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-speed) ease;
}

body.relax-mode {
  background-color: var(--secondary);
  color: var(--bg-color);
}

/* Força os textos ficarem claros no modo relax */
body.relax-mode h1,
body.relax-mode h2,
body.relax-mode p,
body.relax-mode .subtitle,
body.relax-mode label {
  color: var(--bg-color);
}

/* Ajusta o campo de texto (textarea) para o modo escuro */
body.relax-mode input[type="text"],
body.relax-mode input[type="email"],
body.relax-mode input[type="tel"],
body.relax-mode textarea {
  background-color: transparent;
  color: var(--bg-color);
  border-color: rgba(255, 255, 255, 0.5);
}

body.relax-mode input:focus,
body.relax-mode textarea:focus {
  border-color: var(--primary);
}

body.relax-mode input::placeholder,
body.relax-mode textarea::placeholder {
  color: rgba(255, 255, 255, 0.85);
  opacity: 1;
}

/* Deixa os botões de voltar e avançar visíveis (branco claro) no modo relax */
body.relax-mode .btn-nav {
  color: rgba(255, 255, 255, 0.7);
}

body.relax-mode .btn-nav:hover {
  color: #FFFFFF;
}

.app-container {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Screens Setup */
.screen {
  display: none;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp var(--transition-speed) ease forwards;
  width: 100%;
}

.screen.active {
  display: flex;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typography */
h1,
h2 {
  color: var(--secondary);
  margin-bottom: 1rem;
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

p,
.subtitle {
  color: var(--text-dark);
  margin-bottom: 1.6rem;
  line-height: 1.6;
  font-size: 1rem;
}

.highlight {
  background-color: var(--primary);
  color: var(--text-dark);
  padding: 2px 4px;
  border-radius: 4px;
}

/* Inputs */
.input-group {
  margin-bottom: 1.5rem;
  width: 100%;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid #E2E8F0;
  border-radius: var(--border-radius);
  font-size: 1rem;
  background-color: var(--card-bg);
  transition: border-color 0.3s ease;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--secondary);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Buttons */
.btn-primary {
  background-color: var(--primary);
  color: #372375;
  /* Roxo Escuro */
  border: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1.125rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
  width: 100%;
  text-shadow: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background-color: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Options Grid / List */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.option-btn {
  background-color: var(--card-bg);
  border: 2px solid #E2E8F0;
  padding: 1rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  align-items: center;
}

.option-btn:hover {
  border-color: var(--secondary);
  background-color: #f8f7ff;
}

.option-btn.selected {
  border-color: var(--secondary);
  background-color: var(--secondary);
  color: #fff;
}

/* Slider / Range */
.slider-container {
  margin: 3rem 0 2rem;
  position: relative;
}

.value-bubble {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--secondary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.125rem;
}

.value-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: var(--secondary) transparent transparent transparent;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: #E2E8F0;
  border-radius: 5px;
  outline: none;
  margin-top: 10px;
  border: none;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(235, 193, 36, 0.5);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Success Graphic */
.success-graphic {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 5rem;
}

/* Book Corner (Tela 9) */
.book-corner {
  position: absolute;
  bottom: 0;
  left: -150px;
  width: 350px;
  transform-origin: center center;
  pointer-events: none;
  z-index: 10;
}

/* Book top (Tela 9) */
.book-top {
  width: 150px;
  margin-left: 200px;
}



/* Book Image Mock */
.book-mock {
  width: 400px;
  height: auto;
  display: block;
  margin-bottom: -80px;
}

/* Error States */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  50% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-5px);
  }
}

.input-error {
  border-color: #EF4444 !important;
  /* Vermelho erro */
  animation: shake 0.4s ease-in-out;
}

/* Global Navigation (Back / Forward) */
.global-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: transparent;
  z-index: 100;
  pointer-events: none;
  /* Let clicks pass through empty space */
}

.global-nav.hidden {
  display: none;
}

.btn-nav {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.btn-nav:hover {
  color: var(--text-dark);
}

.btn-nav:disabled {
  opacity: 0;
  cursor: default;
  pointer-events: none;
}

/* Yellow Mode (Tela 1) */
body.yellow-mode {
  background-color: var(--primary);
  color: var(--text-dark);
}

body.yellow-mode .highlight {
  background-color: var(--text-dark);
  color: var(--primary);
}

body.yellow-mode .btn-primary {
  background-color: var(--text-dark);
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

body.yellow-mode .btn-primary:hover {
  background-color: #1a202c;
  /* Cor chumbo mais escura */
}