/* ============================================
   QUIZ DEPARTAMENTAL — style.css
   Minimalista · Fundo Branco · Montserrat
   ============================================ */

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

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8f8;
  --border: #e4e8e8;
  --border-strong: #c8d4d4;

  --text-primary: #141414;
  --text-secondary: #5a6a6a;
  --text-muted: #9aacac;

  --teal: #397f8e;
  --teal-light: #4698a3;
  --teal-soft: rgba(57, 127, 142, 0.08);
  --teal-softer: rgba(57, 127, 142, 0.05);
  --green: #9dc540;
  --green-soft: rgba(157, 197, 64, 0.1);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Montserrat', sans-serif;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ============================================
   APP WRAPPER
   ============================================ */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   SCREENS
   ============================================ */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  animation: fadeUp 0.38s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.screen.active {
  display: flex;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

/* ============================================
   INTRO SCREEN
   ============================================ */
.screen-intro {
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem 3rem;
}

.intro-inner {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

/* Logo */
.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.logo-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 50%;
}

.logo-name {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Divider */
.intro-divider {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--green));
  border-radius: 2px;
}

/* Text block */
.intro-text-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.intro-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
}

.intro-title {
  font-size: clamp(1.9rem, 7vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.accent-text {
  color: var(--teal);
}

.intro-sub {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Dept tags */
.dept-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.dept-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--teal-light);
  background: var(--teal-softer);
  border: 1px solid rgba(57, 127, 142, 0.18);
  border-radius: 100px;
  padding: 0.35rem 0.85rem;
  transition: var(--transition);
}

.dept-tag:hover {
  background: var(--teal-soft);
  border-color: rgba(57, 127, 142, 0.35);
}

/* CTA Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--teal);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 100px;
  padding: 0.9rem 2rem;
  cursor: pointer;
  width: 100%;
  max-width: 280px;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(57, 127, 142, 0.25);
}

.btn-primary:hover {
  background: var(--teal-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(57, 127, 142, 0.35);
}

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

.intro-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   QUIZ SCREEN
   ============================================ */
.screen-quiz {
  padding: 0;
  justify-content: flex-start;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.btn-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-back:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-softer);
}

.progress-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--green));
  border-radius: 100px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-counter {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}

/* Question area */
.question-wrap {
  padding: 2.5rem 1.4rem 3rem;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.q-step {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal);
  margin-bottom: 0.6rem;
}

.q-text {
  font-size: clamp(1.1rem, 3.5vw, 1.4rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.option-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.option-btn:hover {
  border-color: var(--teal);
  background: var(--teal-softer);
  color: var(--teal);
}

.option-btn:active {
  transform: scale(0.99);
}

.option-letter {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s;
  letter-spacing: 0;
}

.option-btn:hover .option-letter {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

.option-btn.selected {
  border-color: var(--teal);
  background: var(--teal-softer);
}

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

.option-btn.selected .option-text {
  color: var(--teal);
  font-weight: 600;
}

.option-btn.answered:not(.selected) {
  opacity: 0.38;
}

/* ============================================
   RESULT SCREEN
   ============================================ */
.screen-result {
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding-bottom: 4rem;
}

.result-inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 2.5rem 1.4rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Result logo */
.result-logo-wrap {
  display: flex;
  justify-content: center;
}

.result-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  opacity: 0.9;
}

/* Result main */
.result-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.result-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.result-icon {
  font-size: 3rem;
  line-height: 1;
  animation: iconPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.15s;
}

@keyframes iconPop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.result-name {
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--teal);
}

.result-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 360px;
  font-weight: 400;
}

/* Score bars */
.result-bars-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.bars-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.score-row {
  margin-bottom: 0.85rem;
}

.score-row:last-child {
  margin-bottom: 0;
}

.score-row-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.score-row-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.score-row-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.score-track {
  height: 5px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

/* Winner bar gets a brighter color */
.score-fill.winner {
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
}

/* Result chips */
.result-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.trait-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-softer);
  border: 1px solid rgba(57, 127, 142, 0.2);
  border-radius: 100px;
  padding: 0.35rem 0.85rem;
  animation: chipIn 0.35s ease both;
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Secondary button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 100px;
  padding: 0.75rem 1.6rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-softer);
}

/* Confetti */
.result-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
  opacity: 0;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: translateY(105vh) rotate(540deg);
    opacity: 0;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 600px) {
  .quiz-topbar {
    padding: 1.3rem 2rem;
  }

  .question-wrap {
    padding: 3rem 2rem 4rem;
  }

  .option-btn {
    font-size: 0.9rem;
    padding: 1.05rem 1.2rem;
  }

  .result-inner {
    padding: 3rem 2rem 0;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}