/* ==========================================================================
   TESTE DISC - ESTILOS PRINCIPAIS (HTML, CSS e JS Puro)
   Foco em portabilidade total, sem frameworks, ultra-leve e responsivo
   ========================================================================== */

:root {
  --primary: #0f2744;
  --primary-light: #1e3a8a;
  --accent-gold: #d97706;
  --accent-gold-hover: #b45309;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-subtle: #e2e8f0;
  --border-focus: #3b82f6;

  /* Cores das Dimensões DISC */
  --color-dim-a: #dc2626;
  --color-dim-a-bg: #fef2f2;
  --color-dim-a-border: #fecaca;
  --color-dim-b: #d97706;
  --color-dim-b-bg: #fffbeb;
  --color-dim-b-border: #fde68a;
  --color-dim-c: #059669;
  --color-dim-c-bg: #ecfdf5;
  --color-dim-c-border: #a7f3d0;
  --color-dim-d: #2563eb;
  --color-dim-d-bg: #eff6ff;
  --color-dim-d-border: #bfdbfe;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #0e2439 0%, #173656 100%);
  color: #ffffff;
  padding: 16px 0;
  border-bottom: 3px solid var(--accent-gold);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-badge {
  background: var(--accent-gold);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brand-titles h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.brand-titles p {
  font-size: 0.8rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--accent-gold);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
}

.btn-primary:hover {
  background-color: var(--accent-gold-hover);
}

.btn-navy {
  background-color: var(--primary-light);
  color: #ffffff;
}

.btn-navy:hover {
  background-color: #1d4ed8;
}

.btn-outline {
  background-color: transparent;
  border-color: #cbd5e1;
  color: #334155;
}

.btn-outline:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

.btn-download-top {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  padding: 8px 14px;
}

.btn-download-top:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.1rem;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  padding: 32px 0 60px 0;
}

/* View Sections */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card Padrão */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 24px;
}

/* ==========================================================================
   TELA INICIAL / INSTRUÇÕES
   ========================================================================== */
.hero-intro {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 32px auto;
}

.hero-badge {
  display: inline-block;
  background-color: #e0f2fe;
  color: #0369a1;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.hero-intro h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.25;
  margin-bottom: 12px;
}

.hero-intro p {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.inst-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background-color: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.inst-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.inst-text h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.inst-text p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.warning-callout {
  background-color: #fffbeb;
  border-left: 4px solid var(--accent-gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.warning-callout p {
  font-size: 0.95rem;
  color: #92400e;
  font-weight: 500;
}

.form-start-card {
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
}

.input-group {
  text-align: left;
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.input-group input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ==========================================================================
   TELA DO TESTE (1 BLOCO POR VEZ)
   ========================================================================== */
.test-container {
  max-width: 680px;
  margin: 0 auto;
}

/* Barra de Progresso */
.progress-card {
  margin-bottom: 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-counter {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.progress-percent {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.progress-track {
  width: 100%;
  height: 10px;
  background-color: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d97706, #f59e0b);
  border-radius: var(--radius-full);
  width: 3.5%;
  transition: width 0.3s ease;
}

/* Card do Bloco de Pergunta */
.question-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}

.question-block-badge {
  display: inline-block;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.question-instruction {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 24px;
}

/* Opções de Palavras (Cards Clicáveis) */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  text-align: left;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background-color: #ffffff;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-align: left;
}

.option-btn:hover {
  border-color: var(--accent-gold);
  background-color: #fffdfa;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: #f1f5f9;
  color: #475569;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: var(--transition);
}

.option-btn:hover .option-letter {
  background-color: var(--accent-gold);
  color: #ffffff;
}

.option-word {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
}

.option-btn.selected {
  border-color: var(--accent-gold);
  background-color: #fffbeb;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.option-btn.selected .option-letter {
  background-color: var(--accent-gold);
  color: #ffffff;
}

.single-block-notice {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ==========================================================================
   TELA DE RESULTADOS
   ========================================================================== */
.results-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Relatório para Impressão e Visualização */
.report-paper {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  margin-bottom: 32px;
}

.report-header {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 24px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

.report-logo-text h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.report-logo-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.candidate-meta {
  text-align: right;
  font-size: 0.9rem;
  color: #475569;
}

.candidate-meta strong {
  color: var(--primary);
  font-size: 1rem;
}

/* Perfil Predominante Hero Box */
.predominant-hero {
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.predominant-content h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.85;
}

.predominant-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
}

.predominant-subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  opacity: 0.9;
}

.predominant-score-badge {
  background: #ffffff;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.predominant-score-badge .pts {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.predominant-score-badge .lbl {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
  margin-top: 4px;
}

/* Grade de Dimensões (Cards A, B, C, D) */
.dimensions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.dim-card {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.dim-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.dim-card.dim-a::before { background-color: var(--color-dim-a); }
.dim-card.dim-b::before { background-color: var(--color-dim-b); }
.dim-card.dim-c::before { background-color: var(--color-dim-c); }
.dim-card.dim-d::before { background-color: var(--color-dim-d); }

.dim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dim-letter-tag {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: #ffffff;
}

.dim-a .dim-letter-tag { background-color: var(--color-dim-a); }
.dim-b .dim-letter-tag { background-color: var(--color-dim-b); }
.dim-c .dim-letter-tag { background-color: var(--color-dim-c); }
.dim-d .dim-letter-tag { background-color: var(--color-dim-d); }

.dim-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.dim-focus {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dim-score-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.dim-score-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

.dim-score-percent {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dim-bar-track {
  width: 100%;
  height: 8px;
  background-color: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.dim-a .dim-bar-fill { background-color: var(--color-dim-a); }
.dim-b .dim-bar-fill { background-color: var(--color-dim-b); }
.dim-c .dim-bar-fill { background-color: var(--color-dim-c); }
.dim-d .dim-bar-fill { background-color: var(--color-dim-d); }

/* Gráficos Visuais */
.charts-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 36px;
  align-items: stretch;
}

.chart-box {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.chart-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.svg-chart-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

/* Análise Detalhada dos Adjetivos e Dimensões */
.adjectives-section {
  margin-top: 36px;
  border-top: 2px solid #e2e8f0;
  padding-top: 32px;
}

.adjectives-section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.adjectives-section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Abas das Dimensões para Exploração */
.dim-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.dim-tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.dim-tab-btn:hover {
  color: var(--primary);
  background-color: #f1f5f9;
}

.dim-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  border-color: #e2e8f0 #e2e8f0 transparent #e2e8f0;
  border-bottom: 2px solid #ffffff;
  margin-bottom: -1px;
}

/* Adjetivos Accordion / Grid */
.adjectives-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.adjective-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  page-break-inside: avoid;
  break-inside: avoid;
  box-shadow: var(--shadow-sm);
}

.adjective-word {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.adjective-text {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.6;
}

/* Painel de Ações e Compartilhamento (Fixo ou Abaixo) */
.results-actions-bar {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.actions-left {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actions-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Toast de Notificação */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Modal de Download / Info */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  padding: 32px;
  box-shadow: var(--shadow-xl);
}

.modal-card h3 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.modal-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Footer */
.app-footer {
  background: #0e2439;
  color: #94a3b8;
  padding: 24px 0;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   ESTILOS DE IMPRESSÃO / GERAÇÃO DE PDF (@media print)
   ========================================================================== */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
    line-height: 1.4;
  }

  .app-header,
  .app-footer,
  .results-actions-bar,
  .dim-tabs,
  .btn,
  .toast-notice,
  .modal-backdrop,
  .single-block-notice,
  #instructions-view,
  #test-view {
    display: none !important;
  }

  .main-wrapper {
    padding: 0 !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .report-paper {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .report-header {
    border-bottom: 2pt solid #000000;
    margin-bottom: 16pt;
    padding-bottom: 10pt;
  }

  .predominant-hero {
    border: 1pt solid #cbd5e1 !important;
    background: #f8fafc !important;
    color: #000000 !important;
    page-break-inside: avoid;
  }

  .dim-card {
    border: 1pt solid #cbd5e1 !important;
    page-break-inside: avoid;
  }

  .chart-box {
    border: 1pt solid #cbd5e1 !important;
    page-break-inside: avoid;
  }

  .adjective-card {
    border: 1pt solid #e2e8f0 !important;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 8pt;
  }

  /* Exibir todas as 4 dimensões no PDF impresso */
  .adjectives-dim-content {
    display: block !important;
  }

  @page {
    size: A4;
    margin: 1.5cm;
  }
}

/* Responsividade */
@media (max-width: 768px) {
  .hero-intro h2 {
    font-size: 1.6rem;
  }

  .charts-section {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .report-paper {
    padding: 24px 16px;
  }

  .results-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-left,
  .actions-right {
    width: 100%;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
