function validateRC(value) {
  return /^\d{6}\/\d{3,4}$/.test(value.trim());
}
function validateIBAN(value) {
  const v = value.replace(/\s+/g, '');
  return /^SK\d{22}$/.test(v);
}
function validateField(input) {
  const type = input.dataset.validate;
  if (!type || !input.value) return true;
  let ok = true;
  if (type === 'rc') ok = validateRC(input.value);
  if (type === 'iban') ok = validateIBAN(input.value);
  input.style.borderColor = ok ? '#7cb16d' : '#cc0000';
  return ok;
}