/* ═══════════════════════════════════════════════════════════
   components.css — Todos os componentes de UI
═══════════════════════════════════════════════════════════ */

/* ── CARD ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-raised);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.card-body { padding: var(--space-4); }
.card-body-sm { padding: var(--space-3); }

/* ── BADGE / PILL ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  border: 1px solid transparent;
}
.badge-pass   { background: var(--green-bg);  color: var(--green);  border-color: var(--green-bd); }
.badge-fail   { background: var(--red-bg);    color: var(--red);    border-color: var(--red-bd); }
.badge-warn   { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-bd); }
.badge-accent { background: var(--accent-bg); color: var(--accent); }
.badge-teal   { background: var(--teal-bg);   color: var(--teal); }

/* ── BOTÕES ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-overlay); color: var(--text-primary); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent-dark);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover { background: var(--accent); color: #fff; border-color: transparent; }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 8px; }

.btn-filter { background: var(--bg-overlay); border-color: transparent; }
.btn-filter.active {
  background: var(--accent-dark);
  border-color: transparent;
  color: #fff;
}

/* ── LABEL ── */
.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

/* ── COLOR FIELD ── */
.color-field {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.color-field:hover { border-color: var(--border-strong); }
.color-field input[type=color] { width: 30px; height: 30px; border-radius: var(--radius-sm); flex-shrink: 0; }
.color-field-info { flex: 1; min-width: 0; }
.color-field-info label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 1px;
}
.color-hex {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── CONTRAST METER ── */
.contrast-number {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
}
.contrast-unit {
  font-size: 16px;
  color: var(--text-muted);
  align-self: flex-end;
  padding-bottom: 4px;
}
.contrast-bar-track {
  height: 8px;
  background: var(--bg-overlay);
  border-radius: 4px;
  overflow: hidden;
  margin: var(--space-3) 0 var(--space-2);
  position: relative;
}
.contrast-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.35s cubic-bezier(0.4,0,0.2,1), background 0.35s;
}
.contrast-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.contrast-tip {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── VISION SELECTOR ── */
.vision-list { display: flex; flex-direction: column; gap: 2px; }

.vision-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  user-select: none;
}
.vision-item:hover { background: var(--bg-raised); }
.vision-item.active {
  background: var(--bg-overlay);
  border-color: var(--border-default);
}
.vision-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.vision-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}
.vision-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}
.vision-pct {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-raised);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── PREVIEW CANVAS ── */
.preview-canvas {
  min-height: 180px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  position: relative;
  transition: background 0.3s, filter 0.3s;
}
.preview-vision-tag {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 10px;
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.75);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.prev-ui-card {
  padding: 14px 22px;
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 200px;
  transition: all 0.3s;
}
.prev-ui-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  transition: color 0.3s;
}
.prev-ui-body {
  font-size: 13px;
  transition: color 0.3s;
}
.prev-ui-buttons { display: flex; gap: var(--space-2); }
.prev-btn {
  padding: 7px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

/* ── ALL VISIONS GRID ── */
.all-visions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.av-cell {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: default;
}
.av-cell:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
.av-lbl {
  font-size: 10px;
  padding: 4px 8px;
  background: var(--bg-raised);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 500;
}
.av-preview {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  transition: all 0.3s;
}
.av-dots { display: flex; gap: 4px; }
.av-dot { width: 12px; height: 12px; border-radius: 50%; transition: background 0.3s; }

/* ── VISION INFO PANEL ── */
.vision-info-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.vision-info-panel strong { color: var(--text-primary); }

/* ── CONDITIONS CARDS ── */
.cond-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.cond-card:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.cond-header {
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.cond-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.cond-title { font-size: 15px; font-weight: 500; color: var(--text-primary); font-family: var(--font-sans); margin-bottom: 2px; }
.cond-sub   { font-size: 12px; color: var(--text-muted); }
.cond-body  { padding: 14px 16px; font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.cond-impact {
  margin-top: var(--space-3);
  padding: 10px 12px;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-dark);
  font-size: 12px;
  color: var(--text-secondary);
}
.cond-impact strong {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}
.cond-stats { display: flex; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; }
.cond-stat {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-overlay);
  color: var(--text-secondary);
  border-radius: 4px;
  font-family: var(--font-mono);
}
.spectrum-row {
  display: flex;
  gap: 3px;
  height: 22px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: var(--space-2);
}
.spectrum-seg { flex: 1; }

/* ── BOAS PRÁTICAS ── */
.bp-section h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.bp-mark {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.bp-section.do  .bp-mark { background: var(--green-bg); color: var(--green); }
.bp-section.dont .bp-mark { background: var(--red-bg);   color: var(--red); }

.bp-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  line-height: 1.55;
  border: 1px solid transparent;
  transition: border-color var(--transition);
}
.bp-item.do   { background: var(--green-bg); color: var(--green); }
.bp-item.dont { background: var(--red-bg);   color: var(--red); }
.bp-item.do:hover   { border-color: var(--green-bd); }
.bp-item.dont:hover { border-color: var(--red-bd); }
.bp-item-icon { flex-shrink: 0; font-weight: 700; font-size: 13px; margin-top: 1px; }
.bp-item.do   .bp-item-icon { color: var(--green); }
.bp-item.dont .bp-item-icon { color: var(--red); }

/* ── WCAG REFERENCE CARDS ── */
.wcag-ref-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color var(--transition);
}
.wcag-ref-card:hover { border-color: var(--border-default); }
.wcag-ref-ratio {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  margin-bottom: var(--space-1);
}
.wcag-ref-label {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: var(--space-2);
}

/* ── PALETTE SWATCHES ── */
.safe-swatches { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.swatch-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.swatch-group:hover .swatch { transform: scale(1.12); box-shadow: var(--shadow-md); }
.swatch {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-default);
  transition: all var(--transition);
}
.swatch-name {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  max-width: 48px;
  line-height: 1.2;
}

/* ── COMBO CELLS ── */
.combo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: var(--space-3); }
.combo-cell {
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.combo-cell:hover { transform: scale(1.04); box-shadow: var(--shadow-lg); }
.combo-cell-name  { font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.combo-cell-ratio { font-size: 11px; font-family: var(--font-mono); opacity: 0.75; }
.combo-cell-tag   { font-size: 10px; margin-top: 4px; opacity: 0.7; }

/* ── CHECKER PAIRS ── */
.checker-pair {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--transition);
}
.checker-pair:hover { border-color: var(--border-default); }
.cp-swatches { display: flex; gap: var(--space-1); }
.cp-swatch {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
}
.cp-names { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 2px; }
.cp-ratio { font-size: 14px; font-weight: 500; font-family: var(--font-mono); }
.cp-pills { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.cp-preview {
  width: 44px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  font-family: var(--font-mono);
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.checker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 14px;
  gap: var(--space-2);
}
.checker-empty-icon { font-size: 30px; opacity: 0.25; }

/* ── FOTO DEMOS ── */
.anim-demo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.anim-demo-screen {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: white;
}
.anim-demo-footer {
  padding: 8px 12px;
  background: var(--bg-raised);
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── SAFE TAG ── */
.safe-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}
.safe-tag.safe   { background: var(--green-bg); color: var(--green); }
.safe-tag.danger { background: var(--red-bg);   color: var(--red); }
.safe-tag.warn   { background: var(--yellow-bg); color: var(--yellow); }

/* ── WARNING BANNER ── */
.warning-banner {
  background: var(--red-bg);
  border: 1px solid var(--red-bd);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--red);
  line-height: 1.55;
}
.warning-banner strong { font-weight: 600; }

.info-banner {
  background: var(--accent-bg);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--accent);
  line-height: 1.55;
}

/* ── HZ DEMO ── */
.hz-demo-box {
  width: 80px; height: 80px;
  border-radius: var(--radius-md);
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  flex-shrink: 0;
}
.hz-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.hz-result {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
}

/* ── SUMMARY CARDS ── */
.summary-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-2); margin-top: var(--space-4); }
.summary-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}
.summary-card .num {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 3px;
}
.summary-card .lbl { font-size: 11px; color: var(--text-muted); }
.summary-card.pass { background: var(--green-bg); border-color: var(--green-bd); }
.summary-card.pass .num { color: var(--green); }
.summary-card.fail { background: var(--red-bg); border-color: var(--red-bd); }
.summary-card.fail .num { color: var(--red); }

/* ── ED PALETTE ── */
.ed-pal-cell {
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.ed-pal-cell:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.ed-pal-name  { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.ed-pal-hex   { font-size: 11px; font-family: var(--font-mono); opacity: 0.7; margin-bottom: 6px; }
.ed-pal-use   { font-size: 11px; opacity: 0.6; line-height: 1.4; }

/* ── REDUNDANCY BOX ── */
.redundancy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.redundancy-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.redundancy-card h4 { font-size: 13px; font-weight: 500; font-family: var(--font-sans); color: var(--text-primary); margin-bottom: 5px; }
.redundancy-card p  { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ── RULE CARD ── */
.rule-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}
.rule-card-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 5px;
}
.rule-card-title { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 4px; }
.rule-card-desc  { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
