/**
 * Light-theme styles for legacy tool partials (tool-workspace, badges, metrics).
 * Site chrome uses dosefirst-live.css; BMI uses df-* components.
 * Other calculators still use the older class names from the dark dosefirst.css.
 */

:root {
  --df-emerald: #1ba7a6;
  --df-cyan: #0891b2;
  --df-violet: #7c3aed;
  --df-rose: #e11d48;
  --df-amber: #d97706;
  --df-radius-sm: 8px;
  --df-radius-md: 10px;
  --df-radius-lg: 12px;
  --df-radius-full: 9999px;
  --df-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --df-transition: all 0.2s ease;
}

/* Minimal flex utilities used by tool blades */
.tool-workspace .flex,
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--df-radius-full);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.badge-emerald {
  background: #e6f4f1;
  border-color: #99d5d0;
  color: #0f766e;
}

.badge-cyan {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.badge-violet {
  background: #f3e8ff;
  border-color: #d8b4fe;
  color: #6b21a8;
}

.badge-rose {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #be123c;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #d7dde3;
  color: #475569;
  border-radius: var(--df-radius-sm);
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost:hover {
  background: #f8fafc;
  color: #0d1b2a;
  border-color: #94a3b8;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0d1b2a;
  margin-bottom: 0.45rem;
}

.form-hint {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.35rem;
}

.tool-workspace .form-control,
.tool-workspace .form-select,
.tool-input-pane .form-control,
.tool-input-pane .form-select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #d7dde3;
  border-radius: var(--df-radius-md);
  padding: 0.7rem 0.95rem;
  color: #0d1b2a;
  font-size: 0.95rem;
  min-height: 2.75rem;
  outline: none;
  transition: var(--df-transition);
}

.tool-workspace .form-control:focus,
.tool-workspace .form-select:focus,
.tool-input-pane .form-control:focus,
.tool-input-pane .form-select:focus {
  border-color: #1ba7a6;
  box-shadow: 0 0 0 3px rgba(27, 167, 166, 0.18);
}

.unit-toggle-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: var(--df-radius-md);
  border: 1px solid #d7dde3;
  gap: 0.25rem;
}

.unit-toggle-btn {
  padding: 0.4rem 0.9rem;
  border-radius: var(--df-radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  transition: var(--df-transition);
}

.unit-toggle-btn.active {
  background: #1ba7a6;
  color: #ffffff;
  font-weight: 700;
}

.tool-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .tool-workspace {
    grid-template-columns: 1fr;
  }
}

.tool-input-pane,
.tool-output-pane {
  background: #ffffff;
  border: 1px solid #d7dde3;
  border-radius: var(--df-radius-lg);
  padding: 1.5rem 1.35rem;
  box-shadow: 0 18px 50px rgba(13, 27, 42, 0.06);
}

.tool-input-pane h3,
.tool-output-pane h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0d1b2a;
}

.tool-output-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8f9 100%);
}

.metric-display {
  text-align: center;
  padding: 1.5rem 0.75rem 0.75rem;
}

.metric-value {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 800;
  font-family: var(--df-font-mono);
  line-height: 1;
  color: #0d1b2a;
  letter-spacing: -0.03em;
}

.metric-unit {
  font-size: 1.05rem;
  font-weight: 500;
  color: #64748b;
  margin-top: 0.35rem;
}

.metric-status-badge {
  display: inline-block;
  padding: 0.4rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--df-radius-full);
  margin-top: 1rem;
  background: #e6f4f1 !important;
  color: #0f766e !important;
  border: 1px solid #99d5d0 !important;
}

.metric-breakdown-list {
  border-top: 1px solid #e2e8f0;
  padding-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
}

.metric-row-label {
  color: #64748b;
}

.metric-row-value {
  font-weight: 700;
  font-family: var(--df-font-mono);
  color: #0d1b2a;
  text-align: right;
}

.gauge-track {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: var(--df-radius-full);
  position: relative;
  margin: 1.25rem 0;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  border-radius: var(--df-radius-full);
  background: #1ba7a6;
  transition: width 0.35s ease, background-color 0.35s ease;
}

.text-emerald { color: var(--df-emerald) !important; }
.text-cyan { color: var(--df-cyan) !important; }
.text-violet { color: var(--df-violet) !important; }
.text-rose { color: var(--df-rose) !important; }
.text-amber { color: var(--df-amber) !important; }
