/* ── Reset & Root ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary:    #2D2D2D;
  --accent:     #F66B0E;
  --accent-2:   #FF8225;
  --accent-lt:  #FEE8D8;
  --brand-gray: #868D93;
  --green:      #198754;
  --green-bg:   #d1fae5;
  --red:        #dc3545;
  --red-bg:     #fde8ea;
  --orange:     #fd7e14;
  --blue:       #0d6efd;
  --gray-100:   #f0f2f5;
  --gray-200:   #e4e7eb;
  --gray-300:   #d1d5db;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-700:   #374151;
  --gray-900:   #111827;
  --white:      #ffffff;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --radius:     12px;
  --radius-sm:  8px;
}

body {
  font-family: 'Lato', 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  font-size: 15px;
  line-height: 1.55;
}
button, input, textarea, select { font: inherit; }

/* ── Screens ──────────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Topbar ───────────────────────────────────────────────────────── */
.topbar {
  background: var(--primary);
  color: white;
  padding: 13px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.brand { font-size: 17px; font-weight: 700; }
.topbar-sub { font-size: 13px; color: rgba(255,255,255,0.72); margin-top: 2px; }

.topbar-logo {
  height: 54px;
  width: auto;
  object-fit: contain;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Progress bar (inside topbar) */
.progress-wrapper { min-width: 260px; flex-shrink: 0; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.82);
  margin-bottom: 5px;
}
.progress-track {
  background: rgba(255,255,255,0.18);
  border-radius: 4px;
  height: 7px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.25s ease;
  width: 0%;
}

/* ── Content wrapper ──────────────────────────────────────────────── */
.content-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 100px;
}

/* ── Identification screen ────────────────────────────────────────── */
.id-wrap {
  min-height: calc(100vh - 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.id-card { max-width: 460px; width: 100%; }
.id-card h1 { font-size: 22px; color: var(--primary); margin-bottom: 6px; }
.id-hint { color: var(--gray-500); font-size: 14px; margin-bottom: 26px; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 6px;
}
input[type="text"],
input[type="date"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--gray-900);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(246,107,14,0.14);
}
textarea { min-height: 80px; resize: vertical; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { filter: brightness(0.9); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary  { background: var(--accent); color: white; }
.btn-secondary{ background: var(--gray-200); color: var(--gray-700); }
.btn-success  { background: var(--green); color: white; }
.btn-outline  { background: white; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-full     { width: 100%; justify-content: center; padding: 13px; font-size: 15px; margin-top: 4px; }

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

/* ── Block cards (MC screen) ──────────────────────────────────────── */
.block-wrap {
  background: white;
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.block-head {
  background: var(--primary);
  color: white;
  padding: 13px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.block-head h3 { font-size: 14px; font-weight: 600; flex: 1; }
.block-badge {
  background: rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s;
}
.block-body { padding: 6px 20px 14px; }

/* ── Question rows ────────────────────────────────────────────────── */
.q-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.q-row:last-child { border-bottom: none; }
.q-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  width: 28px;
  flex-shrink: 0;
}
.q-opts { display: flex; gap: 6px; flex-shrink: 0; }
.opt-btn {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  border: 2px solid var(--gray-300);
  background: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--gray-700);
  transition: all 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.opt-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
}
.opt-btn.selected-correct {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}
.opt-btn.selected-wrong {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}
.opt-btn.hint-correct {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
  opacity: 0.55;
}
.q-feedback {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  min-width: 120px;
}
.fb-ok  { color: var(--green); }
.fb-err { color: var(--red); }
.q-pts {
  font-size: 12px;
  color: var(--gray-400);
  flex-shrink: 0;
}

/* ── Bottom navigation bar ────────────────────────────────────────── */
.bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.07);
  z-index: 40;
}
.bottom-hint { font-size: 13px; color: var(--gray-500); text-align: center; }

/* ── Dissertative cards ───────────────────────────────────────────── */
.diss-card {
  background: white;
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.diss-head {
  background: var(--primary);
  color: white;
  padding: 14px 20px;
}
.diss-label { font-size: 12px; opacity: 0.72; margin-bottom: 3px; }
.diss-head h3 { font-size: 16px; font-weight: 600; }
.diss-max { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.diss-body { padding: 20px; }

.criteria-section { margin-bottom: 18px; }
.criteria-section h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-500);
  margin-bottom: 10px;
}
.criteria-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  font-size: 14px;
  color: var(--gray-700);
}
.criteria-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.score-section { margin-bottom: 16px; }
.score-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 10px;
}
.score-controls { display: flex; align-items: center; gap: 14px; }
.score-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--gray-300);
  outline: none;
  cursor: pointer;
}
.score-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}
.score-num {
  width: 72px;
  padding: 8px 10px;
  border: 1.5px solid var(--gray-300);
  border-radius: 7px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: var(--accent);
}
.score-num:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(246,107,14,0.14);
}
.score-of { font-size: 13px; color: var(--gray-500); flex-shrink: 0; }
.obs-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 7px;
}

/* ── Results: Score hero ──────────────────────────────────────────── */
.score-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 26px 24px;
}
.score-circle {
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 6px solid var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.score-big { font-size: 28px; font-weight: 800; color: var(--accent); line-height: 1; }
.score-of-100 { font-size: 11px; color: var(--gray-400); margin-top: 3px; }
.classif-area { flex: 1; }
.classif-meta { font-size: 13px; color: var(--gray-500); margin-bottom: 10px; }
.classif-meta strong { color: var(--gray-900); }
.classif-label-sm {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 7px;
}
.classif-pill {
  display: inline-block;
  padding: 8px 22px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
}
.classif-above   { background: #d1fae5; color: #065f46; }
.classif-within  { background: #dbeafe; color: #1e40af; }
.classif-partial { background: #fed7aa; color: #92400e; }
.classif-below   { background: #fde8ea; color: #991b1b; }

/* ── Results: Section title ───────────────────────────────────────── */
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-lt);
}

/* ── Results: Summary table ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.summary-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.summary-table th {
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  padding: 9px 14px;
  text-align: left;
  border-bottom: 2px solid var(--gray-200);
}
.summary-table td { padding: 9px 14px; border-bottom: 1px solid var(--gray-200); }
.summary-table tr:last-child td { border-bottom: none; }
.summary-table .total-row { background: var(--accent-lt); font-weight: 700; }

.pct-bar { display: flex; align-items: center; gap: 8px; }
.pct-track {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
}
.pct-fill { height: 100%; border-radius: 4px; }
.fill-green  { background: var(--green); }
.fill-blue   { background: var(--blue); }
.fill-orange { background: var(--orange); }
.fill-red    { background: var(--red); }
.pct-val { font-size: 13px; font-weight: 600; min-width: 40px; text-align: right; }

/* ── Chart ────────────────────────────────────────────────────────── */
.chart-box { position: relative; height: 300px; }

/* ── Highlights ───────────────────────────────────────────────────── */
.highlights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.hl-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.hl-card h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.hl-card.strengths h4 { color: var(--green); }
.hl-card.attention h4 { color: var(--orange); }
.hl-item {
  font-size: 14px;
  color: var(--gray-700);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hl-icon { font-size: 14px; flex-shrink: 0; }
.hl-empty { font-size: 13px; color: var(--gray-400); font-style: italic; }

/* ── Results actions ──────────────────────────────────────────────── */
.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 16px; }
  .topbar-logo { display: none; }
  .mode-grid { grid-template-columns: 1fr; }
  .progress-wrapper { width: 100%; min-width: unset; }
  .content-wrap { padding: 16px 12px 90px; }
  .highlights-grid { grid-template-columns: 1fr; }
  .score-hero { flex-direction: column; align-items: flex-start; }
  .bottom-bar { padding: 10px 14px; gap: 8px; }
  .opt-btn { width: 34px; height: 34px; font-size: 12px; }
  .block-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .card { padding: 16px; }
  .bottom-hint { display: none; }
}

/* ── Paste code (evaluator import) ───────────────────────────────── */
.paste-code-block {
  background: var(--gray-100); border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 4px;
}
.paste-code-label {
  font-size: 13px; font-weight: 700; color: var(--gray-700); margin-bottom: 4px;
}
.paste-code-hint { font-size: 12px; color: var(--gray-500); margin-bottom: 10px; }
.paste-code-ta {
  width: 100%; height: 80px; resize: none;
  font-family: 'Courier New', monospace; font-size: 11px;
  background: white; border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm); padding: 10px; color: var(--gray-900);
  word-break: break-all;
}
.paste-code-ta:focus { outline: none; border-color: var(--accent); }
.paste-code-divider {
  text-align: center; position: relative; margin: 18px 0 14px;
  color: var(--gray-400); font-size: 12px;
}
.paste-code-divider::before,
.paste-code-divider::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 60px); height: 1px; background: var(--gray-200);
}
.paste-code-divider::before { left: 0; }
.paste-code-divider::after  { right: 0; }
.import-violations-warn {
  margin-top: 10px; padding: 8px 12px; border-radius: 6px;
  background: #fde8ea; color: #842029; font-size: 13px;
}
.violations-alert {
  background: #fde8ea; border: 1px solid #f5c2c7; color: #842029;
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 14px; margin-bottom: 16px;
}

/* ── Welcome / mode selection ─────────────────────────────────────── */
.welcome-card { max-width: 480px; width: 100%; }
.welcome-card h1 { font-size: 24px; color: var(--primary); margin-bottom: 6px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 16px; border: 2px solid var(--gray-200); border-radius: var(--radius);
  background: white; cursor: pointer; transition: all 0.18s; text-align: center;
}
.mode-btn:hover {
  border-color: var(--accent); background: var(--accent-lt);
  transform: translateY(-2px); box-shadow: 0 4px 16px rgba(246,107,14,0.15);
}
.mode-icon { font-size: 38px; }
.mode-title { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.mode-sub   { font-size: 13px; color: var(--gray-500); }

/* ── Import banner ────────────────────────────────────────────────── */
.import-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--accent-lt); border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 20px;
}
.import-icon { font-size: 20px; flex-shrink: 0; }
.import-text { flex: 1; min-width: 130px; font-size: 13px; line-height: 1.4; }
.import-text strong { display: block; color: var(--gray-900); margin-bottom: 2px; }
.import-text span   { color: var(--gray-500); }

/* ── Candidate exam: info box ─────────────────────────────────────── */
.exam-info-box {
  background: var(--accent-lt); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 20px; font-size: 14px; color: var(--gray-700);
}
.exam-info-box ul { margin-top: 8px; padding-left: 18px; }
.exam-info-box li { padding: 2px 0; }

/* ── Candidate exam: question cards ──────────────────────────────── */
.cand-block-head {
  background: var(--primary); color: white;
  padding: 11px 20px; border-radius: var(--radius) var(--radius) 0 0;
  font-size: 13px; font-weight: 700; margin-top: 18px; margin-bottom: 0;
}
.cand-q-card {
  background: white; margin-bottom: 8px; box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--gray-200); transition: border-color 0.18s;
}
.cand-q-card:last-child { border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 18px; }
.cand-q-card.answered { border-left-color: var(--accent); }
.cand-q-head {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 18px 10px;
}
.cand-q-num {
  background: var(--gray-100); border-radius: 6px; padding: 3px 9px;
  font-size: 12px; font-weight: 700; color: var(--gray-500);
  flex-shrink: 0; margin-top: 2px; transition: all 0.18s;
}
.cand-q-card.answered .cand-q-num { background: var(--accent); color: white; }
.cand-q-text { font-size: 14px; line-height: 1.65; color: var(--gray-900); font-weight: 500; }
.cand-q-opts { display: flex; flex-direction: column; gap: 6px; padding: 0 18px 14px; }
.cand-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px;
  border: 1.5px solid var(--gray-200); border-radius: 8px; cursor: pointer;
  transition: all 0.12s; background: white; text-align: left; width: 100%;
  font-size: 14px; color: var(--gray-700); line-height: 1.5;
}
.cand-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-lt); }
.cand-opt.selected {
  border-color: var(--accent); background: var(--accent-lt);
  font-weight: 600; color: var(--accent);
}
.cand-opt-letter {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}

/* ── Candidate exam: dissertative ────────────────────────────────── */
.cand-diss-card {
  background: white; border-radius: var(--radius); margin-bottom: 14px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.cand-diss-head { background: var(--primary); color: white; padding: 14px 20px; }
.cand-diss-head h3 { font-size: 15px; font-weight: 700; }
.cand-diss-sub { font-size: 12px; opacity: 0.7; margin-top: 3px; }
.cand-diss-body { padding: 18px 20px; }
.cand-diss-prompt {
  font-size: 14px; line-height: 1.7; color: var(--gray-700);
  background: var(--gray-100); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 14px;
}
.cand-diss-body textarea { min-height: 120px; }

/* ── Candidate exam: dissertative ref answer (evaluator view) ─────── */
.cand-ref-answer {
  background: #fff8f0; border: 1px solid var(--accent-lt);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px;
}
.cand-ref-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--accent); margin-bottom: 6px;
}
.cand-ref-text { font-size: 13px; color: var(--gray-700); line-height: 1.6; white-space: pre-wrap; }

/* ── Pré-avaliação por palavras-chave ─────────────────────────────── */
.preeval-btn {
  margin-top: 12px;
  padding: 7px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.preeval-btn:hover { opacity: .82; }

.preeval-result {
  margin-top: 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 13px;
}
.preeval-title {
  padding: 9px 13px;
  background: var(--gray-100);
  font-weight: 700;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-900);
}
.preeval-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 13px;
  border-bottom: 1px solid var(--gray-200);
  line-height: 1.4;
}
.preeval-item:last-of-type { border-bottom: none; }
.preeval-ok  { background: #f0fdf4; color: #166534; }
.preeval-miss { background: #fff7ed; color: #9a3412; }
.preeval-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.preeval-warn {
  padding: 7px 13px;
  font-size: 11px;
  color: var(--gray-500);
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  font-style: italic;
}

/* ── Print ────────────────────────────────────────────────────────── */
@media print {
  .screen { display: none !important; }
  #screen-results { display: block !important; }
  .bottom-bar { display: none !important; }
  .no-print { display: none !important; }
  #screen-results .topbar { position: static !important; box-shadow: none !important; }
  .content-wrap { padding: 0 20px 20px !important; max-width: 100% !important; }
  .card, .hl-card { box-shadow: none !important; border: 1px solid var(--gray-200) !important; }
  body { background: white; }
  .chart-box { height: 220px; }
  .highlights-grid { grid-template-columns: 1fr 1fr !important; }
}
