
/* ============================================================
   CALCOLO INVERSO — classi aggiuntive
   Da appendere a styles.css
   ============================================================ */

/* Layout wrapper */
.inv-wrapper { flex: 1; padding: 0 20px 56px; }

/* Card identica a .main-card ma con selector dedicato */
.inv-card {
  position: relative;
  background: #fff;
  border-radius: 22px;
  padding: 20px 24px 22px;
  box-shadow: 0 8px 40px rgba(15,23,42,.10);
  border: 1px solid rgba(0,0,0,.05);
}

/* Input CF grande monospace */
.cf-input-wrap { position: relative; margin: 18px 0 6px; }
.cf-input-wrap input {
  width: 100%;
  background: #f0f5f2;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  letter-spacing: 0.22em;
  color: #1e293b;
  text-transform: uppercase;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  appearance: none;
  -webkit-appearance: none;
}
.cf-input-wrap input::placeholder {
  color: #9ca3af;
  font-size: .82rem;
  letter-spacing: .04em;
  font-family: 'Inter', sans-serif;
}
.cf-input-wrap input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5,150,105,.10);
  background: #fff;
}
.cf-input-wrap input.input-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}

/* Counter 0/16 */
.cf-counter {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .75rem;
  font-weight: 600;
  color: #9ca3af;
  pointer-events: none;
}
.cf-counter.ready { color: #059669; }

/* Result box — verde (valido) o rosso (non valido) */
.inv-result {
  display: none;
  margin-top: 14px;
  border-radius: 14px;
  padding: 18px 20px;
  border: 2px solid #34d399;
  background: #f0faf4;
  overflow: hidden;
}
.inv-result.invalid {
  border-color: #fca5a5;
  background: #fff5f5;
}

/* Label in cima al result box */
.inv-result-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #059669;
  margin-bottom: 14px;
}
.inv-result.invalid .inv-result-label { color: #dc2626; }

/* Righe dati decodificati */
.inv-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.inv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.7);
  border-radius: 10px;
  padding: 9px 14px;
  border: 1px solid rgba(52,211,153,.2);
}
.inv-result.invalid .inv-row { border-color: rgba(252,165,165,.3); }

.inv-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.inv-result.invalid .inv-row-icon { background: #fef2f2; }

.inv-row-label {
  font-size: .75rem;
  font-weight: 600;
  color: #94a3b8;
  min-width: 120px;
}
.inv-row-value {
  font-size: .9rem;
  font-weight: 700;
  color: #0f172a;
}
.inv-row-note {
  font-size: .72rem;
  color: #9ca3af;
  font-weight: 400;
  margin-left: 4px;
}

/* Badge omocodia */
.homo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: .72rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 12px;
}

/* Azioni reset */
.inv-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

@media (max-width: 520px) {
  .inv-row-label { min-width: 80px; }
}
