/* ev-vs-gas-calculator — namespace: .evc- */

/* Data-viz colors only — never use for UI chrome */
:root {
  --evc-ev:   #3b82f6;
  --evc-gas:  #f97316;
  --evc-be:   #22c55e;
  --evc-grid: var(--border);
  --evc-axis: var(--text-muted);
}

.evc-wrap {
  max-width: 1060px;
  margin: 0 auto;
}

/* ===== Unit toggle ===== */
.evc-unit-toggle {
  display: flex;
  gap: 0.375rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  width: fit-content;
  margin-bottom: 1.5rem;
}

.evc-unit-btn {
  padding: 0.45rem 1.1rem;
  min-height: 36px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.evc-unit-btn:hover { color: var(--text); }

.evc-unit-btn.active {
  background: var(--brand-cyan-bg);
  border-color: var(--brand-cyan-border);
  color: var(--brand-cyan);
}

/* ===== Vehicle cards grid ===== */
.evc-section { margin-bottom: 1.25rem; }

.evc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.evc-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.evc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.evc-card-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.evc-ev-title  { color: var(--evc-ev); }
.evc-gas-title { color: var(--evc-gas); }

/* ===== Fields ===== */
.evc-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.evc-field:last-child { margin-bottom: 0; }

.evc-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.evc-field input[type="number"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  width: 100%;
  min-height: 44px;
  transition: var(--transition);
  -moz-appearance: textfield;
}

.evc-field input[type="number"]::-webkit-inner-spin-button,
.evc-field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.evc-field input[type="number"]:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.14);
  outline: 0;
}

.evc-field input[type="range"] {
  width: 100%;
  accent-color: var(--brand-cyan);
  min-height: 20px;
}

.evc-field-range { grid-column: span 3; }

/* Prefix inside input */
.evc-input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
  transition: var(--transition);
}

.evc-input-wrap:focus-within {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.14);
}

.evc-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  user-select: none;
  flex-shrink: 0;
}

.evc-input-wrap input[type="number"] {
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
  min-width: 0;
}

.evc-input-wrap input[type="number"]:focus {
  border: none;
  box-shadow: none;
  outline: none;
}

/* ===== Button row (Calculate + Copy + Reset) ===== */
.evc-btn-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

/* ===== CTA button ===== */
.evc-calc-btn {
  flex: 1;
  max-width: 320px;
  padding: 0.85rem 2rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  background: var(--brand-gradient);
  color: var(--brand-ink);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  min-height: 44px;
  box-shadow: 0 10px 28px rgba(6,182,212,.28), 0 1px 0 rgba(255,255,255,.3) inset;
  transition: var(--transition);
}

.evc-calc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(6,182,212,.35);
}

/* ===== Stat cards ===== */
.evc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.evc-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.evc-stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.evc-stat-val {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.2;
}

.evc-stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== Chart — hero result card ===== */
.evc-chart-wrap {
  background: radial-gradient(circle at top right, rgba(6,182,212,.10), transparent 58%), var(--surface);
  border: 1px solid var(--brand-cyan-border);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(6,182,212,.06), 0 18px 40px rgba(0,0,0,.12);
  padding: 1.25rem 1.25rem 1rem;
}

.evc-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.evc-leg {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.evc-leg::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.evc-leg-ev::before  { background: var(--evc-ev); }
.evc-leg-gas::before { background: var(--evc-gas); }
.evc-leg-be::before  { background: var(--evc-be); border-style: dashed; background: none; border-top: 2px dashed var(--evc-be); }

#evcChart svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .evc-grid-2   { grid-template-columns: 1fr; }
  .evc-grid-3   { grid-template-columns: 1fr; }
  .evc-field-range { grid-column: 1; }
  .evc-stats    { grid-template-columns: 1fr 1fr; }
  .evc-btn-row  { flex-wrap: wrap; }
  .evc-calc-btn { max-width: 100%; flex: 1 1 100%; }
  .evc-unit-toggle { width: 100%; }
  .evc-unit-btn { flex: 1; text-align: center; }
}

@media (max-width: 400px) {
  .evc-stats { grid-template-columns: 1fr; }
}
