/* ═══════════════════════════════════════════════════
   Quiz Diagnóstico de Carreira — Mobile-First CSS
   Design: White theme matching Verdade em Cena LP
   ═══════════════════════════════════════════════════ */

:root {
  --bg-primary: #F4F7F6;
  --bg-white: #FFFFFF;
  --bg-secondary: #E8EEED;
  --text-primary: #1A202C;
  --text-secondary: #4A5568;
  --text-muted: #718096;

  --accent: #1E3A8A;
  --accent-light: #3B82F6;
  --button-bg: #B4975A;
  --button-hover: #A08449;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --success: #38a169;
  --error: #e53e3e;

  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Screens ─────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  background: var(--bg-primary);
  z-index: 1;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

.screen-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  padding-bottom: calc(24px + var(--safe-bottom));
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* ── INTRO Screen ─────────────────────────────── */
.logo {
  height: 36px;
  margin-bottom: 16px;
  filter: invert(19%) sepia(35%) saturate(3801%) hue-rotate(208deg) brightness(85%) contrast(106%);
}

.intro-content {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.intro-content h1 {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: clamp(30px, 8vw, 42px);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 12px;
}
.intro-content h1 span {
  color: var(--button-bg);
  font-style: italic;
}

.intro-sub {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

.intro-details {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.intro-badge {
  background: rgba(30, 58, 138, 0.06);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background-color: var(--button-bg);
  color: #fff;
  padding: 16px 32px;
  border-radius: 100px;
  font-size: 16px;
  letter-spacing: 0.3px;
  width: 100%;
  max-width: 360px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(180, 151, 90, 0.35);
}
.btn-primary:hover {
  background-color: var(--button-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(180, 151, 90, 0.45);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  animation: shine 4s infinite;
}
@keyframes shine {
  0% { left: -100%; }
  20% { left: 200%; }
  100% { left: 200%; }
}

.micro-copy {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
}

/* ── Quiz Screen ──────────────────────────────── */
.quiz-header {
  padding: 12px 20px 0;
  flex-shrink: 0;
}

.progress-bar {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--button-bg), var(--accent-light));
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0%;
}

.progress-text {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

.quiz-inner {
  justify-content: flex-start;
  padding-top: 8px;
  gap: 0;
}

/* ── Question GIF ──────────────────────────────── */
.question-gif {
  width: 100%;
  max-width: 280px;
  height: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.question-gif img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}
.question-gif:empty {
  display: none;
}

/* ── Question Part Label ───────────────────────── */
.question-part {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--button-bg);
  font-weight: 600;
  margin-bottom: 6px;
  text-align: center;
}

/* ── Question Title ────────────────────────────── */
.question-title {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  margin-bottom: 16px;
  max-width: 380px;
}

/* ── Text Input (nome) ─────────────────────────── */
.text-input-wrap {
  width: 100%;
  max-width: 360px;
}

.text-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-white);
  outline: none;
  transition: border-color 0.25s;
  margin-bottom: 14px;
}
.text-input:focus {
  border-color: var(--accent-light);
}
.text-input::placeholder {
  color: var(--text-muted);
}

.btn-next {
  padding: 14px 24px;
  font-size: 15px;
}

/* ── Options List ──────────────────────────────── */
.options-list {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-btn {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-white);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
}
.option-btn:hover {
  border-color: var(--accent-light);
  background: rgba(59, 130, 246, 0.04);
}
.option-btn:active,
.option-btn.selected {
  border-color: var(--accent);
  background: rgba(30, 58, 138, 0.06);
  color: var(--accent);
  font-weight: 500;
}

/* animation for question transition */
.quiz-inner.fade-out {
  animation: fadeOut 0.2s ease forwards;
}
.quiz-inner.fade-in {
  animation: fadeIn 0.3s ease forwards;
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(-20px); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Loading Screen ───────────────────────────── */
.loading-inner {
  justify-content: center;
  gap: 16px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--bg-secondary);
  border-top-color: var(--button-bg);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: 22px;
  font-weight: 600;
}

.loading-sub {
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Result Screen ────────────────────────────── */
#screen-result {
  overflow: hidden;
}

.result-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--safe-bottom);
}

.result-hero {
  text-align: center;
  padding: 32px 20px 20px;
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.06) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-result {
  height: 28px;
  margin: 0 auto 20px;
  display: block;
}

.result-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--button-bg);
  font-weight: 700;
  padding: 6px 16px;
  border: 1px solid rgba(180, 151, 90, 0.3);
  border-radius: 100px;
  margin-bottom: 16px;
}

.result-title {
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: clamp(22px, 5.5vw, 30px);
  font-weight: 600;
  line-height: 1.25;
  max-width: 440px;
  margin: 0 auto;
}

/* ── Score Bars ─────────────────────────────────── */
.result-scores {
  padding: 20px;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.score-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.score-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.score-name {
  flex-shrink: 0;
}

.score-value {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  min-width: 36px;
}

.score-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 100px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 100px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.score-bar-fill--i {
  background: linear-gradient(90deg, var(--button-bg), #d4b86a);
}

.score-bar-fill--t {
  background: linear-gradient(90deg, #38a169, #68d391);
}

/* ── Scroll Hint ───────────────────────────────── */
.scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px 20px;
  font-size: 13px;
  color: var(--text-muted);
  animation: bounce 2s infinite;
}

.scroll-hint-icon {
  font-size: 18px;
  animation: bounceArrow 1.5s infinite;
}

@keyframes bounceArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ── Result Cards ───────────────────────────────── */
.result-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin: 0 16px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

.result-card--solution {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.04) 0%, rgba(180, 151, 90, 0.06) 100%);
  border-color: rgba(180, 151, 90, 0.2);
}

.result-card--solution::before {
  background: var(--button-bg);
}

.result-card-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.result-label {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--button-bg);
  font-weight: 700;
  margin-bottom: 12px;
}

.result-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.result-text p {
  margin-bottom: 12px;
}

/* ── Reveal Animation ──────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Result Divider ────────────────────────────── */
.result-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 8px;
  max-width: 400px;
  margin: 0 auto;
}

.result-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.result-divider-text {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* ── CTA Card ──────────────────────────────────── */
.result-cta-block {
  text-align: center;
  padding: 16px 16px 40px;
}

.cta-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(180, 151, 90, 0.25);
  max-width: 400px;
  margin: 0 auto;
}

.cta-card-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  font-weight: 700;
  padding: 5px 14px;
  background: var(--accent);
  border-radius: 100px;
  margin-bottom: 14px;
}

.cta-card-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}

.cta-card-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.cta-card-list {
  list-style: none;
  text-align: left;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cta-card-list li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  padding-left: 4px;
}

.btn-cta {
  max-width: 380px;
  font-size: 15px;
  padding: 16px 24px;
}

.result-cta-bottom {
  padding-bottom: 16px;
}

/* Flags */
.flag-block {
  max-width: 520px;
  margin: 0 16px 12px;
  padding: 18px 20px;
  background: var(--bg-white);
  border-left: 3px solid var(--button-bg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.flag-block p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

/* Footer */
.quiz-footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
}
.quiz-footer p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — Larger phones & tablets
   ══════════════════════════════════════════════════ */

/* Taller phones: more breathing room */
@media (min-height: 700px) {
  .question-gif {
    height: 140px;
    max-width: 300px;
  }
  .question-title {
    font-size: clamp(19px, 4.5vw, 24px);
    margin-bottom: 20px;
  }
  .options-list {
    gap: 10px;
  }
  .option-btn {
    padding: 14px 18px;
    font-size: 15px;
  }
}

/* Short phones (SE, etc): compress */
@media (max-height: 600px) {
  .question-gif {
    height: 80px;
    max-width: 200px;
    margin-bottom: 8px;
  }
  .question-title {
    font-size: 16px;
    margin-bottom: 10px;
  }
  .option-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
  .options-list {
    gap: 5px;
  }
  .quiz-inner {
    padding-top: 4px;
  }
  .question-part {
    font-size: 9px;
    margin-bottom: 4px;
  }
}

/* Tablets / Desktop */
@media (min-width: 768px) {
  .screen-inner {
    max-width: 560px;
  }
  .question-gif {
    max-width: 360px;
    height: 180px;
  }
  .question-title {
    font-size: 26px;
  }
  .option-btn {
    font-size: 16px;
    padding: 16px 20px;
  }
  .options-list {
    max-width: 480px;
  }
  .result-title {
    font-size: 32px;
  }
  .result-card {
    margin: 0 auto 16px;
    max-width: 520px;
  }
  .result-scores {
    max-width: 480px;
  }
  .cta-card {
    max-width: 480px;
  }
  .flag-block {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
  .result-divider {
    max-width: 480px;
  }
}
