﻿:root {
  color-scheme: light;
  --bg: #f4e7c5;
  --ink: #1a1a1a;
  --muted: #5f574c;
  --panel: rgba(255, 252, 244, 0.96);
  --panel-strong: #fff9ea;
  --line: #d7c294;
  --accent: #5a3e2b;
  --button: #000000;
  --button-hover: #222222;
  --gold: #d4a017;
  --green: #2f6f4e;
  --red: #a94442;
  --shadow: 0 14px 30px rgba(54, 40, 23, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(244, 231, 197, 0.68), rgba(244, 231, 197, 0.86)),
    url("../assets/fundo-pergaminho.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--ink);
}

button {
  font: inherit;
}

.app-shell {
  width: min(960px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 16px;
  display: grid;
  place-items: center;
}

.quiz-card {
  width: min(780px, 100%);
  min-height: 560px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand-row,
.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.quiz-brand {
  color: #1a1a1a;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.prototype-label,
.kicker,
.source-text,
.notice {
  color: var(--muted);
  font-size: 0.94rem;
}

.prototype-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  line-height: 1.6;
  color: #333333;
}

h1,
h2,
h3 {
  font-weight: 700;
}

h1,
h2 {
  margin-bottom: 16px;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.35rem);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  letter-spacing: -0.3px;
  line-height: 1.13;
}

.lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.08rem;
}

#result-title,
#result-message,
.perfect-score-note {
  white-space: pre-line;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.meta-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 249, 234, 0.86);
}

.meta-item strong {
  display: block;
  margin-bottom: 4px;
}

.primary-button,
.secondary-button,
.option-button {
  cursor: pointer;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: 25px;
  background: var(--button);
  color: var(--gold);
  font-weight: 600;
}

.primary-button:hover,
.secondary-button:hover {
  background: var(--button-hover);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.progress-track {
  height: 10px;
  margin-bottom: 28px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6d2a9;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.intro-question {
  background: #f4efe6;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 20px;
  border-radius: 16px;
  line-height: 1.55;
  text-align: left;
}

.intro-question strong,
.intro-question span {
  display: block;
}

.intro-question strong {
  margin-bottom: 8px;
}

.intro-question span {
  margin-bottom: 12px;
}

.intro-question span:last-child {
  margin-bottom: 0;
}

.options-list {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.option-button {
  width: 100%;
  min-height: 58px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--button);
  color: var(--gold);
  font-weight: 600;
  text-align: left;
  line-height: 1.35;
}

.option-button:hover:not(:disabled) {
  background: var(--button-hover);
}

.option-button.is-correct {
  border-color: var(--green);
  background: rgba(47, 111, 78, 0.16);
  color: var(--ink);
}

.option-button.is-wrong {
  border-color: var(--red);
  background: rgba(169, 68, 66, 0.14);
  color: var(--ink);
}

.option-button:disabled {
  cursor: default;
}

button.selected {
  transform: scale(0.97);
}

.answer-feedback {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff8e8;
  line-height: 1.5;
}

.answer-feedback.correct {
  border-color: rgba(40, 120, 60, 0.35);
  background: #f0f7ee;
  animation: popCorrect 0.25s ease;
}

.answer-feedback.wrong {
  border-color: rgba(160, 60, 40, 0.35);
  background: #fff1ec;
  animation: popWrong 0.25s ease;
}

@keyframes popCorrect {
  0% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

@keyframes popWrong {
  0% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

.answer-feedback strong,
.answer-feedback h3 {
  display: block;
  margin-bottom: 8px;
}

.answer-feedback p {
  color: var(--muted);
}

.score-badge {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  margin: 8px 0 18px;
  padding: 0 18px;
  border-radius: 25px;
  background: var(--button);
  color: var(--gold);
  font-weight: 800;
}

.notice {
  padding: 14px 16px;
  border: 1px dashed var(--red);
  border-radius: 14px;
  background: rgba(169, 68, 66, 0.08);
}

.recommendations {
  margin: 26px 0;
}

.recommendations ul {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.recommendations li {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  overflow: hidden;
}

.recommendation-card {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
}

.recommendation-card.clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.recommendation-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.recommendation-card.em-breve {
  cursor: default;
  opacity: 0.78;
}

.recommendation-type,
.recommendation-status {
  color: var(--muted);
  font-size: 0.88rem;
}

.recommendation-title {
  color: var(--ink);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.recommendation-card:hover .recommendation-title {
  color: var(--accent);
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .app-shell {
    padding: 14px;
    align-items: start;
  }

  .quiz-card {
    min-height: auto;
    padding: 20px;
  }

  .brand-row,
  .progress-row {
    align-items: flex-start;
    flex-direction: column;
  }

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