/* ============================================================
   transistor_ec.css — Calculateur NPN émetteur commun classe A
   Compatible thème Astra / WordPress
   ============================================================ */

.tc-wrapper {
  font-family: inherit;
  max-width: 680px;
  margin: 0 0 2em 0;
}

/* ── Blocs étapes ── */
.tc-block {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  margin-bottom: 1.2em;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: opacity 0.25s;
}

.tc-block-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.tc-block-header {
  background: #1a3a5c;
  color: #fff;
  padding: 0.75em 1.2em;
  display: flex;
  align-items: center;
  gap: 0.8em;
  border-bottom: 3px solid #e8a020;
}

.tc-step {
  background: #e8a020;
  color: #fff;
  font-size: 0.75em;
  font-weight: 700;
  padding: 0.2em 0.6em;
  border-radius: 3px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tc-block-title {
  font-size: 1em;
  font-weight: 700;
}

.tc-block-body {
  background: #f8f9fa;
  padding: 1em 1.2em;
}

/* ── Image schéma ── */
.tc-img-wrap {
  margin-bottom: 1em;
  text-align: center;
}

.tc-schema-img {
  max-width: 100%;
  height: auto;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #fff;
}

/* ── Titres de section ── */
.tc-section-title {
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1a3a5c;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.25em;
  margin: 0.9em 0 0.55em 0;
}

.tc-section-title:first-of-type { margin-top: 0; }

/* ── Grille de champs ── */
.tc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65em 1em;
  margin-bottom: 0.4em;
}

.tc-field {
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}

.tc-field label {
  font-size: 0.84em;
  font-weight: 500;
  color: #333;
}

.tc-hint {
  font-size: 0.74em;
  color: #888;
  font-style: italic;
}

/* ── Budget tensions ── */
.tc-budget {
  font-size: 0.82em;
  color: #555;
  margin: 0.3em 0 0.6em;
  padding: 0.35em 0.7em;
  background: #e9ecef;
  border-radius: 4px;
}

.tc-budget-val {
  font-weight: 700;
}

/* ── Inputs ── */
.tc-input-wrap {
  display: flex;
  border: 1px solid #ced4da;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tc-input-wrap:focus-within {
  border-color: #1a3a5c;
  box-shadow: 0 0 0 2px rgba(26,58,92,0.15);
}

.tc-input-wrap input[type="number"] {
  flex: 1;
  min-width: 0;
  padding: 0.4em 0.5em;
  border: none;
  background: transparent;
  font-size: 0.95em;
  outline: none;
  -moz-appearance: textfield;
}

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

.tc-unit {
  background: #e9ecef;
  border-left: 1px solid #adb5bd;
  padding: 0 0.5em;
  font-size: 0.82em;
  font-weight: 600;
  color: #555;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.tc-unit-sel {
  background: #e9ecef;
  border: none;
  border-left: 1px solid #adb5bd;
  padding: 0 0.3em;
  font-size: 0.82em;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  outline: none;
  min-width: 46px;
}

/* ── Boutons ── */
.tc-actions {
  display: flex;
  gap: 0.6em;
  margin: 0.8em 0 0.5em;
}

.tc-btn {
  padding: 0.45em 1.2em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}

.tc-btn:active  { transform: scale(0.97); }
.tc-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.tc-btn-primary           { background: #1a3a5c; color: #fff; }
.tc-btn-primary:hover:not(:disabled) { background: #0d2540; }
.tc-btn-secondary         { background: #6c757d; color: #fff; }
.tc-btn-secondary:hover   { background: #5a6268; }

/* ── Résultats ── */
.tc-result {
  margin-top: 0.8em;
  border: 1px solid #c3e6cb;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}

.tc-result-title {
  background: #28a745;
  color: #fff;
  padding: 0.4em 0.9em;
  font-size: 0.82em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87em;
}

.tc-table td {
  padding: 0.32em 0.9em;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.tc-lbl { color: #555; width: 58%; }

.tc-val {
  color: #155724;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.tc-table tr:last-child td { border-bottom: none; }

/* Séparateurs de section dans le tableau */
.tc-sep td {
  background: #eef2f7;
  color: #1a3a5c;
  font-weight: 700;
  font-size: 0.8em;
  padding: 0.45em 0.9em 0.3em;
  border-bottom: 1px solid #dee2e6 !important;
  letter-spacing: 0.03em;
}

/* Lignes de vérification */
.tc-chk td      { background: #fafafa; }
.tc-chk-detail  { font-size: 0.9em; color: #555; font-weight: 400; }

/* Indicateurs */
.tc-ok   { color: #28a745; font-weight: 700; }
.tc-warn { color: #e8a020; font-weight: 700; }
.tc-err  { color: #dc3545; }

/* Valeur E12 */
.tc-e12 {
  font-size: 0.86em;
  color: #856404;
  font-weight: 400;
}

/* ── Zone héritée ── */
.tc-inherited {
  background: #e8f4fd;
  border: 1px solid #b8daff;
  border-radius: 4px;
  padding: 0.55em 0.9em;
  margin-bottom: 0.8em;
  font-size: 0.84em;
  color: #004085;
}

.tc-inh-title {
  font-weight: 700;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35em;
}

.tc-inh-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1.5em;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .tc-grid     { grid-template-columns: 1fr; }
  .tc-actions  { flex-direction: column; }
  .tc-inh-grid { flex-direction: column; gap: 0.2em; }
}

/* ── Additions v2 ── */

/* Zone gain cible */
.tc-gain-cible-zone {
  background: #f0f4f8;
  border: 1px solid #c8d8e8;
  border-radius: 5px;
  padding: 0.7em 1em;
  margin: 0.5em 0 0.8em;
}

/* Équivalent linéaire du gain */
.tc-db-equiv {
  font-size: 1.4em;
  font-weight: 700;
  color: #1a3a5c;
  padding-top: 0.5em;
}

.tc-field-info {
  justify-content: center;
}

/* Ligne info (sans icône) */
.tc-val.tc-info {
  color: #555;
  font-weight: 400;
  font-size: 0.88em;
  text-align: left;
  white-space: normal;
  line-height: 1.4;
}

/* Ligne avertissement inline tableau */
.tc-warn-row td {
  background: #fff8e1;
  color: #856404;
  padding: 0.45em 0.9em;
  font-size: 0.86em;
  border-bottom: 1px solid #ffe082 !important;
}

.tc-warn-txt {
  color: #856404;
  font-weight: 600;
}

/* Radio group */
.tc-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  margin-bottom: 0.6em;
}

.tc-radio {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.9em;
  cursor: pointer;
  padding: 0.35em 0.6em;
  border-radius: 4px;
  transition: background 0.1s;
}

.tc-radio:hover { background: #e9ecef; }
.tc-radio input[type="radio"] { accent-color: #1a3a5c; }

/* ── Tracé de Bode ── */
.tc-bode-canvas {
  width: 100%;
  max-width: 100%;
  display: block;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #fff;
  margin-top: 1em;
}
