/* ═══════════════════════════════════════════════
   Alpha Analytics · Plataforma de Treinamento
   Design System — style.css
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  /* ── Paleta Alpha Analytics Lab (claro) ── */
  --bg:          #f9fafb;
  --bg2:         #f1f5f9;
  --surface:     #ffffff;
  --surface2:    #f9fafb;
  --surface3:    #f1f5f9;
  --border:      #e5e7eb;
  --border2:     #d1d5db;

  /* Brand Alpha Analytics */
  --aa:          #f97316;
  --aa-dim:      rgba(249,115,22,0.10);
  --aa-border:   rgba(249,115,22,0.30);

  /* CTA — verde técnico */
  --cta:         #10b981;
  --cta-hover:   #059669;
  --cta-dim:     rgba(16,185,129,0.10);

  /* Primária — azul profundo lab */
  --primary:     #1e3a5f;
  --primary2:    #2d5282;
  --primary-dim: rgba(30,58,95,0.08);
  --primary-l:   #e8f0f8;

  /* Accent colors */
  --blue:        #1e3a5f;
  --blue-dim:    rgba(30,58,95,0.08);
  --green:       #16a34a;
  --green-dim:   rgba(22,163,74,0.10);
  --yellow:      #d97706;
  --red:         #dc2626;
  --purple:      #7c3aed;

  /* Text — alinhado ao design system */
  --text:        #111827;
  --text2:       #374151;
  --text3:       #6b7280;

  /* Transitions */
  --t:           0.2s ease;
  --t-slow:      0.4s ease;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── TOPBAR ─────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left  { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.brand-aa {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.brand-aa .logo-mark {
  width: 28px; height: 28px;
  background: var(--aa);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 12px; font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.brand-aa .logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--text);
}

.company-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px 4px 4px;
  font-size: 13px;
  color: var(--text2);
}
.company-badge .co-logo {
  width: 24px; height: 24px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.company-badge .co-logo-img {
  height: 24px;
  width: auto;
  max-width: 80px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}
.company-badge .co-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}

.topbar-sep {
  width: 1px; height: 20px;
  background: var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: border-color var(--t);
  text-decoration: none;
}
.user-chip:hover { border-color: var(--border2); }
.user-chip .avatar {
  width: 26px; height: 26px;
  background: var(--aa-dim);
  border: 1px solid var(--aa-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  color: var(--aa);
}
.user-chip .uname {
  font-size: 13px;
  color: var(--text2);
}

/* ── PROGRESS BAR ────────────────────────────── */
.progress-strip {
  height: 2px;
  background: var(--border);
  position: relative;
}
.progress-strip .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--aa), var(--yellow));
  transition: width 0.5s ease;
}

/* ── MAIN CONTAINERS ─────────────────────────── */
.page { max-width: 860px; margin: 0 auto; padding: 48px 32px 100px; }
.page-wide { max-width: 1100px; margin: 0 auto; padding: 40px 32px 80px; }

/* ── CARDS ───────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
}
.card + .card { margin-top: 16px; }

.card-accent-aa  { border-left: 3px solid var(--aa); }
.card-accent-blue{ border-left: 3px solid var(--blue); }
.card-accent-green{ border-left: 3px solid var(--green); }

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-size: 14px; font-weight: 700;
  transition: all var(--t);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--aa);
  color: white;
}
.btn-primary:hover { background: #fb8a38; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border2); color: var(--text); }

.btn-success {
  background: var(--green);
  color: #0a2010;
}
.btn-success:hover { background: #6afaab; transform: translateY(-1px); }

.btn-sm {
  padding: 7px 16px;
  font-size: 12px;
}

/* ── MONO / LABELS ───────────────────────────── */
.mono {
  font-family: 'IBM Plex Mono', monospace;
}
.label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
}
.label-aa  { color: var(--aa); }
.label-blue{ color: var(--blue); }
.label-green{ color: var(--green); }

/* ── HEADINGS ────────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; line-height: 1.2; }
h1 { font-size: 36px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; margin: 36px 0 14px; }
h3 { font-size: 17px; font-weight: 600; color: var(--aa); margin: 24px 0 10px; }

p { margin-bottom: 14px; }
p:last-child { margin-bottom: 0; }

/* ── MODULE DOTS NAV ─────────────────────────── */
.mod-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}
.mod-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all var(--t);
  border: none;
}
.mod-dot.active {
  background: var(--aa);
  width: 24px;
  border-radius: 4px;
}
.mod-dot.done { background: var(--green); }

/* ── STAT CARDS ──────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.stat-card .s-label {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 4px;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.stat-card .s-value {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

/* ── MODULE LIST ─────────────────────────────── */
.mod-list { display: flex; flex-direction: column; gap: 8px; }
.mod-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  color: var(--text);
}
.mod-item:hover:not(.locked) {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateX(2px);
}
.mod-item.active-mod {
  border-color: var(--aa);
  border-width: 2px;
  background: var(--aa-dim);
}
.mod-item.done-mod {
  border-color: rgba(79,249,160,0.3);
  background: var(--green-dim);
}
.mod-item.locked {
  opacity: 0.4;
  cursor: not-allowed;
}
.mod-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.mod-icon.ic-done    { background: var(--green-dim); color: var(--green); }
.mod-icon.ic-active  { background: var(--aa-dim); color: var(--aa); }
.mod-icon.ic-locked  { background: var(--surface2); color: var(--text3); }
.mod-icon.ic-pending { background: var(--surface2); color: var(--text3); }

.mod-info { flex: 1; min-width: 0; }
.mod-title { font-size: 14px; font-weight: 600; }
.mod-sub   { font-size: 12px; color: var(--text2); margin-top: 2px; }

.mod-score {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  flex-shrink: 0;
}

/* ── PROGRESS BAR THIN ───────────────────────── */
.prog-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 8px 0;
  overflow: hidden;
}
.prog-bar .fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── TOAST ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text);
  z-index: 1000;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success { border-color: rgba(79,249,160,0.4); }
.toast.success::before {
  content: '✓ ';
  color: var(--green);
  font-weight: 700;
}

/* ── QUIZ STYLES ─────────────────────────────── */
.quiz-q {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}
.quiz-q .qnum {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 8px;
}
.quiz-q .qstem {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 16px;
}
.qopts { display: flex; flex-direction: column; gap: 8px; }
.qopt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--t);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  width: 100%;
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
}
.qopt:hover { border-color: var(--aa); background: var(--aa-dim); }
.qopt.correct { border-color: var(--green); background: var(--green-dim); }
.qopt.wrong { border-color: var(--red); background: rgba(249,79,106,0.07); }
.opt-letter {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  min-width: 18px;
  padding-top: 2px;
  flex-shrink: 0;
}
.qfb {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  display: none;
}
.qfb.show { display: block; }
.qfb.ok { background: var(--green-dim); border: 1px solid rgba(79,249,160,0.25); color: var(--green); }
.qfb.nok { background: rgba(249,79,106,0.07); border: 1px solid rgba(249,79,106,0.25); color: #f98fa0; }

/* ── SCORE BOX ───────────────────────────────── */
.score-box {
  text-align: center;
  padding: 40px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 28px;
  display: none;
}
.score-box.show { display: block; }
.score-num {
  font-family: 'Syne', sans-serif;
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}
.score-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text2);
  margin-bottom: 16px;
}
.score-msg { font-size: 15px; color: var(--text2); max-width: 400px; margin: 0 auto; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 600px) {
  .page { padding: 28px 18px 80px; }
  h1 { font-size: 26px; }
  .topbar { padding: 0 18px; }
  .topbar .company-badge .co-name { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Quiz options — override .btn white-space */
.q-option, .qopt {
  white-space: normal !important;
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}
.q-option span, .qopt span {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  display: inline !important;
}
