:root {
  --font-sans: 'Montserrat', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: 'Playfair Display', ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;

  /* Capital Inteligente Palette */
  --primary: #B8860B; /* Gold */
  --primary-hover: #9A7009;
  --primary-light: #CFB53B;
  
  --bg-dark: #0B1120; /* Deep Slate */
  --bg-navy: #0F172A; /* Navy Slate */
  
  --bg-gradient-start: #0B1120;
  --bg-gradient-end: #0F172A;
  
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
  --card-bg: rgba(15, 23, 42, 0.75);
  
  --emerald-50: #ecfdf5;
  --emerald-600: #059669;
  --blue-50: #eff6ff;
  --blue-600: #2563eb;
  
  --indigo-50: #1e293b; /* Remapped to dark slate */
  --indigo-100: #334155;
  --indigo-300: #94a3b8;
  --indigo-400: #cbd5e1;
  --indigo-500: #B8860B; /* Gold for main accents instead of indigo */
  --indigo-600: #B8860B;
  --indigo-700: #9A7009;
  --indigo-900: #0B1120;
  --indigo-950: #0B1120;
  
  --rose-500: #f43f5e;
  --slate-50: #0f172a;
  --slate-100: #1e293b;
  --slate-200: #334155;
  --slate-300: #475569;
  --slate-400: #64748b;
  --slate-500: #94a3b8;
  --slate-600: #cbd5e1;
  --slate-700: #e2e8f0;
  --slate-800: #f1f5f9;
  --slate-900: #f8fafc;
}

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

body {
  font-family: var(--font-sans);
  background: radial-gradient(ellipse at top, var(--bg-gradient-start), var(--slate-50), var(--bg-gradient-end));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--text-main);
  overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(2rem); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInBottom {
  from { opacity: 0; transform: translateY(2rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* Screens */
.screen {
  display: none;
  width: 100%;
  max-width: 56rem; /* 896px */
  margin: 0 auto;
}

.screen.active {
  display: block;
  animation: fadeIn 0.7s ease-out forwards;
}

.screen.fade-out {
  animation: fadeOut 0.4s ease-out forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  min-height: 550px;
}

.card-horizontal {
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .card-horizontal {
    flex-direction: row;
  }
}

.card-vertical {
  display: flex;
  flex-direction: column;
  max-width: 42rem;
  margin: 0 auto;
}

/* Start Screen specific */
.card-left {
  background: var(--bg-dark);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .card-left {
    width: 41.666667%;
  }
  .card-right {
    width: 58.333333%;
  }
}

.decoration-gradient::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  width: 16rem;
  height: 16rem;
  background: rgba(129, 140, 248, 0.3);
  border-radius: 50%;
  filter: blur(3rem);
}

.decoration-gradient::after {
  content: '';
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 12rem;
  height: 12rem;
  background: rgba(251, 113, 133, 0.2);
  border-radius: 50%;
  filter: blur(2rem);
}

.icon-box {
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
  color: white;
}

.icon-box-large {
  width: 4rem;
  height: 4rem;
  border-radius: 1.25rem;
}

.bg-indigo-light {
  background: var(--indigo-50);
  border-color: var(--indigo-100);
}

.text-indigo { color: var(--indigo-600); }

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 900;
  color: white;
  letter-spacing: -0.025em;
  position: relative;
  z-index: 10;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }
}

.text-gradient {
  background: linear-gradient(135deg, #CFB53B 0%, #B8860B 50%, #8B6914 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  color: rgba(224, 231, 255, 0.8);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.625;
  position: relative;
  z-index: 10;
}

.card-right {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-navy);
}

@media (min-width: 768px) {
  .card-right {
    padding: 3rem;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  background: var(--indigo-50);
  border: 1px solid var(--indigo-100);
  color: var(--indigo-700);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  width: max-content;
}

.badge i {
  width: 14px;
  height: 14px;
  margin-right: 0.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  font-weight: 800;
  color: white;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--slate-600);
  margin-bottom: 2rem;
  line-height: 1.625;
  font-size: 1.125rem;
}

.features {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.feature-item {
  display: flex;
  align-items: center;
  color: var(--slate-700);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
}

.feature-icon.bg-emerald { background: var(--emerald-50); color: var(--emerald-600); }
.feature-icon.bg-blue { background: var(--blue-50); color: var(--blue-600); }

/* Buttons */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #CFB53B 0%, #B8860B 50%, #8B6914 100%);
  color: white;
  width: 100%;
}

@media (min-width: 640px) {
  .btn-primary {
    width: auto;
  }
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(184, 134, 11, 0.4);
  filter: brightness(1.1);
}

.btn-primary i {
  position: relative;
  z-index: 10;
  margin-left: 0.75rem;
  transition: transform 0.3s ease;
}

.btn-primary:hover i {
  transform: translateX(4px);
}

.w-full { width: 100% !important; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }

/* Quiz Screen */
.quiz-header {
  padding: 2rem 2rem 1rem 2rem;
}

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.btn-back {
  padding: 0.625rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-back:disabled {
  color: var(--slate-300);
  background: var(--slate-50);
  border: 1px solid transparent;
  cursor: not-allowed;
}

.btn-back:not(:disabled) {
  color: var(--slate-600);
  background: white;
  border: 1px solid var(--slate-100);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-back:not(:disabled):hover {
  background: var(--slate-100);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.quiz-title {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quiz-title .subtitle {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--indigo-600);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.quiz-title .progress-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-400);
}

.progress-bar-container {
  width: 100%;
  height: 0.375rem;
  background: var(--slate-100);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--indigo-500), var(--indigo-600));
  border-radius: 9999px;
  width: 0%;
  transition: width 0.7s ease-out;
}

.quiz-body {
  padding: 0 2rem 2rem 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.quiz-body.animating {
  opacity: 0;
  transform: scale(0.95);
}

.quiz-body.slide-in {
  animation: slideInRight 0.5s ease forwards;
}

.question-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 2rem;
  margin-top: 1rem;
  line-height: 1.25;
}

@media (min-width: 768px) {
  .question-text {
    font-size: 1.875rem;
  }
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: auto;
}

.option-btn {
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  border: 2px solid var(--slate-200);
  background: var(--bg-navy);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.option-btn:hover:not(.selected) {
  border-color: var(--indigo-300);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.option-btn.selected {
  border-color: var(--indigo-600);
  background: rgba(238, 242, 255, 0.8);
  box-shadow: 0 10px 15px -3px rgba(165, 180, 252, 0.5);
  transform: scale(1.02);
}

.option-bg {
  position: absolute;
  right: -2.5rem;
  top: -2.5rem;
  width: 8rem;
  height: 8rem;
  background: linear-gradient(to bottom right, var(--indigo-100), transparent);
  border-radius: 50%;
  filter: blur(1rem);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.option-btn.selected .option-bg {
  opacity: 1;
}

.option-icon-container {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 1rem;
  z-index: 10;
  transition: all 0.3s ease;
  background: var(--slate-50);
  border: 1px solid transparent;
}

.option-btn:hover .option-icon-container {
  background: var(--indigo-50);
}

.option-btn.selected .option-icon-container {
  background: white;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  border-color: var(--indigo-100);
}

.option-icon {
  width: 1.5rem;
  height: 1.5rem;
  transition: color 0.3s ease;
  color: var(--slate-400);
}

.option-btn:hover .option-icon {
  color: var(--indigo-500);
}

.option-btn.selected .option-icon {
  color: white;
}

.option-content {
  flex-grow: 1;
  z-index: 10;
  padding-right: 1rem;
}

.option-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  transition: color 0.3s ease;
  color: var(--slate-400);
}

.option-btn:hover .option-label { color: var(--indigo-400); }
.option-btn.selected .option-label { color: var(--indigo-500); }

.option-text {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.375;
  transition: color 0.3s ease;
  color: var(--slate-600);
}

@media (min-width: 768px) {
  .option-text { font-size: 1.125rem; }
}

.option-btn.selected .option-text { color: var(--indigo-950); }

.radio-indicator {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--slate-300);
  margin-left: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 10;
  transition: all 0.3s ease;
}

.option-btn:hover .radio-indicator { border-color: var(--indigo-400); }
.option-btn.selected .radio-indicator { border-color: var(--indigo-600); background: var(--indigo-600); }

.radio-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: white;
  transition: all 0.3s ease;
  transform: scale(0);
  opacity: 0;
}

.option-btn.selected .radio-dot {
  transform: scale(1);
  opacity: 1;
}

/* Email Capture Screen */
.email-card {
  padding: 3rem 2rem;
  text-align: center;
}

.email-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
}

.input-group {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  font-size: 1.125rem;
  font-family: inherit;
  color: white;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  outline: none;
}

.form-input:focus {
  border-color: #B8860B;
  box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.2);
}

.form-input::placeholder {
  color: var(--slate-400);
}

.terms-text {
  font-size: 0.875rem;
  color: var(--slate-500);
}

/* Results Screen */
.results-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  animation: slideInBottom 0.7s ease forwards;
}

@media (min-width: 768px) {
  .results-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.result-card {
  border-radius: 1.5rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-card {
  background: var(--bg-navy);
  border: 1px solid var(--slate-100);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.theme-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0.5rem;
  background: var(--slate-200); /* default, overriden by js */
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.profile-icon {
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.profile-icon svg {
  width: 2.5rem;
  height: 2.5rem;
}

.profile-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 800;
}

.profile-desc {
  color: var(--slate-400); /* Slightly lighter for readability over dark background */
  line-height: 1.625;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.tips-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.tips-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  margin-bottom: 2rem;
  flex-grow: 1;
}

.tips-item {
  display: flex;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--slate-300);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.tips-item svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
  color: var(--primary);
}

.risk-meter {
  margin-top: auto;
}

.risk-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.risk-bar-container {
  height: 0.75rem;
  width: 100%;
  background: var(--slate-100);
  border-radius: 9999px;
  position: relative;
  margin-bottom: 0.75rem;
}

.risk-bar-bg {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(to right, var(--slate-400), var(--indigo-500), var(--rose-500));
  opacity: 0.2;
  border-radius: 9999px;
}

.risk-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 1s ease-out;
  position: relative;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  width: 5%; /* Min width */
}

.risk-bar-dot {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.5rem;
  height: 1rem;
  background: white;
  border-radius: 9999px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.score-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--slate-500);
  font-weight: 500;
}

.font-bold { font-weight: 700; color: var(--slate-700); }

/* Allocation Card */
.allocation-card {
  background: var(--bg-dark); /* Using dark navy background so text is readable */
  color: white;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.5);
  align-items: center;
  justify-content: center;
}

.blob {
  position: absolute;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  mix-blend-mode: multiply;
  filter: blur(3rem);
  opacity: 0.2;
  animation: pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.blob-1 {
  background: var(--indigo-500);
  top: -3rem;
  right: -3rem;
}

.blob-2 {
  background: var(--rose-500);
  bottom: -3rem;
  left: -3rem;
  animation-delay: 2s;
}

@keyframes pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.3; }
}

.z-10 { z-index: 10; position: relative; }

.allocation-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

.chart-container {
  position: relative;
  width: 12rem;
  height: 12rem;
  margin: 0 auto 2rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  animation: spinIn 1s ease-out;
}

@keyframes spinIn {
  from { transform: rotate(-180deg) scale(0.5); opacity: 0; }
  to { transform: rotate(-90deg) scale(1); opacity: 1; }
}

.donut-bonds, .donut-stocks {
  fill: transparent;
  stroke-width: 6;
  transition: stroke-dasharray 1s ease-out, stroke-dashoffset 1s ease-out;
}

.donut-bonds { stroke: var(--slate-400); }
.donut-stocks {
  stroke: var(--indigo-600);
  filter: drop-shadow(0 4px 3px rgba(0,0,0,0.07));
}

.chart-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: zoomIn 0.7s ease-out 0.3s both;
}

@keyframes zoomIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.chart-percentage {
  font-size: 1.875rem;
  font-weight: 900;
  color: white;
}

.chart-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legend-container {
  width: 100%;
  max-width: 20rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 0.75rem;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.3s;
}

.bg-glass { background: rgba(255, 255, 255, 0.1); }
.bg-glass:hover { background: rgba(255, 255, 255, 0.15); }
.bg-glass-dark { background: rgba(255, 255, 255, 0.05); }
.bg-glass-dark:hover { background: rgba(255, 255, 255, 0.1); }

.legend-label {
  display: flex;
  align-items: center;
  font-weight: 500;
}

.bg-glass-dark .legend-label { color: var(--slate-300); }

.legend-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  margin-right: 0.75rem;
}

.dot-stocks {
  background: var(--indigo-500);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.dot-bonds { background: var(--slate-400); }

.legend-value {
  font-weight: 700;
  font-size: 1.125rem;
}

.bg-glass-dark .legend-value { color: var(--slate-300); }

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 20rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(12px);
  font-family: inherit;
  font-size: 1rem;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-outline i {
  margin-right: 0.5rem;
  width: 1.25rem;
  height: 1.25rem;
}
